[rtmpdump] Piping output to gstreamer / mplayer etc?

hyc at highlandsun.com hyc at highlandsun.com
Fri Jan 29 00:13:02 CET 2010

On Fri, Jan 29, 2010 at 10:57:52AM +1300, Tim Smart wrote:
> Hi fellow dumpers,
> I am wondering if is possible to pipe / send the output as either a source
> for gstreamer, or play it within another player?

Sure, just omit the "-o output" option and it will write the stream
to stdout. Pipe it to anything you want from there.

> The reason I ask, is because it would be something awesome to have this set
> up in a gstreamer pipline:
> ------------------------------------------------
>                                  queue -> playbin2
> rtmpdumpsrc -> tee |
>                                  queue -> filesink
> ------------------------------------------------
> Meaning I could watch streams without the stupid overhead of flash, and also
> write them to disk at the same time! Any thoughts / opinions on how make
> this possible are appreciated!

Frankly I don't think this is even necessary. I watch streams as they're
downloading, all the time. "rtmpdump -o xx.flv" in one process, and
"mplayer xx.flv" in a separate session. As long as the download speed
is faster than the playback rate, you're fine.

Playing directly from a pipe can really limit your throughput if the
player doesn't read greedily from the pipe. The system only buffers 4KB
of data in a pipe, so if the player reads too slowly it will cause the
rtmpdump process to block waiting to write. And with only 4KB of buffer,
if there's a temporary pause in the download speed, the player will glitch.

All in all, it's better to use a tmp file as the buffer between the two.

More information about the rtmpdump mailing list