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 532422 - avenc_dvvideo: Add non-exposed framerate/width/height/format limitations to caps
avenc_dvvideo: Add non-exposed framerate/width/height/format limitations to caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 539847 547583 564105 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-09 22:53 UTC by Olivier Crête
Modified: 2013-01-01 23:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to expose (more) limitations to caps (11.02 KB, patch)
2008-07-28 12:10 UTC, Mark Nauwelaerts
committed Details | Review

Description Olivier Crête 2008-05-09 22:53:41 UTC
$  gst-launch videotestsrc ! videorate ! videoscale ! ffmpegcolorspace ! ffenc_dvvideo ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.331844669 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.332856490 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.333797840 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.334671790 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.335537499 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.336407678 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.337271920 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.338135813 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.339005923 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.339875543 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
0:00:00.340740065 26793 0x81c2f00 ERROR               ffmpeg gstffmpegenc.c:615:gst_ffmpegenc_chain_video:<ffenc_dvvideo0> ffenc_dvvideo: failed to encode buffer
Comment 1 Mark Nauwelaerts 2008-05-10 07:47:07 UTC
However, the following does work:
gst-launch videotestsrc num-buffers=10 ! videoscale ! ffmpegcolorspace ! video/x-raw-yuv,format="(fourcc)I420",width=720,height=576 ! ffenc_dvvideo ! fakesink

This is one of those cases where the ffmpeg encoder is somewhat picky about format and/or sizes it actually supports (and more so than its API might report), and that may need some special case'ing to determine supported caps.

(see also a few other cases at http://gentrans.sourceforge.net/docs/head/manual/html/howto.html#sect-ffmpeg-encoders)
Comment 2 Wim Taymans 2008-05-10 11:50:04 UTC
we have to add these constraints to the dv encoder caps.
Comment 3 Edward Hervey 2008-06-15 10:15:55 UTC
Making the bug title more generic.

The whole caps stuff in gstffmpegcodecmap.c is a total mess right now.

We basically need to add to the caps the limitations that the encoders have... but which aren't obviously exposed.
Comment 4 Sebastian Dröge (slomo) 2008-06-24 06:04:23 UTC
*** Bug 539847 has been marked as a duplicate of this bug. ***
Comment 5 Sebastian Dröge (slomo) 2008-06-24 06:05:19 UTC
The g726 encoder also has additional limitations:

    if (avctx->channels != 1 ||
        (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 &&
         avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
        av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
        return -1;
    }
    if (avctx->sample_rate != 8000 &&
avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) {
        av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
        return -1;
    }
Comment 6 Mark Nauwelaerts 2008-07-28 12:10:06 UTC
Created attachment 115423 [details] [review]
Patch to expose (more) limitations to caps

Following some moderately systematic probing, this should cover at least most limitations regarding width/height, pixel format and samplerate.

At present, these are primarily applied to (raw) encoder input caps, whereas others are left "wide".
Comment 7 Sebastian Dröge (slomo) 2008-10-08 11:04:45 UTC
Looks good to me and should be committed as it improves the current situation a lot. But it seems that the g726 limitations I've written above are not included in your patch, right? So there's probably more to improve here :)
Comment 8 Mark Nauwelaerts 2008-10-08 14:21:14 UTC
2008-10-08  Mark Nauwelaerts  <mark.nauwelaerts@collabora.co.uk>

	* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_vid_caps_new),
	(gst_ff_aud_caps_new), (gst_ffmpeg_codecid_to_caps),
	(gst_ffmpeg_codectype_to_caps):
	* ext/ffmpeg/gstffmpegcodecmap.h:
	* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_negotiate),
	(gst_ffmpegdec_register):
	* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_getcaps),
	(gst_ffmpegenc_register):
	Add some more width/height/channels/rate limitations to caps
	to cater for more automagic negotiation.  Addresses #532422.

Regarding g726 limitations above:
- it seems that the current ffmpeg code has somewhat changed, though still also involves combinations of bitrate and samplerate.  However, we can't have property dependent caps, so hard to express that.
- the mono audio limitation is included in the patch.
So, I think all that can be (regarding g726) is included, which is not to say there may be gaps/improvements possible elsewhere ...
Comment 9 Edward Hervey 2008-12-06 16:10:24 UTC
*** Bug 547583 has been marked as a duplicate of this bug. ***
Comment 10 Edward Hervey 2008-12-17 12:11:43 UTC
*** Bug 564105 has been marked as a duplicate of this bug. ***
Comment 11 Tim-Philipp Müller 2013-01-01 23:17:42 UTC
The original pipeline works now in git master, and I think we have this generally covered as good as possible for most cases, but will probably still have to add some special cases.

Also see bug #600895 .