Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How do I pipe ffmpeg to opusenc on Windows?

Writer Andrew Mclaughlin

On Linux you can do something like this:

(bash)
ffmpeg -i foo.mp3 -f wav - | opusenc --bitrate 64 - bar.opus

This is neat, because it means you don't have to write the WAV data to disk before passing it to opus, so the encoding happens on the fly in memory instead.

I have both ffmpeg and opusenc installed on Windows, and since Powershell has pipes I expected to be able to do something similar, so I'm trying this:

(PS)
> ffmpeg -y -i .\foo.mp3 -f wav - | .\opusenc.exe --bitrate 64 - bar.opus

What I'm expecting to happen: ffmpeg should be piping wav audio directly to opusenc for encoding

What happens instead: it seems to only run ffmpeg without passing the data on to opusenc, indicated by constant RAM growth of the PS process and no output from opusenc.

1

1 Answer

Use the regular cmd.exe instead of Powershell. The exact same command works in cmd, but does not in PS:

> ffmpeg -y -i .\foo.mp3 -f wav - | .\opusenc.exe --bitrate 64 - bar.opus

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy