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 645385 - Transitions act randomly depending on the video codec in use.
Transitions act randomly depending on the video codec in use.
Product: GStreamer
Classification: Platform
Component: gst-editing-services
git master
Other Linux
: Normal normal
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 655984 (view as bug list)
Depends on:
Reported: 2011-03-21 11:41 UTC by Mathieu Duponchelle
Modified: 2013-09-24 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---

fix transitions of videos with different sizes (3.91 KB, patch)
2011-08-14 18:48 UTC, Luis de Bethencourt Guimera
none Details | Review

Description Mathieu Duponchelle 2011-03-21 11:41:48 UTC
Using the classical crossfade transition, I get strange bugs, always with the same sources. I thought it came from flash videos, but some flash videos do work well sometimes.
I have a pipeline which is set in preview mode, and I get things like :
-when the transition starts, the first video is reduced and pushed to a corner of the screen;
-when the transition starts, the first video disappears and the second starts fading in.
The problems always happen with the same videos, I can make them available on a random sharing website if needed.
Comment 1 Thibault Saunier 2011-04-12 19:24:07 UTC
Looks like:
    ->Theora, divx mpeg4, raw YUV, mpeg4 don't work, the output is different each time
    -> h.263, h.264, xvid mpeg4 work just fine
Comment 2 Brandon Lewis 2011-04-15 17:16:01 UTC
More information, please.

The first problem you mention will sometimes happen when the resolutions of the two sources are different. We don't handle this case very well at the moment. Some combination of videobox/scale might be required inside the crossfade transition to scale the two streams relative to each other according to some simple rules (I think you can also use pad-properties on videomixer input pads to do scaling and position as well, but the borders will be transparent).

Do you get any warnings or errors (GST_DEBUG=2) on the console?. Obvious culprits for the second case will be "Not linked" errors. A full debug log would be more useful. My guess is that it's a caps-negotiation failure somewhere in the decoder->colospace->videomixer portion of the pipeline.
Comment 3 Thibault Saunier 2011-04-19 12:33:17 UTC
The transition is composed of a bin which has 2 gohstpads linked to ffmpegvideocolorspace elements which are themselves linked to the videomixer and another ffmpecolospace conversion (used as a ghostpad) after the videomixer src. It could be drawn as such (for the crossfade only):

   ! ffmpegcolorspace ! videomixer(2) name=mix ! ffmpegcolorspace (ghostpad) ! ffmpegcolorspace ! mix. !

The problem is that we need to make sure the 2 videos have the same size (scaling) while being mixed. Introducing a videoscale between the sources and the mixer (sinks) with hard-coded Caps (height/width) to be sure the video have the same size make effects working properly.

But, this is not a solution, and instead, we could:
    * have a fixed size for all the sources/track in a timeline, which I think for some reason has been preferred not to be done. 
    * get the caps of the 2 incoming sources and make the scaling equal to the size of the smallest video coming in.
Comment 4 Brandon Lewis 2011-04-19 17:18:26 UTC
We definitely don't want to force the size of the incoming video. This is inefficient, inconvenient, and against the spirit of GES -- which is intended to be as automatic as possible.

You want to chose your mixing resolution based on the desired output aspect ratio. If you are compositing a 4:3 source and a 16:9 source, the correct output resolution depends on whether the user thinks they have a 16:9 project or a 4:3 project. If it's a 16:9 project, then the right thing to do is to pillar-box the 4:3 source and scale the result to the resolution of the 16:9 source. If it's a 4:3 project, you letter box the 16:9 source and scale the result to match the resolution of the 4:3 source. But I think you always want to match the resolution of one source to the other so that we avoid having to apply software scaling to both streams.

We may need to add an "output display-aspect-ratio hint" property to GESTimeline for this purpose.  We can and should attempt to infer the desired output aspect ratio based on some heuristic, such as the DAR of the majority of sources in the timeline; however, it's quite likely that we will occasionally guess wrong, so we should allow the user to override this setting.

As an advanced feature, we may want to support some per-clip overrides. For example, the user has a 720x50 pixel still image they wish to use as a title key. The banner should fade in along the bottom of the screen, not the centre. In this case we would want a per-clip override of the display aspect ratio, as well as a position adjustment (taking advantage of videomixer2's "x" and "y" pad properties).
Comment 5 Tim-Philipp Müller 2011-08-14 18:39:53 UTC
*** Bug 655984 has been marked as a duplicate of this bug. ***
Comment 6 Luis de Bethencourt Guimera 2011-08-14 18:48:41 UTC
Created attachment 193825 [details] [review]
fix transitions of videos with different sizes

Temporary fix so transitions don't hang the video stream or look broken. A more cross-timeline solution will be needed in the future. Looking into it.
Comment 7 Luis de Bethencourt 2011-08-24 16:06:44 UTC
The solution is hackish/ugly and very racy. Since it waits for the caps to be set in the first video, and then set the capsfilter in the second video, this might happen in the wrong moment in some cases.

Transitions with images are also broken.

A proper solution, depends on the not-yet-available GESMaterials. So will wait until those are available before closing it.
Comment 8 Thibault Saunier 2012-06-21 21:14:53 UTC
commit 32f0a49c6a2f7cc9ce54fdc9ea982a3c9e003a68
Author: Luis de Bethencourt <>
Date:   Sun Aug 14 20:27:08 2011 +0200

    ges/ges-track-video-transition.c: fix transition of different video sizes