GNOME Bugzilla – Bug 469837
[playbin] stream-info gives incorrect information when using RTSP streaming
Last modified: 2011-05-18 20:26:54 UTC
When using playbin (and decodebin2) for playing RTSP stream, the "stream-info" contents seem to vary between the runs and clips. I made a test application that registers a handler for "notify::stream-info" signal in playbin. In that handler I find video-related information and print the caps, both from "caps" object and from decoder srcpad. They vary like this: 1st case: I used internal own RTSP streaming server, URI not available). Run 1: caps from streaminfo: video/x-raw-rgb; video/x-raw-yuv caps from decoder srcpad: video/x-raw-rgb; video/x-raw-yuv Run 2: caps from streaminfo: video/x-raw-rgb; video/x-raw-yuv caps from decoder srcpad: video/x-raw-yuv, width=(int)352, height=(int)288, framerate=(fraction)15/1, format=(fourcc)I420 For some streams (e.g. rtsp://stream.serv.ch/samples/sample_100kbit.mp4) it gives caps but they are not final: video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 16, 4096 ], height=(int)[ 16, 4096 ] What I need is the resolution of the video. Looks like some kind of race condition, since in case 1 the bin was able to give correct values *sometimes*.
Yes, I've come across this in totem too, it is racy. If no data flow has happened on the pad yet, you'll get the template caps IIRC. Best to wait until playbin is in PAUSAED state before reading the stream-info (the notify::stream-info thing isn't 100% reliable and you get into multi-thread hell).
I'll close this as WONTFIX now because the stream-info stuff is now done differently in playbin2 and playbin(1) is deprecated now.