user2191454
user2191454

Reputation: 155

How to create Silent Opus Audio Files

I need silent Opus audio files range of 1 second to 60 minutes.

I found this example for wav files:

60 seconds of silent audio in WAV:

ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec copy output.wav

60 seconds of silent audio in MP3:

ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -ac 2 -i /dev/zero -acodec libmp3lame -aq 4 output.mp3

How can I do it for opus with using ffmpeg or similar tool?

Upvotes: 1

Views: 1577

Answers (1)

Gyan
Gyan

Reputation: 93171

Using a recent build of ffmpeg, run

ffmpeg -f lavfi -i anullsrc -ac 2 -ar 48000 -t 30 -c:a libopus file.opus

You can add -vbr 0 -b:a 128k for a CBR encode.

Upvotes: 3

Related Questions