Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ffmpeg WebM Conversion Windows Guide ---
- >0. If you don't want to use the command line but a user interface, just use this program made by a /g/entleman:
- https://github.com/WebMBro/WebMConverter
- >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/
- >2. Extract that somewhere and run ff-prompt.bat located in the extracted folder
- >3. Type the arguments into the command line. Here's an example:
- 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"
- >4. ???
- >5. profit
- Here's a rundown of the parameters:
- >ffmpeg
- The program used to convert videos.
- >-i "C:\Path\To\sourceFile.mp4"
- 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.
- >-ss 00:00:01.234
- Where in the original video you would like conversion to start in the format hours:minutes:seconds.miliseconds.
- You can find out the time of the current frame in the video by pressing Ctrl+G in MPC-HC.
- >-to 00:00:03.456
- Where in the original video you would like conversion to end.
- >-c:v libvpx
- The library that should be used for conversion. You will never need to change this for making WebMs.
- 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).
- >-threads 3
- Number of CPU threads that should be used for conversion.
- 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.
- >-cpu-used 0
- Supports values from 0 to 5.
- The higher the number, the faster the conversion is but the quality of the video is worse. I suggest just leaving it at 0.
- >-crf 4
- 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.
- It supports values from 4 to 63 and lower values mean better quality but higher file size. I always just leave it at 4.
- >-b:v 3000K
- 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).
- 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).
- >-vf scale=1280:-1
- 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.
- >-an
- Disables sound in the video. 4chan does not allow sound in WebMs.
- >"outputFile.webm"
- 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.
- >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.
- >You only need to add a '-pass 1' parameter so at first your command line should look something like this:
- 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"
- >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.
- >Then you just change the '-pass' parameter to 2:
- 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"
- >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