Saturday, May 21, 2011

ffmpeg - phone size

Links: volume post   general howto   random settings  

Mp4's and flv's are our friends, cell-phone sized (320x240 generic, 432x320 iPhone) viewables. Trick with ffmpeg is getting them there without pixellation and the right volume settings. This entry is just a collection of transcoding settings I've played with. There are plenty of good howto's out there forum information.

audio :: volume and sync

Sometimes .flv files are the correct size but with sync or volume inconsistencies. Resampling to keep volume the same is done by leaving off volume settings, or using the default setting of -vol 256. Going to 512 will double it, and I've found that 768 works well if the original sound is faint. So, to resample with an increase in volume:
$ ffmpeg -i somefile.flv -vol 512 -acodec libfaac someout.flv
I find specifying "libfaac" avoids libmp3 and its playback oddities. Increases the output file size by maybe 10 percent, say from 5.8M to 5.9M, but stable playback.

video :: pixellation

I think the pixellation that occurs shrinking videos is if the pixel size stays the same size as it was for the larger version. Also, 2 pass encoding is probably the best, sending the first pass to null, and turning off the audio ("an") and video (-y /dev/null)
$ ffmpeg somefile.avi -pass 1 -f rawvideo -y /dev/null -an

No comments: