GNOME Bugzilla – Bug 607466
[playbin2] chooses random audio stream
Last modified: 2012-11-26 17:42:12 UTC
I have the following mkv container General Complete name : /dream/movie/mkv/Tonspuren-Test (OLP).MKV Format : Matroska File size : 96.0 MiB Duration : 6mn 31s Overall bit rate : 2 058 Kbps Encoded date : UTC 2010-01-18 18:02:14 Writing application : mkvmerge v2.9.8 ('C'est le bon') built on Aug 13 2009 12:49:06 Writing library : libebml v0.7.7 + libmatroska v0.8.1 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.0 Format settings, CABAC : Yes Format settings, ReFrames : 3 frames Muxing mode : Container profile=Unknown@3.0 Codec ID : V_MPEG4/ISO/AVC Duration : 6mn 31s Bit rate : 930 Kbps Width : 720 pixels Height : 576 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Standard : PAL Resolution : 8 bits Colorimetry : 4:2:0 Scan type : Progressive Bits/(Pixel*Frame) : 0.090 Stream size : 43.4 MiB (45%) Writing library : x264 core 76 r1271 496d79d Encoding settings : cabac=1 / ref=3 / deblock=1:-1:-1 / analyse=0x3:0x112 / me=hex / subme=6 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:0.50 Audio #1 ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 6mn 31s Bit rate mode : Constant Bit rate : 448 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Surround: L R, LFE Sampling rate : 48.0 KHz Stream size : 20.9 MiB (22%) Language : German Audio #2 ID : 3 Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 6mn 31s Bit rate mode : Constant Bit rate : 448 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Surround: L R, LFE Sampling rate : 48.0 KHz Stream size : 20.9 MiB (22%) Language : English Audio #3 ID : 4 Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 6mn 31s Bit rate mode : Constant Bit rate : 192 Kbps Channel(s) : 2 channels Channel positions : L R Sampling rate : 48.0 KHz Stream size : 8.96 MiB (9%) Language : English Text #1 ID : 5 Format : VobSub Codec ID : S_VOBSUB Codec ID/Info : The same subtitle format used on DVDs Language : English Text #2 ID : 6 Format : VobSub Codec ID : S_VOBSUB Codec ID/Info : The same subtitle format used on DVDs Language : German Menu 00:00:00.000 : en:Chapter 1 00:06:31.320 : en:Chapter 2 00:06:31.920 : en:Chapter 3 00:06:32.520 : en:Chapter 4 00:06:33.120 : en:Chapter 5 00:06:33.720 : en:Chapter 6 00:06:34.320 : en:Chapter 7 00:06:34.920 : en:Chapter 8 00:06:35.520 : en:Chapter 9 00:06:36.120 : en:Chapter 10 00:06:36.720 : en:Chapter 11 00:06:37.320 : en:Chapter 12 which was created with the flags --default-track --forced-track for german audio stream. playbin2 still selects the audio #3 (while e.g. kmplayer plays the correct track)
download location of the piece of content: ftp://test4711:test4711@82.149.226.170/Tonspuren-Test%20(OLP).MKV
Yes, there's no way for demuxers to say which tracks should be the default for one type.
i would like to expand this bug to the following issue: here i've got a matroska container file with 3 audio streams out of which a random one is chosen by playbin2. when trying to do logging, it will always use the first track, otherwise it could be any of the three. so i suspect a timing / race issue. please tell me how i can find out more about it. here's the mysterious file: http://www.homeys-bunker.de/dm800/samples/BrokenPlayback2.mkv (53 MB)
Created attachment 162043 [details] logfile of input-selector element all logfiles were created using the exact same command line: GST_DEBUG=*input-selector*:4 gst-launch --gst-debug-no-color playbin2 uri=file:///media/hdd/movie/mkv/BrokenPlayback2.mkv fl ags=3 >logfile-en.log 2>&1 it turned out that logging only the input selector seemed to consume little enough resources that the random audio stream issue still occurs
That's no race condition, simply a missing feature. playbin2 exposes the tracks in the order in which they're exposed by decodebin2/uridecodebin. And this happens in many different threads and as such can happen at completely different times every time you try it. A solution for this would be to add something to playbin2 and the demuxers to gives ranks (or something similar) to pads.
Andreas, does the patch I have in bug #634407 helps your case?
unfortunately i had to find out that with current gstreamer 0.10.30, that media file seems to not even wanna preroll anymore. i'm confused right now... gotta investigate what went wrong here, maybe it's an openembedded issue.
Created attachment 175036 [details] dot graph
Created attachment 175037 [details] media file doesn't preroll anymore GST_DEBUG=*:5 gst-launch --gst-debug-no-color playbin2 uri="file:///media/hdd/movie/mkv/BrokenPlayback2.mkv" flags=3 >nopreroll_6074 66.log 2>&1
the new issue (no preroll at all) is obsolete with 0.10.31, however the randomly chosen audio track (and subtitle stream) problem persists
Should this bug also be marked as a duplicate of 634407?
> Should this bug also be marked as a duplicate of 634407? I guess so, yes (arguably playbin could have sorted the pads irrespective of decodebin, but in any case, I think it's all good now in 1.0, so closing). *** This bug has been marked as a duplicate of bug 634407 ***