[FFmpeg-user] convert mp3 to 3gp or MP4

Moritz Barsnick barsnick at gmx.net
Fri Jun 7 00:47:18 CEST 2013


On Thu, Jun 06, 2013 at 11:50:54 +0100, Keith Beaumont wrote:
> So I would like to fool MePlayer. Is there a simple way with ffmpeg to convert MP3 to MP4 or 3GP in batch mode?

With ffmpeg, you can supply a lavfi filter as video input source:
e.g. 10 fps blank 640x480 video
ffmpeg -f lavfi -i color=black,scale=640:480 -codec:v mpeg2video -t 00:01:00 -r 10 blank.mpg

The video codec does matter in terms of conversion speed and size. I
don't know which codec would be a good tradeoff, I don't have much
experience. For me, mpeg2video was about 1 MB in size per minute, but
really quick to create. libx264 on the other hand was about 50 kB per
minute, but quite slow. YMMV.

You can then combine this with "-i audiofile.mp3 -codec:a copy". You
need to restrict the conversion with "-t" as above, or e.g. with
"-frames" though, because the artificial video source never ends by
itself. (There may be a way to make ffmpeg stop converting when it's
out of audio. Someone else will need to answer to that.)

Moritz


More information about the ffmpeg-user mailing list