1

Say I ramify a video stream to 2 ffplay processes

cat video.mp4 |  tee >(ffplay -i -) >(ffplay -i -) > /dev/null

Now, if I kill one of the ffplay process, the stream is stopped which is not what I want.

How can I modify this command to continue to stream the video to the first ffplay process if the second is killed?

PS: I am looking for a solution without named pipe (fifo)

1 Answer 1

1

A solution

cat video.mp4 |  tee >(ffplay -i - || cat >/dev/null ) >(ffplay -i - || cat >/dev/null) > /dev/null

Example: to save an encrypted webcam capture and play it at the same time with possible killing of the file saving process (openssl) or the player (ffplay), I can use:

ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0 -f ogg - | tee >(openssl enc -k mypassword -aes-256-cbc > encrypted-capture.aes-256-cbc || cat >/dev/null) >(ffplay -fs -i - || cat >/dev/null) > /dev/null

You have to kill the ffplay process ( press f and then run pkill ffplay), not close the window with Esc

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.