pacocrowley

How to Make Webms

Apr 16th, 2015
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. updated november 2016
  2. MANUALLY
  3.  
  4. BEFORE:
  5. 0. For Debian/*buntu, just "sudo apt-get install ffmpeg"
  6. 1. Download ffmpeg from here http://ffmpeg.zeranoe.com/builds/ (static, 32 or 64, whatever, ffmpeg.exe is inside of the "bin" folder)
  7. 2. Move ffmpeg to "C:\Users\Anon\" (your videos must be there too)
  8. 3. Open the command prompt: press "Windows key + R" and type "cmd" or Start > All Programs > Accessories > Command Prompt.
  9.  
  10.  
  11.  
  12. tl;dr just copy these
  13.  
  14. # excellent quality, VP8
  15. 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
  16. # then
  17. 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
  18.  
  19. # ok quality, VP8 (One pass, also used for gifs)
  20. 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
  21.  
  22.  
  23. # excellent quality but very slow, VP9 (CHANGE 3000K to you desired bitrate, 3000K-5000K is for a good 720p)
  24. 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
  25. 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
  26.  
  27. # great quality, good speed, VP9
  28. 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
  29. 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
  30.  
  31.  
  32. # notes:
  33. # "-quality best" is not recommended, it slows down the encoding and the improvement of quality is imperceptible
  34. # "-auto-alt-ref 1" and "-lag-in-frames 25" are added on the second pass with VP9
  35.  
  36. --------------------------------------------------------------------
  37. additional parameters:
  38.  
  39. # for an exact 3 MB webm (x is the time)
  40. -b:v 25165824/X*0.975 -maxrate 25165824/X*0.975
  41. # sound as vorbis (replace -an with this)
  42. -c:a libvorbis -b:a 128k
  43. # add metadata
  44. -metadata title="title goes here"
  45. # copy the video/audio without encoding (if you just want to resize or something similar; a=audio,v=video)
  46. -acodec copy
  47. -vcodec copy
  48. # target quality, only for vp9 (20 is good, 10 is better, 30 is less good)
  49. -crf 20
  50. # downsampling a 5.1 source to 2.0 with Dolby
  51. -af "aresample=matrix_encoding=dplii" -ac 2
  52. # change the color scheme
  53. -pix_fmt yuv420p
  54.  
  55. # video filters go right after the file name, separated with commas: -vf yadif=0,ass=1.ass,delogo=...
  56. # scale (-1 is to keep the aspect ratio)
  57. -vf scale=1280:-1
  58. # yet another deinlerlacer, 0 is for 30 fps, 1 is for 60 fps
  59. -vf yadif=1
  60. # add subtitles (ass is the real extension)
  61. -vf ass="/home/anon/that.ass"
  62. # erase some logo, like SBS, KBS, etc (test it first!)
  63. # MBC
  64. -vf delogo=x=1530:y=55:w=300:h=100:band=10
  65. # Mnet
  66. -vf delogo=x=1615:y=70:w=195:h=90:band=10
  67. # slow down
  68. -filter:V "setpts=2.0*PTS"
  69. or 3.0, etc.
  70.  
  71. -------------------------------------------------------------------------------------------
  72.  
  73. Miscellaneous use of ffmpeg
  74.  
  75. # convert to huffyuv (lossless video and audio, to later edit; -ss is the time, -t is the duration)
  76. 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