Originally Posted by
robdocmagic
The author must not have tested some of the Android examples. The preset names should be case sensitive so "-vpre iPod640" should not work. Also, the ipod preset is meant to be used after a standard preset because it is supposed to overwrite the settings from the standard preset. Placement is important and using it before "-vpre slow" may not allow it to work as expected. I can't remember the details of the old ipod preset so it may not be an issue.
Originally Posted by
robdocmagic
Do you by chance have the syntax that I can use to convert to MP4 for iOS and Andriod? It would be much appreciated.
I don't own any of these devices but you can try one of these:
Code:
ffmpeg -i input -c:v libx264 -crf 24 -preset slow -vpre libx264-ipod640 -c:a libfaac -q:a 100 output.mp4
or
Code:
ffmpeg -i input -c:v libx264 -crf 24 -preset slow -profile:v baseline -level 30 -c:a libfaac -q:a 100 output.mp4
Both examples are very similar. The only difference is that the ipod preset just sets the additional bufsize and maxrate options that are probably not really needed. The only thing you may need to adjust is the crf value. Choose the highest value that still gives you an acceptable quality. You can add "-t 60" if you just want to test the first 60 seconds so you don't have to encode the whole thing to get a rough idea of what the rest of the movie could look like (of course it depends on the complexity of the various scenes) and to quickly see if it even works on your device.
You don't need to only use "slow" either. The general method is to use the slowest preset you have patience for. If "slow" is too slow ("slow" is unsurprisingly slow) then use a faster preset. See x264 --fullhelp for a list of presets and ignore the "placebo" preset as it is a joke and a waste of time.
You may want to resize your video for your device. If that is the case then add:
Code:
-filter:v scale="640:-1"
What this does it tell FFmpeg to use the scale filter to resize the video to 640 pixels wide. The -1 means to make the height whatever value it needs to be to preserve the aspect ratio. Unfortunately, depending on the size of your input, the -1 can often provide an odd numbered value which is not acceptable for libx264. Therefore I usually recommend using:
Code:
-filter:v scale="640:trunc(ow/a/2)*2"
It's basically similar to -1 but should return an even value. Alternatively, if you know a specific height instead, such as 360, you can use:
Code:
-filter:v scale="trunc(oh*a*2)/2:360"
So in the end your command may look like:
Code:
ffmpeg -i input -c:v libx264 -crf 24 -preset slow -profile:v baseline -level 30 -filter:v scale="640:trunc(ow/a/2)*2" -c:a libfaac -q:a 100 output.mp4
Bookmarks