Converting files for uShare & Samsung

Tech Notes

The oft-sited manual page After a lot of fooling around I twigged to the fact that SD MP4 support is limited to H.264/AAC @ 720x576 25fps. The key seemed to be the size - frame rate and audio codec mayn't be so crucial. To that end the following seem to work with ffmpeg. I'm still to get HD working (possibly uShare's issue) but H.264 BP means Baseline profile H.264 MP means Main profile If you're using ffmpeg you can use the -vpre (video preset) switch to automatically select Main or Baseline. My ffpresets files I copied from a source tarball of Handbrake into my ~/.ffmpeg folder. laudanum@Wakatipu:$ cp /home/rossetti/installers/HandBrake-0.9.4/build/contrib/ffmpeg/ffmpeg-r19067/ffpresets/* ~/.ffmpeg/ Then I can use them like this Main profile laudanum@Wakatipu:~$ ffmpeg -i [infile] -vpre default [outfile].mp4 Baseline profile(s) laudanum@Wakatipu:~$ ffmpeg -i [infile] -vpre main [outfile].mp4 laudanum@Wakatipu:~$ ffmpeg -i [infile] -vpre baseline [outfile].mp4 To get SD (standard definition) files that work both with uShare and Samsung I've been doing this. 16:9 aspect at 720x576 (anamorphic - stretched pixels) copying existing audio laudanum@Wakatipu:~$ ffmpeg -i [infile].m4v -f mp4 -s 720x576 \ -aspect 16:9 -acodec copy -vcodec libx264 -vpre default \ -vb 5000k [outfile].mp4 2.39:1 aspect (widescreen) converting audio too laudanum@Wakatipu:~$ ffmpeg -i [infile].m4v -f mp4 -s 720x576 \ -aspect 2.39 -acodec libfaac -ab 256k -vcodec libx264 -vpre default \ -vb 5000k [outfile].mp4 Note in the first example I don't convert the audio - that's because it's already in one of the preferred formats (from the Samsung chart) - AAC. We can figure that out before we encode (libfaad is AAC - but if we're encoding we use libfaac). Notice also that the reason it won't play as is is that the pixel shape isn't 720x576 - which is why we have to convert it. laudanum@Wakatipu:~$ ffmpeg -i [infile].m4v Stream #0.0(eng): Video: h264, yuv420p, 720x552, 25.00 tb(r) Stream #0.1(eng): Audio: libfaad, 48000 Hz, stereo Don't worry about overdoing the -vb (video bitrate) as ffmpeg will only use what it needs - ie: if the input bitrate is lower than the -vb then a lower bitrate is used. Down here I'm keeping some notes on compressing mp4 for iPhones. -y -i "c:\vid-in\" -aspect 4:3 -r 24 -s 640x480 -acodec aac -ab 96k -ar 22050 -vcodec libx264 -fpre "c:\videoencoder\bin\libx264-hq.ffpreset" -fpre "c:\videoencoder\bin\libx264-baseline.ffpreset" -b 400k -bt 400k -threads 0 "c:\vid-out\20077_m2.mp4" IPhone 3gs (third generation) plays the videos fine. first and second generation IPhones do not (get a Quicktime arrow with a slash through it).