[gst-devel] Saving a live stream

Jyoti jyoti.d at allaboutif.com
Wed Apr 29 14:20:28 CEST 2009


Hi All,

I want to save the incoming RTP payloaded H.264 video data from a live
source to a file. The pipelines I use is

Sender:
gst-launch filesrc location=/home/jyoti/Desktop/h264-aac/alien.mp4 ! qtdemux
name=d d. ! queue ! rtph264pay ! udpsink port=5002

Receiver:
gst-launch udpsrc caps="application/x-rtp, media=(string)video,
clock-rate=(int)90000, encoding-name=(string)H264,
profile-level-id=(string)4d4033,
sprop-parameter-sets=(string)\"Z01AM5JSAoP2AiAAAAMDACAAAAYR4wZJ\\,aO4CvIA\\=\",
payload=(int)96, ssrc=(guint)529574254, clock-base=(guint)940521219,
seqnum-base=(guint)11356" port=5002 ! rtph264depay ! ffmux_mp4 ! queue !
filesink location=~/Desktop/test --gst-debug=*:1

The pipeline gives me the following error:
**********************************************************************************************************
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:02.847065223 15058  0x9359fd8 ERROR               ffmpeg :0:: time base
not set
0:00:02.847607619 15058  0x9359fd8 ERROR               ffmpeg :0:: time base
not set
0:00:02.847765092 15058  0x9359fd8 ERROR               ffmpeg :0:: time base
not set
ERROR: from element /GstPipeline:pipeline0/ffmux_mp4:ffmux_mp40: Could not
configure supporting library.
Additional debug info:
gstffmpegmux.c(566): gst_ffmpegmux_collected ():
/GstPipeline:pipeline0/ffmux_mp4:ffmux_mp40:
Failed to write file header - check codec settings
Execution ended after 1604133490 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
**********************************************************************************************************
When I did debug the function "gst_ffmpegmux_collected". I saw that the
codec parameters are not set properly in
av_write_header() used in gst_ffmpegmux_collected().
* st->codec->time_base.num = 0 and st->codec->time_base.den = 1;
* And the st->codec->width = 0 and st->codec->height = 0.


So to just have a quick hack I used the capsfilter between rtph264depay and
ffmux_mp4 with video caps from sender,
the pipeline doesn't quit now but instead throws error messages. And the
parameters now are:
* st->codec->time_base.num = 1 and st->codec->time_base.den = 24
* And the st->codec->width = 320 and st->codec->height = 240

Receiver's pipeline with capsfilter.

gst-launch udpsrc caps="application/x-rtp, media=(string)video,
clock-rate=(int)90000, encoding-name=(string)H264,
profile-level-id=(string)4d4033,
sprop-parameter-sets=(string)\"Z01AM5JSAoP2AiAAAAMDACAAAAYR4wZJ\\,aO4CvIA\\=\",
payload=(int)96, ssrc=(guint)529574254, clock-base=(guint)940521219,
seqnum-base=(guint)11356" port=5002 ! rtph264depay ! capsfilter
caps="video/x-h264,
codec_data=(buffer)014d4033ffe10018674d403392520283f6022000000303002000000611e3064901000568ee02bc80,
width=(int)320, height=(int)240, framerate=(fraction)24/1" !  ffmux_mp4 !
queue ! filesink location=~/Desktop/test --gst-debug=*:1

****************************************************************************************************************
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
0:00:00.252624333 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 1 >= 1
0:00:00.293548372 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 2 >= 2
0:00:00.335302005 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 3 >= 3
0:00:00.376955618 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 4 >= 4
0:00:00.418564944 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 5 >= 5
0:00:00.460233384 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 6 >= 6
0:00:00.502093709 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 7 >= 7
0:00:00.543625785 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 8 >= 8
0:00:00.585262073 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 9 >= 9
0:00:00.626933983 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 10 >= 10
0:00:00.668587406 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 11 >= 11
0:00:00.710255640 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 12 >= 12
0:00:00.752176246 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 13 >= 13
0:00:00.793557705 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 14 >= 14
0:00:00.835298782 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 15 >= 15
0:00:00.877036479 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 16 >= 16
0:00:00.877128406 15031  0x857e438 ERROR               ffmpeg :0:: error,
non monotone timestamps 16 >= 16
****************************************************************************************************************

I would be very greatful if someone can suggest me on how to do.

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090429/be296c3f/attachment.htm>


More information about the gstreamer-devel mailing list