problems with muxers

alex ahoenig at progeny.net
Mon Dec 17 11:02:34 PST 2012


Hello,
 
I'm having a lot of trouble getting any of the gstreamer muxers to work
properly.  Using ubuntu packages for now (eventually I'll need windows too). 
There seems to be some differences between 0.10 and 1.0 but I can't get
either to really work.  Sorry for the long post, I'm trying to include as
many details as I can.

Here are some examples:

gst-launch-1.0 filesrc location=input.mp4 ! qtdemux ! h264parse ! mpegtsmux
! filesink location=output.ts
Input is 75MB, output is 78MB.  File does not play in VLC or Windows Media
Player or ffplay.  ffplay prints out a ton of "non-existing PPS referenced /
non-existing PPS 0 referenced / decode_slice_header error / no frame!".

The same pipeline, with gst-launch-0.10, outputs a file which plays in VLC
and ffplay but not WMP.



Another example:

gst-launch-0.10 filesrc location=input.ts ! tsdemux ! h264parse ! ffdec_h264
! ffmpegcolorspace ! videoscale ! autovideosink
This plays fine.  There is a slight delay at the beginning because the first
keyframe is about a 1 second into the video.  gstreamer 0.10, VLC, ffplay,
WMP all behave the same way.

BUT, if I use gstreamer 1.0, like this:
gst-launch-1.0 filesrc location=input.ts ! tsdemux ! h264parse ! avdec_h264
! videoconvert ! videoscale ! autovideosink
Then it starts playing immediately, with the first second garbled.



Another example:

gst-launch-0.10 filesrc location=input.ts ! tsdemux ! h264parse !
video/x-h264, stream-format=avc, alignment=au, width=720, height=480,
framerate=30/1 ! qtmux ! filesink location=output.mov

I get the following error:

ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal
data stream error.
Additional debug info:
mpegtsbase.c(1639): mpegts_base_loop ():
/GstPipeline:pipeline0/GstTSDemux:tsdemux0:stream stopped, reason
not-negotiated
ERROR: pipeline doesn't want to preroll.

I looked in the debug output and I see:
0:00:00.535047886  9175      0x2737050 WARN                   qtmux
gstqtmux.c:3098:gst_qt_mux_video_sink_set_caps:<qtmux0> no codec_data in
h264 caps
0:00:00.535075250  9175      0x2737050 WARN                   qtmux
gstqtmux.c:3251:gst_qt_mux_video_sink_set_caps:<qtmux0> pad video_00 refused
caps video/x-h264, stream-format=(string)avc, alignment=(string)au,
parsed=(boolean)true, width=(int)720, height=(int)480,
framerate=(fraction)30/1



Why is the codec_data not set in the caps by the ts demuxer or the h264
parser?  What can I do to retrieve the codec_data?

With 1.0 I get a similar problem but it doesn't print out a warning about no
codec_data... it does however have some other  warnings like:

0:00:00.022590652  9201      0x1db4980 WARN                GST_PADS
gstpad.c:3582:gst_pad_peer_query:<capsfilter0:src> pad has no peer

Setting pipeline to PAUSED ...
0:00:00.023023022  9201      0x1db4980 WARN                GST_PADS
gstpad.c:3582:gst_pad_peer_query:<h264parse0:sink> pad has no peer

Pipeline is PREROLLING ...
0:00:00.024118386  9201      0x1dacd40 WARN              mpegtsbase
mpegtsbase.c:548:mpegts_base_program_add_stream: Stream already present !

0:00:00.024235204  9201      0x1dacd40 WARN                 tsdemux
tsdemux.c:1318:gst_ts_demux_queue_data: Didn't get the first packet of this
PES
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps =
video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal

0:00:00.025333582  9201      0x1dacd40 WARN       codecparsers_h264
gsth264parser.c:1106:gst_h264_parser_parse_pic_timing: didn't get the
associated sequence paramater set for the current access unit

0:00:00.025368192  9201      0x1dacd40 WARN       codecparsers_h264
gsth264parser.c:1154:gst_h264_parser_parse_pic_timing: error parsing
"Picture timing"
0:00:00.025469794  9201      0x1dacd40 WARN       codecparsers_h264
gsth264parser.c:1792:gst_h264_parser_parse_slice_hdr: couldn't find
associated picture parameter set with id: 0
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps =
video/x-h264, stream-format=(string)avc, alignment=(string)au,
parsed=(boolean)true

0:00:00.025706252  9201      0x1dacd40 WARN              mpegtsbase
mpegtsbase.c:1639:mpegts_base_loop:<tsdemux0> error: Internal data stream
error.

0:00:00.025724310  9201      0x1dacd40 WARN              mpegtsbase
mpegtsbase.c:1639:mpegts_base_loop:<tsdemux0> error: stream stopped, reason
not-negotiated
ERROR: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: Internal
data stream error.




I also get the same error when trying to mux to avi, matroska.  I *CAN* mux
it into mpeg-ps, which works perfectly in WMP, VLC, etc.


Recording from an rtsp stream has similar results - With 0.10, I can mux
into mpegts using rtspsrc ! gstrtpjitterbuffer ! rtph264depay ! h264parse !
mpegtsmux ! filesink  - the results are not playable in WMP, but are
playable in ffmpeg and VLC.  However, with 1.0, the results are not playable
in anything - ffplay reports "Could not find codec parameters (Video: h264)"
as well as a ton of non-existing PPS errors.

Surprisingly, muxing rtsp -> mp4 gives a perfect video which can be played
in WMP, VLC, ffplay... but I don't know why ts -> mp4 doesn't work like
that?

I thought as long as I had parsed h.264 video in the correct stream format
and alignment, it should go into mp4/mov, ps, ts, avi, or mkv without issue. 
But it seems it sometimes needs more info - codec parameters? - and I can't
figure out what to give it.  I tried setting all the caps that the
documentation says the muxers want, but they didn't mention anything about
codec_params.

So... anyone know what I'm missing?

Alex



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/problems-with-muxers-tp4657497.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list