After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639848 - [mpegtsmux] doesn't join an h264 and an audio ES
[mpegtsmux] doesn't join an h264 and an audio ES
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.20
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-18 14:37 UTC by Andreas Frisch
Modified: 2013-06-12 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
full debug log (367.98 KB, application/x-bzip)
2011-01-18 14:37 UTC, Andreas Frisch
Details

Description Andreas Frisch 2011-01-18 14:37:30 UTC
Created attachment 178626 [details]
full debug log

when demuxing and muxing only the video/x-h264 stream, it succeeds.
when adding an mpeg2 audio or ac3 audio stream to the pipeline, it gets stuck in READY

tested on mips and amd64

full debug log to be attached

GST_DEBUG=*:5 gst-launch --gst-debug-no-color -v mpegtsmux name=m ! filesink location=test_video.ts filesrc location=20110118\ 1234\ -\ Einsfestival\ HD\ -\ HDTV-Testausstrahlung.ts ! mpegtsdemux name=d d.audio_0646 ! queue ! m. d.video_0641 ! queue ! m. >mpegts_remux.log 2>&1
Comment 1 Andreas Frisch 2011-01-19 12:04:17 UTC
here's the test file that i tried it with:
ftp://test4711@82.149.226.170/639848_20110118_1234_-_Einsfestival_HD_-_HDTV-Testausstrahlung.ts
Comment 3 Andreas Frisch 2011-01-20 11:57:49 UTC
thanks to your hints on irc i've refined the pipeline like this:

gst-launch -v mpegtsmux name=m ! filesink location=test_video.ts filesrc location=20110118\ 1234\ -\ Einsfestival\ HD\ -\ HDTV-Testausstrahlung.ts ! mpegtsdemux name=d d.audio_0646 ! ac3parse ! queue2 max-size-buffers=0 m. d.video_0641 ! h264parse ! queue2 max-size-buffers=0 ! m.

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstMpegTSDemux:d: pat-info = ((GValueArray*) 0x7fe14c0034a0)
/GstPipeline:pipeline0/GstMpegTSDemux:d: pmt-info = ((MpegTsPmtInfo*) 0x7fe14c001d80)
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = audio/x-ac3
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = audio/x-ac3
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
/GstPipeline:pipeline0/MpegTsMux:m.GstPad:sink_64: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstQueue2:queue20.GstPad:sink: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
Pipeline is PREROLLED ...
/GstPipeline:pipeline0/GstQueue2:queue20.GstPad:src: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/MpegTsMux:m.GstPad:src: caps = video/mpegts, systemstream=(boolean)true, packetsize=(int)188, streamheader=(buffer)< 47400030a600ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000b00d0001c100000001e020a2c32941, 474020308b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0002b0280001c10000e040f00c050448444d5688040ffffcfc1be040f00a050848444d56ff1b443ffba2e249 >
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/mpegts, systemstream=(boolean)true, packetsize=(int)188, streamheader=(buffer)< 47400030a600ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000b00d0001c100000001e020a2c32941, 474020308b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0002b0280001c10000e040f00c050448444d5688040ffffcfc1be040f00a050848444d56ff1b443ffba2e249 >
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal, width=(int)1280, height=(int)720
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal, width=(int)1280, height=(int)720
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal, width=(int)1280, height=(int)720
/GstPipeline:pipeline0/MpegTsMux:m.GstPad:sink_64: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal, width=(int)1280, height=(int)720
Got EOS from element "pipeline0".
Execution ended after 2795832403 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/MpegTsMux:m.GstPad:sink_64: caps = NULL
/GstPipeline:pipeline0/MpegTsMux:m.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstQueue2:queue21.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstQueue2:queue20.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstQueue2:queue20.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:d.GstPad:audio_0643: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:d.GstPad:audio_0642: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:d.GstPad:video_0641: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:d.GstPad:audio_0646: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:d.GstPad:private_010e: caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...


however, the result still has no audio stream:
$ mediainfo test_video.ts
General
ID                               : 1 (0x1)
Complete name                    : test_video.ts
Format                           : MPEG-TS
Format/Info                      : Advanced Video Codec
File size                        : 173 MiB
Duration                         : 3mn 1s
Overall bit rate                 : 8 018 Kbps

Video
ID                               : 64 (0x40)
Menu ID                          : 1 (0x1)
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L4.0
Format settings, CABAC           : Yes
Format settings, ReFrames        : 5 frames
Codec ID                         : 27
Duration                         : 3mn 0s
Bit rate mode                    : Variable
Bit rate                         : 7 622 Kbps
Maximum bit rate                 : 7 500 Kbps
Width                            : 1 280 pixels
Height                           : 720 pixels
Display aspect ratio             : 16:9
Frame rate                       : 50.000 fps
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.165
Stream size                      : 164 MiB (95%)
Color primaries                  : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics         : BT.709-5, BT.1361
Matrix coefficients              : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Comment 4 Andreas Frisch 2011-01-20 12:06:44 UTC
the audio stream, by itself, works too
$ gst-launch -v filesrc location=20110118\ 1234\ -\ Einsfestival\ HD\ -\ HDTV-Testausstrahlung.ts ! mpegtsdemux name=d d.audio_0646 ! ac3parse ! mpegtsmux ! filesink location=test_ac3.ts
...

$ mediainfo test_ac3.ts 
General
ID                               : 1 (0x1)
Complete name                    : test_ac3.ts
Format                           : MPEG-TS
Format/Info                      : Audio Coding 3
File size                        : 6.59 MiB
Duration                         : 3mn 0s
Overall bit rate                 : 306 Kbps

