This question is related to my previous question: Converting raw frames into webm live stream
I want to pipe a video to ffmpeg and read it back through another pipe, but I cannot pipe the output of ffmpeg.exe
to a named pipe on windows.
My definition of the pipes in C#:
NamedPipeServerStream p_to_ffmpeg;
NamedPipeServerStream p_from_ffmpeg;
p_to_ffmpeg = new NamedPipeServerStream("to_ffmpeg", PipeDirection.Out, 1, PipeTransmissionMode.Byte);
p_from_ffmpeg = new NamedPipeServerStream("from_ffmpeg", PipeDirection.In, 1, PipeTransmissionMode.Byte);
And then I start ffmpeg.exe
in a separate process with the following options: -f rawvideo -vcodec rawvideo -video_size 656x492 -r 10 -pix_fmt rgb24 -i \.pipeo_ffmpeg -c:v libvpx -pass 1 -f webm \.pipefrom_ffmpeg
ffmpeg.exe refuses to write to the pipe with the following error : File '\.pipefrom_ffmpeg' already exists. Overwrite ? [y/N]
When I replace the "output pipe" with a file name, it works like charm: -f rawvideo -vcodec rawvideo -video_size 656x492 -r 10 -pix_fmt rgb24 -i \.pipeo_ffmpeg -c:v libvpx -pass 1 -f webm output.webm
How do I get ffmpeg to write to a named pipe in windows?
Edit: When I force to write to the pipe with ffmpeg's -y
option, I get the following error: Could not write header for output file #0 (incorrect codec parameters ?): Error number -32 occurred
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…