[FFmpeg-user] Problem when using named pipe (fifo) in ffplay input to play a mpegts live stream

Leonardo Muttoni muttoni at gmail.com
Tue Dec 13 00:22:37 EET 2016


I'm having a strange behavior when using ffplay on linux:

I created a program that output a live mpegts stream to a fifo (a file
created by mkfifo). I'm trying to use ffplay to watch to this stream, in
this way:

> ffplay -probesize 100k -analyzeduration 100k - < fifo_file.ts

First I start this player command, then in another console I start the
program that outputs the stream to the fifo file. With this setup, I have
to wait about 1 minute (or more sometimes) to get the  audio/video to play,
BUT when I interrupt (CTRL+C) the program that write the live stream to the
fifo, the entire (since startup) video start playing instantly, something
like a buffer problem...

Note 1: When I use the command "hexdump < fifo_file.ts" instead of ffplay,
 I got the usual uninterrupted hex stream flow on console, then I think
that the program that feed the fifo file is doing his job properly).

Note 2: I also tryed to mess with probesize and analyzeduration values and
nothing helps.

Note 3: When I use the ffplay option "-v debug", I got several messages
like this "[mpegts @ 0x7f4fbc000920] probing stream 2 pp:2499"
the last number (2499) keep decreasing at a rate about once a second, in
that time, I cannot get the video, but again: when I interrupt the source
side of fifo, It appears that ffplay "wakes", and show the video
immediately. If I don't interrupt and wait for about one minute, the video
starts playing. The console output in this case are in:

Note 4: From above pastebin, It appears that the stream 2 have nothing

**** Questions ****

**** Primary question:

1) How can I play this live stream faster (starting soon, without waiting a
long time)

**** Secondary questions:

2) How can I tell ffplay to skip/ignore the 2nd stream, or to give up this
stream early ?

3) Why when I interrupt the source program in the other side of the fifo,
the video starts playing immediately?

Thanks in advance.

More information about the ffmpeg-user mailing list