Advertisement
Guest User

ffmpeg WebM Conversion Windows Guide

a guest
May 3rd, 2014
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. --- ffmpeg WebM Conversion Windows Guide ---
  2.  
  3. >0. If you don't want to use the command line but a user interface, just use this program made by a /g/entleman:
  4. https://github.com/WebMBro/WebMConverter
  5.  
  6. >1. Download the latest ffmpeg static build (32bit or 64bit, depending on your OS or just 32bit if you aren't sure) from: http://ffmpeg.zeranoe.com/builds/
  7. >2. Extract that somewhere and run ff-prompt.bat located in the extracted folder
  8. >3. Type the arguments into the command line. Here's an example:
  9. ffmpeg -i "C:\Path\To\sourceFile.mp4" -ss 00:00:01.234 -to 00:00:03.456 -c:v libvpx -threads 3 -cpu-used 0 -crf 4 -b:v 3000K -vf scale=1280:-1 -an "outputFile.webm"
  10. >4. ???
  11. >5. profit
  12.  
  13. Here's a rundown of the parameters:
  14. >ffmpeg
  15. The program used to convert videos.
  16.  
  17. >-i "C:\Path\To\sourceFile.mp4"
  18. Full path to where the source vid is located. ffmpeg supports most popular file containers (eg. mkv, mp4, wmv, ts, ...) and the codecs they support.
  19.  
  20. >-ss 00:00:01.234
  21. Where in the original video you would like conversion to start in the format hours:minutes:seconds.miliseconds.
  22. You can find out the time of the current frame in the video by pressing Ctrl+G in MPC-HC.
  23.  
  24. >-to 00:00:03.456
  25. Where in the original video you would like conversion to end.
  26.  
  27. >-c:v libvpx
  28. The library that should be used for conversion. You will never need to change this for making WebMs.
  29. libvpx is Google's library used for converting to WebMs in the VP8 format(current standard supported by all modern browsers. VP9 is in the works).
  30.  
  31. >-threads 3
  32. Number of CPU threads that should be used for conversion.
  33. You should set this to one less than your processor has cores if you want to be able to use your computer normally during the process.
  34.  
  35. >-cpu-used 0
  36. Supports values from 0 to 5.
  37. The higher the number, the faster the conversion is but the quality of the video is worse. I suggest just leaving it at 0.
  38.  
  39. >-crf 4
  40. The crf parameter enables constant quality of the video so every frame gets the number of bits so that it will, well... have the same quality as the other frames.
  41. It supports values from 4 to 63 and lower values mean better quality but higher file size. I always just leave it at 4.
  42.  
  43. >-b:v 3000K
  44. The desired average bitrate (kbits/s) of the output video. To get the video to be 3MB in size use the following formula: 24536 / (output video length in seconds).
  45. 24536 kbits = 3Mbytes. So if the output video is 8 seconds in length a good setting for this parameter would be just over 3000K (but I like round numbers).
  46.  
  47. >-vf scale=1280:-1
  48. The width:height of the output video. set it to width:-1 to let the encoder automatically calculate the height to keep the same aspect ratio or -1:height to let it autocalculate the width.
  49.  
  50. >-an
  51. Disables sound in the video. 4chan does not allow sound in WebMs.
  52.  
  53. >"outputFile.webm"
  54. Should always be the final parameter and tells the encoder what to name the output file which is then located in the 'bin' folder of ffmpeg.
  55.  
  56.  
  57.  
  58. >You can also do 2-pass encoding which takes a bit longer but will give you a higher quality video at a lower filesize. You should use this if you want to make larger and/or longer videos.
  59.  
  60. >You only need to add a '-pass 1' parameter so at first your command line should look something like this:
  61. ffmpeg -i "C:\Path\To\sourceFile.mp4" -ss 00:00:01.234 -to 00:00:03.456 -c:v libvpx -threads 3 -cpu-used 0 -crf 4 -b:v 3000K -vf scale=1280:-1 -an -pass 1 "outputFile.webm"
  62. >after you run that it will tell you that the output file is empty but no worries since the first pass doesn't actually output the video.
  63.  
  64. >Then you just change the '-pass' parameter to 2:
  65. ffmpeg -i "C:\Path\To\sourceFile.mp4" -ss 00:00:01.234 -to 00:00:03.456 -c:v libvpx -threads 3 -cpu-used 0 -crf 4 -b:v 3000K -vf scale=1280:-1 -an -pass 2 "outputFile.webm"
  66. >It will ask you to overwrite the existing empty file. Just put in 'y' for yes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement