Eventually, it came down (sadly) to converting WEBM to MP4 or AVI. Since MP4 is a long established container, it plays on nearly anything, if the bitrate isn't too high. A simple CLI solution always seems efficient for this kind of a conversion. After Googling, I came across this page which advised the following:
$ ffmpeg -i input.webm -c:v libx264 -crf 20 -c:a aac -strict experimental out.mp4This works all right.
round 2
If time permits, or if the bitrate has to be brought down (4700K fine for sports, 1100K fine for teaching), I like the approach of breaking out the video and the sound and recombining. Let's say I want a teaching vid, shot at some ridiculously high 14000K bit rate, to play well on an old laptop or look good on a 55" screen...$ ffmpeg -i original.webm -vn -ar 44100 -ac 2 sound.wav... taking the volume up just a hair to overcome any transcoding loss.
$ ffmpeg -i original.webm -vcodec libx264 -b:v 1000k -s wxga -an video.avi
$ ffmpeg -i video.avi -i sound.wav -acodec libmp3lame
-ar 44100 -ab 192k -ac 2 -vol 330 -vcodec copy -b:v 1000k output.mp4
rotation
A lot of times for cell phone vids, the video is rotated 90° one direction or the other. To straighten, add the '-vf transpose' option. 1 rotates +90, 2 rotates -90, and 0 and 3 do something that also includes flips...$ ffmpeg -i original.webm -vn -ar 44100 -ac 2 sound.wav
$ ffmpeg -i original.webm -vcodec libx264 -b:v 1000k -vf "transpose=2" -s wxga -an video.avi
$ ffmpeg -i video.avi -i sound.wav -acodec libmp3lame -ar 44100 -ab 192k -ac 2 -vol 330 -vcodec copy -b:v 1000k output.mp4
No comments:
Post a Comment