Save RTSP stream to disk

Tim Müller tim at centricular.com
Tue Nov 29 23:09:19 UTC 2016


On Tue, 2016-11-29 at 23:28 +0100, Christof Bodner wrote:

Hi Christof,

> I can display a RTSP stream with the following command:
> ---
> $ gst-launch-1.0 rtspsrc location=rtsp://44.143.145.186:5131/0 !
> queue ! rtph264depay ! h264parse ! decodebin ! autovideosink

Ok.

> I would like to save it also to a file (not at the same time), but
> when I run this, the file that's generated is with size zero, so it's
> empty:
> 
> $ gst-launch-1.0 -e rtspsrc location=rtsp://44.143.145.186:5131/0 !
> rtpbin ! mpegtsmux ! filesink location=file.ts

I'm not sure why you add an rtpbin here, this is already contained
inside rtspsrc. Basically what you want to do is everything you did in
the first pipeline, just that instead of decoding you want to save into
a file. So try something like this:

gst-launch-1.0 rtspsrc location=rtsp://44.143.145.186:5131/0 ! queue !
rtph264depay ! h264parse ! mpegtsmux ! filesink location=file.ts

> (sorry, the messages are in german, but I think you can imagine,
> what's going on)

You should be able to get them in English by doing

LANG=C gst-launch-1.0 ...

for what it's worth (or LC_ALL=C).

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list