I'm trying to use Pipe Viewer on a video pipe that I'm both writing and reading from.

The below command works perfectly when I pass temp_video.h264 as an -i input to ffmpeg. However, when I attempt to pass temp_video.h264 to pv, and then pass its standard output to ffmpeg, ffmpeg never opens temp_video.h264 (maybe it never receives it?)

What's wrong with my command?

Here is my full command:

sudo rm temp_audio.v
sudo rm temp_video.h264
mkfifo temp_audio.v
mkfifo temp_video.h264
arecord -Dmic_sv -c2 -r48000 -fS32_LE -twav temp_audio.v & \
raspivid -w 640 -h 480 -fps 10 -v -b 1000000 -o temp_video.h264 -t 0 & \ # WRITING TO TEMP_VIDEO.H264
pv temp_video.h264 | \ #PIPE VIEWER ON TEMP_VIDEO.H264
~/special/ffmpeg/ffmpeg \
    -framerate 10 \
    -i temp_audio.v \
    -ab 24k \
    -c:v copy \
    -c:a aac \
    -report \
    -f flv rtmp:// \
  • 1
    Are you sure that ffmpeg accepts - as a marker for stdin? The man page on Debian (wheezy) seems to suggest you need to use pipe:0 to read from a piped stdin. – roaima Feb 9 '17 at 11:16
  • I'm surprised that this works reliably even when passing the video input file name to ffmpeg, because it would require ffmpeg to follow its two input files as they are being written, if I understand correctly. – dhag Feb 9 '17 at 14:23

Your Answer

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

Browse other questions tagged or ask your own question.