Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question

migrated from 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
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

You must log in to answer this question.

Browse other questions tagged .