Converting container or transcode movies to iPhone from command line (os x) Over the years I collected many movies in different container formats (avi, mp4, mkv) and encoded with different codecs too.

Now want convert containers (or transcode them if absolutely necessary) to "iPhone compatible" movies.

After spending long time on google, still didn't know exact answers to the next questions - so, please confirm them or please give the right answers


iPhone can play only mp4 container format - so the mp4 is the only usable container for iPhone movies
In what codecs can be the streams? (video/audio and subtitles)
Is possible embedd "SOFT" subtitles to mp4 container? (what i read - yes, but here is some pitfalls) - mean soft subtitles, so not "burned them into the video stream".
What is the right logic to convert/transcode movies from different formats to wanted iPhone compatible format? My idea is roughly:


fetch information from the current movie - e.g. from avi container
if the used codecs and the used video resolution is compatible with iPhone (like h264), only change the container format, otherwise
transcode the movie, with:
if the current movie has smaller resolution, don't change - only transcode
if the current movie has higher resolution, change it's resolution proportionally to match the iPhone needs



All above want do from command line on Mac OS X - so, with ffmpeg or mencoder and like. (please, don't suggest me batch conversions with not-command line app)

The questions are mainly about the whole workflow, what are the most common pitfalls, recommendations and etc.

Would be happy with some external links to some good articles about the above.

This is my 1st question here, and I hope it is OK with right-question-type on this site:


post-production techniques
asset management, media, and file formats
installation, configuration, and operation of hardware or software
related to these topics
You can use ffprobe (which comes with ffmpeg) to give you info about your movie files from the command line.

You may require some shell-fu to convert the output of ffprobe into something you can use though. I've done this in the past; basically I pipe the output of ffprobe to sed or awk to grab the bits of info I need, then use this to drive the parameters of ffmpeg.