GNOME Bugzilla – Bug 754768
matroskademux: Streaming via tcpserversink fails - reading large block not supported
Last modified: 2015-09-10 19:42:21 UTC
I'm been having a bit of a problem with Matroska streaming ever since 1.5.x. Now using 1.5.90. The same pipeline report differently depending on when to start the pipeline. Here is the first example: gst-launch-1.0 tcpclientsrc host=stream01 port=5010 ! decodebin name=dec ! autovideosink dec. ! autoaudiosink Setting pipeline to PAUSED ... Pipeline is PREROLLING ... ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:dec/GstMatroskaDemux:matroskademux0: Could not demultiplex stream. Additional debug info: matroska-demux.c(4004): gst_matroska_demux_check_read_size (): /GstPipeline:pipeline0/GstDecodeBin:dec/GstMatroskaDemux:matroskademux0: reading large block of size 135481368 not supported; file might be corrupt. ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... [01:16:10.943] vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.235/Sources/VideoToolbox/VTDecompressionSession.c line 1181 Freeing pipeline ... Here is another example of output: gst-launch-1.0 tcpclientsrc host=stream01 port=5010 ! decodebin name=dec ! autovideosink dec. ! autoaudiosink Setting pipeline to PAUSED ... Pipeline is PREROLLING ... [01:19:42.317] vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.235/Sources/VideoToolbox/VTDecompressionSession.c line 1181 ERROR: from element /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: Internal data flow error. Additional debug info: gstbasesrc.c(2943): void gst_base_src_loop(GstPad *) (): /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: streaming task paused, reason error (-5) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ... A serving pipeline could look something like this: ---------------------------- #!/bin/bash width=1280 height=720 framerate="30/1" audiorate=44100 channels=2 socket=/tmp/snowmixdummy SHMSIZE='shm-size='`echo "$width * $height * 4 * 34"|bc` SHMOPTION="wait-for-connection=0 sync=true" SHMSINK1="shmsink socket-path=$socket $SHMSIZE $SHMOPTION" AUDIOFORMAT='audio/x-raw,format=S16LE,channels='$channels',layout=interleaved,rate='$audiorate #VIDEOFORMAT='video/x-raw,format=BGRA,width='$width',height='$height',framerate='$framerate VIDEOFORMAT='video/x-raw,format=BGRA,width='$width',height='$height' ENCAUDIO='audio/mpeg,mpegversion=4,stream-format=raw' ENCVIDEO='video/x-h264,alignment=au,stream-format=byte-stream,profile=main' VIDEOSRC='shmsrc socket-path='$socket' do-timestamp=true is-live=true' AAC_ENC='avenc_aac bitrate=128000 compliance=-2' X264ENC='x264enc bitrate=4000 speed-preset=2 tune=zerolatency key-int-max=60 bframes=0' gst-launch-1.0 -v \ audiotestsrc is-live=true !\ $AUDIOFORMAT !\ queue leaky=2 !\ audiorate !\ audioconvert !\ $AAC_ENC !\ $ENCAUDIO !\ aacparse !\ matmux. \ videotestsrc is-live=true !\ $VIDEOFORMAT,framerate=30/1 !\ queue leaky=2 !\ videoconvert !\ $X264ENC !\ $ENCVIDEO !\ h264parse !\ queue !\ matroskamux streamable=1 name=matmux !\ queue !\ tcpserversink host=0.0.0.0 port=5010 sync-method=2 recover-policy=keyframe ----------------------------
And this was working with 1.4, right? The first and second error seem unrelated at a first glance. Can you also reproduce the second one if avdec_h264 is used instead of vtdec?
(In reply to Sebastian Dröge (slomo) from comment #1) > And this was working with 1.4, right? The first and second error seem > unrelated at a first glance. Can you also reproduce the second one if > avdec_h264 is used instead of vtdec? Using this pipeline on Mac I get repeatedly the "large block" error. gst-launch-1.0 -v tcpclientsrc host=127.0.0.1 port=5010 ! queue ! matroskaparse ! matroskademux name=demux ! queue ! h264parse ! avdec_h264 ! queue ! videoconvert ! glimagesink Using this on Mac and Linux I get repeatedly the "large block" error. gst-launch-1.0 -v tcpclientsrc host=127.0.0.1 port=5010 ! decodebin name=dec ! autovideosink dec. ! autoaudiosink However on Mac, it sometimes just PREROLL and hangs. Currently I seems to be unable to reproduce the 'VTDecompressionSession.c line 1181" error.
Adding a matroskaparse element to the encoding script makes the encoding script it self fail with the large block error. That ought to make it easier to track down the error. The script has been cleaned a bit compared to first version and a queue extra after the aacparse was added along with the matroskaparse element. #!/bin/bash width=1280 height=720 framerate="30/1" audiorate=44100 channels=2 socket=/tmp/snowmixdummy AUDIOFORMAT='audio/x-raw,format=S16LE,channels='$channels',layout=interleaved,rate='$audiorate VIDEOFORMAT='video/x-raw,format=BGRA,width='$width',height='$height' ENCAUDIO='audio/mpeg,mpegversion=4,stream-format=raw' ENCVIDEO='video/x-h264,alignment=au,stream-format=byte-stream,profile=main' VIDEOSRC='shmsrc socket-path='$socket' do-timestamp=true is-live=true' AAC_ENC='avenc_aac bitrate=128000 compliance=-2' X264ENC='x264enc bitrate=4000 speed-preset=2 tune=zerolatency key-int-max=60 bframes=0' gst-launch-1.0 -v \ audiotestsrc is-live=true !\ $AUDIOFORMAT !\ queue leaky=2 !\ audiorate !\ audioconvert !\ $AAC_ENC !\ $ENCAUDIO !\ aacparse !\ queue !\ matmux. \ videotestsrc is-live=true !\ $VIDEOFORMAT,framerate=30/1 !\ queue leaky=2 !\ videoconvert !\ $X264ENC !\ $ENCVIDEO !\ h264parse !\ queue !\ matroskamux streamable=1 name=matmux !\ matroskaparse !\ queue !\ tcpserversink host=0.0.0.0 port=5010 sync-method=2 recover-policy=keyframe ----------------------------
The vtdec related stuff is probably a completely different bug, let's ignore that for now and handle it in a different bug report. You said that it worked in 1.4, so this would be a regression in matroskamux or tcpserversink I guess.
> gst-launch-1.0 videotestsrc ! x264enc ! matroskamux streamable=true ! queue ! matroskademux ! fakesink Also fails, also with matroskaparse instead of matroskademux.
Can you share in what version did this work?
(In reply to Thiago Sousa Santos from comment #6) > Can you share in what version did this work? Fails with my system's 1.4.5 on debian.
It is true, that Sebastians matroskamux-matroskaparse exmaple also fails for me on 1.4.5. However the example with tcpclientsink shown below here works with the pipeline "gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=5010 ! decodebin name=dec ! autovideosink dec. ! autoaudiosink" on 1.4.5, but fails with the "large block" error on 1.5.90. #!/bin/bash width=1280 height=720 framerate="30/1" audiorate=44100 channels=2 AUDIOFORMAT='audio/x-raw,format=S16LE,channels='$channels',layout=interleaved,rate='$audiorate VIDEOFORMAT='video/x-raw,format=BGRA,width='$width',height='$height' ENCAUDIO='audio/mpeg,mpegversion=4,stream-format=raw' ENCVIDEO='video/x-h264,alignment=au,stream-format=byte-stream,profile=main' AAC_ENC='avenc_aac bitrate=128000 compliance=-2' X264ENC='x264enc bitrate=4000 speed-preset=2 tune=zerolatency key-int-max=60 bframes=0' gst-launch-1.0 -v \ audiotestsrc is-live=true !\ $AUDIOFORMAT !\ queue leaky=2 !\ audiorate !\ audioconvert !\ $AAC_ENC !\ $ENCAUDIO !\ aacparse !\ queue !\ matmux. \ videotestsrc is-live=true !\ $VIDEOFORMAT,framerate=30/1 !\ queue leaky=2 !\ videoconvert !\ $X264ENC !\ $ENCVIDEO !\ h264parse !\ queue !\ matroskamux streamable=1 name=matmux !\ queue !\ tcpserversink host=0.0.0.0 port=5010 sync-method=2 recover-policy=keyframe
Here is the correct script for tcpserversink. There was a "'" too much. #!/bin/bash width=1280 height=720 framerate="30/1" audiorate=44100 channels=2 socket=/tmp/snowmixdummy AUDIOFORMAT='audio/x-raw,format=S16LE,channels='$channels',layout=interleaved,rate='$audiorate VIDEOFORMAT='video/x-raw,format=BGRA,width='$width',height='$height ENCAUDIO='audio/mpeg,mpegversion=4,stream-format=raw' ENCVIDEO='video/x-h264,alignment=au,stream-format=byte-stream,profile=main' VIDEOSRC='shmsrc socket-path='$socket' do-timestamp=true is-live=true' AAC_ENC='avenc_aac bitrate=128000 compliance=-2' X264ENC='x264enc bitrate=4000 speed-preset=2 tune=zerolatency key-int-max=60 bframes=0' gst-launch-1.0 -v \ audiotestsrc is-live=true !\ $AUDIOFORMAT !\ queue leaky=2 !\ audiorate !\ audioconvert !\ $AAC_ENC !\ $ENCAUDIO !\ aacparse !\ queue !\ matmux. \ videotestsrc is-live=true !\ $VIDEOFORMAT,framerate=30/1 !\ queue leaky=2 !\ videoconvert !\ $X264ENC !\ $ENCVIDEO !\ h264parse !\ queue !\ matroskamux streamable=1 name=matmux !\ matroskaparse !\ queue !\ tcpserversink host=0.0.0.0 port=5010 sync-method=2 recover-policy=keyframe
Created attachment 311086 [details] [review] matroskamux: fix matroskamux ! matroskademux Don't carry over DISCONT flags from the input buffers to the output buffer, or the demuxer might reset its state when it receives the first data buffer just after parsing the simple block header, and then expect sane data to follow. Fixes matroskamux ! demux erroring out.
commit d518033e77259a9ba79a7619c4791f345a7b92d7 Author: Josep Torra <n770galaxy@gmail.com> Date: Fri Nov 7 15:50:51 2014 +0100 h264parse: set the HEADER flag on buffers containing SPS or PPS Bisecting led me to this commit on -bad.
Created attachment 311099 [details] [review] matroskamux: drop HEADER flag from output buffers Drop HEADER flag from output buffers if they are not indeed headers. Fixes resending of headers in tcp connection handling
Comment on attachment 311099 [details] [review] matroskamux: drop HEADER flag from output buffers Any other flags to consider? :)
commit f9c7dc2797cd7df1438ff374f40bd94f0a011451 Author: Thiago Santos <thiagoss@osg.samsung.com> Date: Thu Sep 10 15:26:54 2015 -0300 matroskamux: drop HEADER flag from output buffers Drop HEADER flag from output buffers if they are not indeed headers. Fixes resending of headers in tcp connection handling https://bugzilla.gnome.org/show_bug.cgi?id=754768