Pipe ffmpeg to oggenc(2) with .NET
I am trying to encode ogg files at -q 6/192k. ffmpeg doesnt seem to be listenting to my command
ffmpeg -i blah -acodec vorbis -ab 192k -y out.ogg
So i would like to use the recommended ogg encoder. It says the input must be wav or similar. I would like to pipe a wav from ffmpeg to ogg. However not only am i unsure if oggenc2 will accept input from stdin, i have no idea how to pipe one process to another inside of 开发者_高级运维.net using the Process class.
Firstly, AFAIK
Oggenc2
Command line encoder - allows direct input of '.flac', '.ape', '.wv', '.pac', '.ofr' and '.shn' files - ICL7.1 compile
Suppose you don't need
to pipe one process to another inside of .net using the Process class
because there is a more easier way to do this. Try the following construction:
ffmpeg -i audio.mp3 -f flac - | oggenc2.exe - -o audio.ogg
This command converts an input mp3
file (I didn't find other audio files on my PC) to flac
and sends it to stdout
, which goes to stdin
of oggenc2
by using pipe(|
).
The only thing you have to do is to write a .NET
wrapper to run ffmpeg
.
精彩评论