Audio
ID                               : 64 (0x40)
Menu ID                          : 1 (0x1)
Format                           : AC-3
Format/Info                      : Audio Coding 3
Mode extension                   : CM (complete main)
Codec ID                         : 129
Duration                         : 3mn 0s
Bit rate mode                    : Constant
Bit rate                         : 256 Kbps
Channel(s)                       : 2 channels
Channel positions                : Front: L R
Sampling rate                    : 48.0 KHz
Bit depth                        : 16 bits
Compression mode                 : Lossy
Stream size                      : 5.52 MiB (84%)



seems that just the merging of the two elementary streams somehow trips up the muxer
Comment 5 Andreas Frisch 2011-01-20 13:53:25 UTC
okay here's the latest intermediary results...

$ gst-launch -v mpegtsmux name=m ! filesink location=test_h264_ac3.ts filesrc location=20110118\ 1234\ -\ Einsfestival\ HD\ -\ HDTV-Testausstrahlung.ts ! mpegtsdemux name=d d.audio_0646 ! queue2 max-size-buffers=0 ! m. d.video_0641 ! queue2 max-size-buffers=0 ! m.

results in a transport stream file which actually does hold both streams (h264+ac3) as per mediainfo and it correctly plays back

gst-launch -v mpegtsmux name=m m2ts-mode=true ! filesink location=test_h264_ac3.m2ts filesrc location=20110118\ 1234\ -\ Einsfestival\ HD\ -\ HDTV-Testausstrahlung.ts ! mpegtsdemux name=d d.audio_0646 ! queue2 max-size-buffers=0 ! m. d.video_0641 ! queue2 max-size-buffers=0 ! m.

creates an m2ts file which supposedly also holds video+audio, however audio doesn't decode

when using the pid 0642, which is an mpeg2 audio stream, it plays as both ts and m2ts after remuxing
Comment 6 Andreas Frisch 2011-01-20 15:06:11 UTC
i've discovered that when demuxing the m2ts and parsing the ac3-ES, there are no more buffers produced by the parser after the first 2kb:

gst-launch -v filesrc location=test_h264_ac3.m2ts ! mpegtsdemux ! audio/x-ac3 ! ac3parse ! fakesink -v
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstMpegTSDemux:mpegtsdemux0: pat-info = ((GValueArray*) 0x4a5ba0)
/GstPipeline:pipeline0/GstMpegTSDemux:mpegtsdemux0: pmt-info = ((MpegTsPmtInfo*) 0x463060)
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1: caps = audio/x-ac3
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = audio/x-ac3
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = audio/x-ac3
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = audio/x-ac3
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = audio/x-ac3
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/x-ac3, framed=(boolean)true, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "preroll   ******* "
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "event   ******* E (type: 102, GstEventNewsegment, update=(boolean)false, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)104355555, stop=(gint64)-1, position=(gint64)104355555;) 0x4b5cc0"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1024 bytes, timestamp: 0:00:00.104355555, duration: 0:00:00.032000000, offset: 0, offset_end: -1, flags: 32) 0x4af468"
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 1024 bytes, timestamp: 0:00:00.136355555, duration: 0:00:00.032000000, offset: 1024, offset_end: -1, flags: 0) 0x4af2c8"
Caught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 7740071000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstAc3Parse:ac3parse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:mpegtsdemux0.GstPad:video_0040: caps = NULL
/GstPipeline:pipeline0/GstMpegTSDemux:mpegtsdemux0.GstPad:audio_0041: caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...

if i omit the ac3parse element, the buffers flow happily to the fakesink until eos, also it works when leaving the parser plugged in but using the ts instead of the m2ts source file

gst-launch -v filesrc location=test_h264_ac3.ts ! mpegtsdemux ! audio/x-ac3 ! filesink location=ac3.ts.es
and 
gst-launch -v filesrc location=test_h264_ac3.m2ts ! mpegtsdemux ! audio/x-ac3 ! filesink location=ac3.m2ts.es
produce two files that are byte-identical for the first, who would have thought, exactly 2048 bytes
unfortunetaly this still doesn't help me find out whether the problem lies at the muxing or demuxing side
Comment 7 Andreas Frisch 2011-03-09 08:27:31 UTC
with different recordings, it instead occurs that the pipeline also goes into PLAYING but then gets stuck after a few bytes... for example with this recording, it stalls after 180224 and just sits there forever.

i use this command to remux:

gst-launch -v filesrc location="20110309_0903_-_Das_Erste_HD_-_heute.ts" ! mpegtsdemux name=d d. ! audio/x-ac3 ! queue2 max-
size-buffers=0 ! m. d. ! video/x-h264 ! queue2 max-size-buffers=0 ! m. mpegtsmux name=m m2ts-mode=true ! filesink location=stream_0.m2ts

ftp://test4711:test4711@82.149.226.170/20110309_0903_-_Das_Erste_HD_-_heute.ts

(still uploading)
Comment 8 Jan Schmidt 2011-03-26 09:15:11 UTC
That pipeline stalls because the queues fill up. If you set max-size-bytes=0, it'll complete.

It's best to use multiqueue in a real pipeline to avoid this problem, otherwise you have to a) set the queues to unlimited (chews up memory) or b) manage the queue sizes yourself with callbacks.
Comment 9 Edward Hervey 2013-06-12 06:48:23 UTC
Andreas, is this still an issue with 1.x ?
Comment 10 Andreas Frisch 2013-06-12 13:47:36 UTC
No Edward, it works fine in 1.x!