Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updated november 2016
- MANUALLY
- BEFORE:
- 0. For Debian/*buntu, just "sudo apt-get install ffmpeg"
- 1. Download ffmpeg from here http://ffmpeg.zeranoe.com/builds/ (static, 32 or 64, whatever, ffmpeg.exe is inside of the "bin" folder)
- 2. Move ffmpeg to "C:\Users\Anon\" (your videos must be there too)
- 3. Open the command prompt: press "Windows key + R" and type "cmd" or Start > All Programs > Accessories > Command Prompt.
- tl;dr just copy these
- # excellent quality, VP8
- ffmpeg -i 1.mkv -c:v libvpx -quality good -b:v 3000k -bufsize 1000k -auto-alt-ref 1 -lag-in-frames 25 -threads 3 -an -pass 1 -f webm null
- # then
- ffmpeg -i 1.mkv -c:v libvpx -quality good -b:v 3000k -bufsize 1000k -auto-alt-ref 1 -lag-in-frames 25 -threads 3 -an -pass 2 -f webm kpop.webm
- # ok quality, VP8 (One pass, also used for gifs)
- ffmpeg -i 1.mkv -c:v libvpx -quality good -cpu-used 1 -b:v 1000k -bufsize 1000k -auto-alt-ref 1 -lag-in-frames 16 -threads 3 -an -f webm 1.webm
- # excellent quality but very slow, VP9 (CHANGE 3000K to you desired bitrate, 3000K-5000K is for a good 720p)
- ffmpeg -i 1.mkv -c:v libvpx-vp9 -b:v 3000K -tile-columns 0 -frame-parallel 0 -g 9999 -aq-mode 0 -threads 1 -an -pass 1 -speed 4 -f webm null
- ffmpeg -i 1.mkv -c:v libvpx-vp9 -b:v 3000K -tile-columns 0 -frame-parallel 0 -g 9999 -aq-mode 0 -threads 3 -an -pass 2 -speed 0 -auto-alt-ref 1 -lag-in-frames 25 -f webm out.webm
- # great quality, good speed, VP9
- ffmpeg -i 1.mkv -c:v libvpx-vp9 -b:v 3000K -crf 20 -tile-columns 6 -frame-parallel 1 -threads 3 -an -pass 1 -speed 4 -f webm null
- ffmpeg -i 1.mkv -c:v libvpx-vp9 -b:v 3000K -crf 20 -tile-columns 6 -frame-parallel 1 -threads 3 -an -pass 2 -speed 2 -auto-alt-ref 1 -lag-in-frames 25 -f webm out.webm
- # notes:
- # "-quality best" is not recommended, it slows down the encoding and the improvement of quality is imperceptible
- # "-auto-alt-ref 1" and "-lag-in-frames 25" are added on the second pass with VP9
- --------------------------------------------------------------------
- additional parameters:
- # for an exact 3 MB webm (x is the time)
- -b:v 25165824/X*0.975 -maxrate 25165824/X*0.975
- # sound as vorbis (replace -an with this)
- -c:a libvorbis -b:a 128k
- # add metadata
- -metadata title="title goes here"
- # copy the video/audio without encoding (if you just want to resize or something similar; a=audio,v=video)
- -acodec copy
- -vcodec copy
- # target quality, only for vp9 (20 is good, 10 is better, 30 is less good)
- -crf 20
- # downsampling a 5.1 source to 2.0 with Dolby
- -af "aresample=matrix_encoding=dplii" -ac 2
- # change the color scheme
- -pix_fmt yuv420p
- # video filters go right after the file name, separated with commas: -vf yadif=0,ass=1.ass,delogo=...
- # scale (-1 is to keep the aspect ratio)
- -vf scale=1280:-1
- # yet another deinlerlacer, 0 is for 30 fps, 1 is for 60 fps
- -vf yadif=1
- # add subtitles (ass is the real extension)
- -vf ass="/home/anon/that.ass"
- # erase some logo, like SBS, KBS, etc (test it first!)
- # MBC
- -vf delogo=x=1530:y=55:w=300:h=100:band=10
- # Mnet
- -vf delogo=x=1615:y=70:w=195:h=90:band=10
- # slow down
- -filter:V "setpts=2.0*PTS"
- or 3.0, etc.
- -------------------------------------------------------------------------------------------
- Miscellaneous use of ffmpeg
- # convert to huffyuv (lossless video and audio, to later edit; -ss is the time, -t is the duration)
- ffmpeg -ss 00:00:00.000 -i 1.mkv -t 00:00:00.000 -c:v huffyuv -acodec pcm_s16le output.mkv
Advertisement
Add Comment
Please, Sign In to add comment