I recorded some presentations at work recently using a Canon Vixia HF R21 video camera, and needed to encode the videos to lower resolution. It took me longer to figure this out than I expected, so I thought that I'd document the details. InputThe camera exposes an MTP interface when plugged in using USB, and the video
files are stored under EncodingThe best codecs in terms of storage space efficient seem to be H.264 and AAC, so that's what I chose to encode the output in. I wanted a good quality version at 720p, and a lower quality version at 480p. Since these were presentations, single channel audio is sufficient. I tried using both libav (previously ffmpeg) and mencoder and had trouble with both, but eventually got libav working. Good qualityThe command I used for good quality was:
Audio is reduced to mono and encoded in AAC at 128kbps. Video is resized to
1280x720, deinterlaced, and encoded in H.264 with the default quality
settings. To adjust the quality one can use the On my Intel Core2 Duo P8600 this encoded at 10fps with a video bitrate of
700kbps and audio bitrate of 83kbps. This puts an hour of video at 339MiB.
Adding Low qualityThe command I used for low quality was:
Audio is encoded the same as above. Video is resized to 848x480, deinterlaced and encoded in H.264. Apparently codecs are more efficient when the resolutions are a multiple of 16 which is why the video is resized to 854 and then reduced to 848. This encoded at 20fps with a video bitrate of 300kbps and audio bitrate of 83kbps. This puts an hour of video at 165MiB.
Trackback URL for this post:http://michael.gorven.za.net/trackback/1492
|
|||
Launchpad




H.264 isn't a free codec. In
H.264 isn't a free codec. In other words, I have to install the medibuntu repos on my machine before I can encode to it using mencoder. Don't have to do the same with xvid. On the other hand, f@ck freedom and go with something that will play well on the raspberry pi!
Secondly, consider transcoding to one of the supported DVD resolutions should you ever want to master DVDs at a later stage and the only video you have archived is the H264. 848 by 480, I would think, is non standard. The archiving codec thing is a bit of an odd one at the moment, but at least you'll be able to play a DVD in 10 years time.
Yeah, I realise H.264 isn't
Yeah, I realise H.264 isn't completely free (nor is AAC I think). I didn't really have time to compare it to Xvid+MP3, might do that at some stage. The libav
480ppreset is 852x480, so it's only off by 4 pixels. Maybe multiples of 4 are good enough?