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 560305 - x264enc & ffmux_* doesnt link
x264enc & ffmux_* doesnt link
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other All
: Normal blocker
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-11 09:57 UTC by kapil
Modified: 2008-11-11 17:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
possible patch (1.03 KB, patch)
2008-11-11 10:27 UTC, Wim Taymans
committed Details | Review

Description kapil 2008-11-11 09:57:55 UTC
Please describe the problem:
If x264enc is tried to link with any of the ffmux_* it doesnt link, and gives error "Aspect ratio mismatch between encoder and muxer layer". This comes since x264enc src caps has "pixel-aspect-ratio=(fraction)1/1", while if I use ffenc_mpeg4 it works since the src caps doesnt have any "pixel-aspect-ratio" caps.
On further investigation it revealed that this problem occurs due to a probable bug in ffmpeg ie, in "libavformat/utils.c: (av_write_header):" there is a "av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)" check that fails. This happens since the aspect ratio incase of x264enc is set in st->codec->sample_aspect_ratio = {1, 1}, while the mux output st->sample_aspect_ratio = {0, 1}. If this check is commented it works fine.

Steps to reproduce:
1. gst-launch-0.10 filesrc location=1.flv ! flvdemux ! ffdec_vp6f ! x264enc ! ffmux_3gp ! filesink location=test.3gp -v
2. gst-launch-0.10 filesrc location=1.flv ! flvdemux ! ffdec_vp6f ! ffenc_mpeg4 ! ffmux_3gp ! filesink location=test.3gp -v



Actual results:
1. Doesnt work, gives error "Aspect ratio mismatch between encoder and muxer layer"
2. Works.

Expected results:
x264enc case should also work.

Does this happen every time?
yes

Other information:
This is valid for any ffmux_*
Comment 1 Wim Taymans 2008-11-11 10:27:37 UTC
Created attachment 122397 [details] [review]
possible patch

Thi patch copies the aspect ratio set in the codec context to the stream.
Comment 2 Jan Schmidt 2008-11-11 17:15:16 UTC
This looks correct to me - the codec should hold the pixel-aspect-ratio (if any) extracted from the caps.
Comment 3 Wim Taymans 2008-11-11 17:18:59 UTC
        * ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_setcaps):
        Copy the codec aspect ratio to the stream, ffmpeg expects them to be the
        same. Fixes #560305.