views:

114

answers:

1

Hi folks,

I'm using the following command in order to convert .avi video files

ffmpeg -i -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 320×240 -vcodec libx264 -b 96k -flags +loop -cmp +chroma -partitions +parti4×4+partp8×8+partb8×8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2

The video converts, but when I try and open it from the iPhone's Safari I am greeted with

This movie format is not supported


Any ideas? Help would be awesome!

Also if there are any python scripts/apps that are available, it would be very useful.

+1  A: 

As far as I know, you need to use AAC for the audio format and MP4 for the container.

VBITRATE=700
ABITRATE=96
ffmpeg -i inputfile.avi -vcodec mpeg4 -b $VBITRATE -qmin 3 -qmax 5 \
     -bufsize 4096 -g 300 -acodec aac -ab $ABITRATE \
     -f mp4 -size 320x240 -r 25 outputfile.mp4

I think it would support both libx264 and mpeg4 for the video codec.

Bruno
Hi Bruno is there anything I can do to preserve aspect ratio?
RadiantHex
This is controlled by `-s 320×240` (for the size) and `-aspect 320:240` for the aspect (like what's in your example). If you know the aspect you know in advance for a particular video, the calculation is doable by hand for each case. If you want something more automatic, you may need to get the output of `ffmpeg -i inputfile` (or other similar tool) and extract the sizes from there.
Bruno