Warm tip: This article is reproduced from serverfault.com, please click

Combine two ffmpeg commands to produce one audio output

发布于 2020-11-27 12:48:45

I want to use libopus to augment my audio using this decoder.

I can use it like this:

ffmpeg -i input.wav -c:a libopus -b:a 5.5k -ar 8000 output_550.ogg
ffmpeg -i output_550.ogg -ar 8000 output_550_ogg.wav

But I can't convert directly to wav - I get errors like these:

[wav @ 0x7fa9ac808800] opus codec not supported in WAVE format
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Error initializing output stream 0:0 --

How could I combine these to to get wav with a single command?

Questioner
Martynas Jurkus
Viewed
0
Gyan 2020-11-28 13:39:07

You can use two ffmpeg instances, piping the output of the first to the second.

ffmpeg -i input.wav -c:a libopus -b:a 5.5k -ar 8000 -f nut - | ffmpeg -f nut -i - output_550_ogg.wav