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 651496 - encodebin seems to fail to pick up container variant
encodebin seems to fail to pick up container variant
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-30 20:09 UTC by Christian Fredrik Kalager Schaller
Modified: 2011-09-05 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple testcase, doesn't EOS properly, but generates a proper file showing the issue (1.99 KB, text/x-python)
2011-07-18 16:02 UTC, Christian Fredrik Kalager Schaller
  Details
encodebin: Select muxer further (3.96 KB, patch)
2011-08-04 01:18 UTC, Thiago Sousa Santos
none Details | Review
encodebin: Select muxer further (3.82 KB, patch)
2011-08-11 13:30 UTC, Thiago Sousa Santos
none Details | Review
encodebin: Select muxer further (4.88 KB, patch)
2011-08-23 01:15 UTC, Thiago Sousa Santos
committed Details | Review

Description Christian Fredrik Kalager Schaller 2011-05-30 20:09:06 UTC
I set up encodebin with the following caps:
video/quicktime, variant=(string)3gpp

Yet, looking at the dumpfile graph I noticed today that it ends up with
variant=apple. So I assume at some point encodebin reverts to the default of the muxer by mistake?
Comment 1 Sebastian Dröge (slomo) 2011-05-31 09:13:02 UTC
That probably happens because qtmux and gppmux both have a rank of primary and qtmux can output video/quicktime without any variant at all (which would satisfy the variant=3gpp constraint)
Comment 2 Tim-Philipp Müller 2011-05-31 10:39:10 UTC
> That probably happens because qtmux and gppmux both have a rank of primary and
> qtmux can output video/quicktime without any variant at all (which would
> satisfy the variant=3gpp constraint)

Then encodebin behaviour has changed, it uses to look for an exact match, not a subset/intersection.
Comment 3 Tim-Philipp Müller 2011-05-31 10:40:17 UTC
(PS: not saying that that's what it should be doing, also see bug #647821)
Comment 4 Christian Fredrik Kalager Schaller 2011-05-31 12:37:33 UTC
for completness sake I just tested with isomp4 format and same happens there, it defaults to quicktime
Comment 5 Christian Fredrik Kalager Schaller 2011-07-18 10:20:13 UTC
Anyone got an ideas what needs to be the solution for this bug?
Comment 6 Tim-Philipp Müller 2011-07-18 10:26:27 UTC
> Anyone got an ideas what needs to be the solution for this bug?

A small test case might help move this along..
Comment 7 Christian Fredrik Kalager Schaller 2011-07-18 16:02:36 UTC
Created attachment 192198 [details]
Simple testcase, doesn't EOS properly, but generates a proper file showing the issue

Testcase added, it is supposed to create a mp4 iso file, but instead ends up creating a Apple quicktime file.
Comment 8 Thiago Sousa Santos 2011-08-01 23:44:42 UTC
(In reply to comment #1)
> That probably happens because qtmux and gppmux both have a rank of primary and
> qtmux can output video/quicktime without any variant at all (which would
> satisfy the variant=3gpp constraint)

Yes, this is the issue. gst_caps_is_subset / gst_caps_can_intersect are the options to list the elements from a certain caps. _is_subset is currently used and qtmux will always match.

The related bug on why this variant-less entry was added: https://bugzilla.gnome.org/show_bug.cgi?id=642879
Comment 9 Christian Fredrik Kalager Schaller 2011-08-02 10:17:48 UTC
Copying Tims response over from 642879 as it contains a suggestion for how to fix this bug (without reverting the fix from that bug)

> Shouldn't the fix for this issue be to update the typefinders to always
> generate a variant?

Not sure that's possible.

Another fix would be to give qtmux lower priority, so that encodebin tries the
non-generic muxers first.

However, I think maybe encodebin should first try to find an exact match and
only then settle for a subset match.
Comment 10 Thiago Sousa Santos 2011-08-04 01:18:31 UTC
Created attachment 193217 [details] [review]
encodebin: Select muxer further

Sort muxers based on their caps and ranking before iterating to
find one that fits the profile.

Sorting is done by putting the elements that have a pad template
that can produce the exact caps that is on the profile. For example:
when asking for "video/quicktime, variant=iso", muxers that
have this exact caps on their pad templates will be put first on
the list than ones that have only "video/quicktime".

This patch applies on top of the patches of https://bugzilla.gnome.org/show_bug.cgi?id=650652

I'm not entirely happy with the algorith that orders tha muxers, but it is enough
for the 'variant' problem. Maybe someone has a better and more generic caps comparison
algorith.
Comment 11 Thiago Sousa Santos 2011-08-11 13:30:34 UTC
Created attachment 193640 [details] [review]
encodebin: Select muxer further

Updated patch to not depend on the patches from
the encodebin not plugging parsers bug.

This works and Tim has a patch adding a unit test for it.

Currently, the muxers are sorted based on gst_caps_is_equal, if
it results true, the muxer goes to the beginning of the list, otherwise
it goes to the back.

The question is: is gst_caps_is_equal a good way of comparing caps here?
Or should we write another function?

Maybe iterating over the format caps structures and looking for a fully
compatible one on the muxers pad, if this results in true, the muxer
goes to the beginning of the list.

Any comments, or another ideas?
Comment 12 Christian Fredrik Kalager Schaller 2011-08-19 11:13:27 UTC
Edward or Tim, is this patch ready to be merged?
Comment 13 Thiago Sousa Santos 2011-08-23 01:15:49 UTC
Created attachment 194439 [details] [review]
encodebin: Select muxer further

Updated patch that doesn't rely on gst_caps_is_equal
Comment 14 Thiago Sousa Santos 2011-09-05 21:06:49 UTC
fixed by commit 2768ed75e099dac907528e13f4f7ef5a035b651a