Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am looking to create an mp3 of silence that is the same duration as the input video file using either ffmpeg or mencoder.

Using ffmpeg I have tried this:

ffmpeg -y -i in.avi -ab 8k -ac 1 -vol 0 -acodec libmp3lame out.mp3

Which works great if the video has an audio track but fails miserably if it does not.

Any ideas?

Thanks!

share|improve this question

migrated from stackoverflow.com Oct 25 '11 at 19:20

This question came from our site for professional and enthusiast programmers.

    
Do you have to use ffmpeg for this? It stands to reason that any attempt to extract audio that isn't actually there would fail. It would be a relatively straightforward task to 1) create a blank WAV file of the same length as the video, then 2) convert the blank WAV to an MP3 with any number of tools. –  MusiGenesis Oct 25 '11 at 18:06
1  
You can add silent audio to a video with ffmpeg -shortest -ar 44100 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -i in.avi -vcodec copy -acodec libmp3lame out.avi -map 1:0 -map 0:0 –  Banthar Oct 25 '11 at 18:15
    
No, I don't have a strict requirement for ffmpeg; my requirement is to create the silent mp3 that is the same length as the video and to be able to use a command line tool for this. I suppose I should have asked a slightly different question to reflect that. –  mirswith Nov 2 '11 at 16:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.