Re: Problems converting to mp4 with mencoder and ffmpeg
Another small thing to consider is that sometimes phones and phone-like devices will baulk at FFmpeg's ffourcc for mpeg4 encoding so perhaps add:
in the video section...
Re: Problems converting to mp4 with mencoder and ffmpeg
Quote:
Originally Posted by
evilsoup
I would recommend upgrading to a more up-to-date version of fmpeg, according to your terminal your version is from 2009!
this PPA is a good one. I think that what I am about to write will not work on the version you have at the moment.
Once you've done that, the following command
should create an output file with the same parameters to your 3gp file that works on your phone:
Code:
## convert 16:9 video
ffmpeg -i input.avi -map 0:a -map 0:v -filter:v 'scale=176:-1,pad=176:144:(ow-iw)/2:(oh-ih)/2' \
-c:v mpeg4 -q:v 4 -c:a aac -b:a 96k -ac 1 -ar 22050 -strict experimental output.3gp
## convert 4:3 video
ffmpeg -i input.avi -map 0:a -map 0:v -filter:v 'scale=-1:144,pad=176:144:(ow-iw)/2:(oh-ih)/2' \
-c:v mpeg4 -q:v 4 -c:a aac -b:a 96k -ac 1 -ar 22050 -strict experimental output.3gp
The scale video filter... well, scales the video down - the 16:9 does so width-wise, scaling the height to keep in ratio with the width, and the 4:3 one does it height-wise. This is then fed to the pad, which puts the scaled video over the centre of a black box with a size of 176x144.
-ac 1 -ar 22050 makes the audio mono and gives it a sample rate of 22050 Hz. These are probably not strictly necessary. -map 0:a -map 0:v tells ffmpeg to make the audio be the first stream (stream 0) and the video be after the audio. Again, probably not necessary. The rest of the options are standard ffmpeg encoder things.
Thank you very much man...for your time and your explanation. I will try it. And all of you guys...I will try and if it works, I'll let you know.