Discussion:
[Bug 740368] New: cannot change video track if tracks have different width/height
"GStreamer" (bugzilla.gnome.org)
2014-11-19 14:05:47 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

Summary: cannot change video track if tracks have different
width/height
Classification: Platform
Product: GStreamer
Version: 1.4.4
OS/Version: Linux
Status: UNCONFIRMED
Severity: minor
Priority: Normal
Component: don't know
AssignedTo: gstreamer-***@lists.freedesktop.org
ReportedBy: ***@connected-labs.com
QAContact: gstreamer-***@lists.freedesktop.org
GNOME version: ---


If a media has different video tracks, set the playbin "current-video" property
allow to select the current track displayed

g_object_set (playbin, "current-video", index, NULL);

This is working perfectly fine if the different tracks have the same
width/height.
However, if the width/height change, gstreamer will fail with the following
error

setting current video stream to 1
ERROR default video-frame.c:152:gst_video_frame_map_id: invalid
buffer size 540000 < 556800
ERROR mpeg2dec
gstmpeg2dec.c:563:gst_mpeg2dec_alloc_buffer:<mpeg2dec0> Failed to map frame
WARN multiqueue
gstmultiqueue.c:1571:gst_multi_queue_loop:<multiqueue0> error: Internal data
stream error.
WARN multiqueue
gstmultiqueue.c:1571:gst_multi_queue_loop:<multiqueue0> error: streaming
stopped, reason error
Error received from element multiqueue0: Internal data stream error.
( as reported using GST_DEBUG=*:3)

Please find attached a test application that can be used to reproduce the bug,
based on
http://docs.gstreamer.com/plugins/viewsource/viewpagesrc.action?pageId=327794

I've made the following changes:

1) update to be compatible with gst 1.0 (playbin2 -> playbin)
2) uri of media comes from command line
3) console prompt is used to select video (instead of text)

Hopefully the attached code can be compiled directly using cmake (cmake file
includes).

Steps to reproduce the issue:

1) test with a video containing 2 video tracks (same width / height):

./multitrack
http://trac.webkit.org/export/176315/trunk/LayoutTests/media/content/two-audio-and-video-tracks.mkv

--> press 0 or 1 in console allow to select the video track, it works perfectly
fine.

2) test with a video containing 3 video tracks with different w/h:

GST_DEBUG=*:3 ./multitrack file://$PWD/multivideo.mp4

gstreamer will fail when changing the video track.


multivideo.mp4 is included in attached code and has been generated using
ffmpeg:

ffmpeg -loop 1 -i image000.png -c:v libx264 -t 30 -pix_fmt yuv420p blue.mp4
ffmpeg -loop 1 -i image002.png -c:v libx264 -t 30 -pix_fmt yuv420p purple.mp4
ffmpeg -loop 1 -i image001.png -c:v libx264 -t 30 -pix_fmt yuv420p green.mp4
ffmpeg -i green.mp4 -i blue.mp4 -i purple.mp4 -map 0:0 -map 1:0 -map 2:0
-metadata:s:v:0 language=eng -metadata:s:v:1 language=fre -metadata:s:v:1
language=deu -c copy -c:v mpeg2video multivideo.mp4

(mplayer and SMPlayer are able to select multivideo.mp4 video tracks).
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 14:08:16 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

--- Comment #1 from Fabien Vallée <***@connected-labs.com> 2014-11-19 14:08:10 UTC ---
Created an attachment (id=291002)
--> (https://bugzilla.gnome.org/attachment.cgi?id=291002)
source code + cmake + video
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 14:18:52 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

--- Comment #2 from Fabien Vallée <***@connected-labs.com> 2014-11-19 14:18:47 UTC ---
I've been able to workaround the "gst_video_frame_map_id: invalid
buffer size 540000 < 556800" issue, using GST_PAD_SET_FLUSHING(pad) on the
previously activated track before g_object_set(m_playbin.get(), "current-video"

Change the "current-video" works fine in that case, however we cannot switch
back to a previously activated track, i.e.

1) track 0 is selected
2) GST_PAD_SET_FLUSHING(pad) on track 0 pad.
3) g_object_set(m_playbin.get(), "current-video", 1);
4) track 1 is selected, everything fine so far

5) GST_PAD_SET_FLUSHING(pad) on track 1 pad.
6) g_object_set(m_playbin.get(), "current-video", 0);
7) track 0 won't playback (because of flushing)

FYI, In step 6), gst_pad_check_reconfigure (m_pad) returns true.

Is there any way to "restart" a pad that has been set to FLUSHING ?
(GST_PAD_UNSET_FLUSHING is not working).

Or is there any other workaround that could allow to bypass the " invalid
buffer size" issue ? Updating the GStCaps somehow ?

Any input / comment is welcome. Thanks a lot.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 15:04:08 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

Nicolas Dufresne (stormer) <nicolas.dufresne> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@collabora.
| |co.uk

--- Comment #3 from Nicolas Dufresne (stormer) <***@collabora.co.uk> 2014-11-19 15:04:06 UTC ---
Does mpeg2dec support renegotiation at all ? Might be a missing feature here.
Have you tried the same with H264/avdec_h264 ?
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 15:27:10 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

Fabien Vallée <fvallee> changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|cannot change video track |[mpeg2dec] cannot change
|if tracks have different |video track if tracks have
|width/height |different width/height
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 15:41:52 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

--- Comment #4 from Fabien Vallée <***@connected-labs.com> 2014-11-19 15:41:47 UTC ---
I've re-encoded my media using libx264 and it works fine, I can change the
video track. This workaround is good enough for me, thanks a lot !

We can close this bug, except if anyone is willing to work on renegotiation
support in mpeg2dec ^^
(I can help to test if needed, but I fear I cannot help further).

Thanks again.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 15:46:31 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | don't know | 1.4.4

Nicolas Dufresne (stormer) <nicolas.dufresne> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Summary|[mpeg2dec] cannot change |mpeg2dec: Failed
|video track if tracks have |"uncleanly" upon resolution
|different width/height |change (e.g. video track
| |change)
Ever Confirmed|0 |1

--- Comment #5 from Nicolas Dufresne (stormer) <***@collabora.co.uk> 2014-11-19 15:46:28 UTC ---
I'll have to check if there isn't already a bug for renegotiation in mpeg2dec,
though imho it should fail in a cleaner way if we don't implement the feature.
We'll keep it around until we have sorted it out. Thanks a lot for the report,
glad you aren't blocked on this.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (bugzilla.gnome.org)
2014-11-19 15:49:00 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368
GStreamer | gst-plugins-ugly | 1.4.4

Tim-Philipp Müller <t.i.m> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@zen.co.uk
Component|don't know |gst-plugins-ugly

--- Comment #6 from Tim-Philipp Müller <***@zen.co.uk> 2014-11-19 15:48:54 UTC ---
I thought this worked at some point.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:34:46 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=740368

GStreamer system administrator <***@gstreamer.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |OBSOLETE

--- Comment #7 from GStreamer system administrator <***@gstreamer.net> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/issues/9.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...