-
-
Save yellowled/1439610 to your computer and use it in GitHub Desktop.
# webm | |
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm | |
# mp4 | |
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4 | |
# ogg (if you want to support older Firefox) | |
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend |
Thanks for sharing this script. Extremely useful!
BTW I found that while single-pass webm video looks bad compared to h264 videos with the same size, its performance is pretty satisfactory when using 2-pass encoding workflow.
ffmpeg -i $(IN) -c:v libvpx -pass 1 -an -f rawvideo -y /dev/null # Generates ffmpeg2pass-0.log
ffmpeg -i $(IN) -c:v libvpx -pass 2 -f webm -b:v 400K -crf 10 -an -y $(OUT).webm
Thanks very useful ;)
Just what I needed! Convertion to webm succesful, but to mp4 i received the error message: "File for preset 'slow' not found"
Looking around, i found out that now the preset option must be declared using -preset instead of -vpre - thanks to Stack Overflow: http://stackoverflow.com/questions/11929109/i-only-have-two-presets-for-ffmpeg-x264-in-ubuntu-11-04
That helped a lot! Thanks for sharing ;)
This was a good starting point. I went further and am to do all the encoding without having to directly install FFmpeg! https://github.com/chuyskywalker/easy-web-video-encode
THANK YOU!
As @joaofnr said, -vpre
does need to be changed to -preset
in the mp4 line
Will probably convert this to a bash script later, but for the time being, here's some examples.
Well, I did it now. https://github.com/rpsu/dvd_converter/
Maybe someone is interested in my stuff ;)