Adding audio to video file using melt

0

I have a video file say 'myvideo.wmv' of 2 minutes length, which does not have audio inside it. I have an audio file, say 'voice.mp3', of 16 seconds length.

I want to add audio to 'myvideo.wmv' using melt command

melt myvideo.wmv -track voice.mp3  

but the problem is: the audio file is of shorter duration than the video, so there is audio in final output for only 16 seconds and I want the audio in the whole video. The audio file therefore needs to be repeated.

I tried to follow http://www.mltframework.org/bin/view/MLT/MltMelt but wasn't helping. Please tell me how I can achieve a final video which has an audio track with the same duration of as the video using melt.

I am using melt on Linux, I have to automate this task using python so I have to use only command line tool.

Alok Singh Mahor

Posted 2014-01-10T11:22:15.357

Reputation: 121

Do you necessarily have to use melt or is ffmpeg fine as well? – slhck – 2014-01-10T12:01:16.123

I am using melt on Linux and I have to automate this task for many files so I have to use command line tools only. – Alok Singh Mahor – 2014-01-10T16:17:46.263

Answers

0

You can use repeat command.

example:- melt source.mp4 -audio-track audio.mp3 -repeat 5 -consumer avformat:final.mp4

user1058342

Posted 2014-01-10T11:22:15.357

Reputation: 1

-1

i would suggest using audcity to loop the audio for the duration of time needed and then mus the two files together. muxing is the zipping of audio and video files (and subtitles) into a media container.

ffmpeg should be able to demux you video (without sound) and mux it with your sounfile again.

allerdings

Posted 2014-01-10T11:22:15.357

Reputation: 41

The OP asked for a command-line solution. Having to open up the file in a GUI program, trying to find out the needed duration, and then looping it is more than complicated when a command-line program can do it as well. – slhck – 2014-01-10T13:32:57.203