PDA

View Full Version : convert mp3 to video with CLI


dcline1701
18th October 2009, 18:13
I'm looking for something that will take an MP3 and wrap it in an mp4 container (preferably without reencoding).
Video is irrelevant. Encoding a Jpeg for the duration of the file would be nice though.
I would like to take podcasts and upload them to my cell phone as videos since the Dare's video player lets you skip 1/4 of the way through the file with 1 tap instead of holding down the FF button for 2 minutes (which is all you can do with the audio player).
Is there a way to do this with AviDemux or Vdub or do you need another program. Also, a way to do this from the command line would be great.

mariush
18th October 2009, 20:52
You can do it easy with Avisynth and MeGUI
Just install Avisynth and use this avs script in MeGUI... something like this:


video = BlankClip(length=600, width=320, height=240, fps=25, color=$000000) # 600 - number of seconds of your audio file in this example 600s or 10 minutes


Save this with the .avs extension, open MeGUI, select mp4 output, choose a profile compatible with your player and you have the video part. Now use the MP4 muxer from inside the menu to combine the video and audio in a file.

Keiyakusha
18th October 2009, 21:21
# 600 - number of seconds of your audio file in this example 600s or 10 minutes

This is wrong. 600 - number of frames, and actual length here - 24 seconds

mariush
18th October 2009, 22:09
You're right. It's frames, not seconds. So it's just a simple math: length = fps x seconds. If fps = 25 and time is 10 minutes, then length = 25 x 600 seconds, 15000 frames.

dcline1701
18th April 2010, 23:44
I'm looking for something that will take an MP3 and wrap it in an mp4 container (preferably without reencoding).

The Dare (as well as my other Verizon phone) won't play videos with MP3 audio. It has to be AAC. I installed WinFF and found that the version of ffmpeg that comes with it is compiled with AAC support. This command will do what I want from the command line:

ffmpeg -i a.mp3 -acodec libfaac -ac 1 -ab 112k -ar 22050 -f mp4 tst.mp4