GNOME Bugzilla – Bug 676245
vp8enc stops working after libvpx-1.1.0 update
Last modified: 2012-05-28 12:03:29 UTC
After updating libvpx to 1.1.0 on two Gentoo systems and recompiling gst-plugins-vp8, vp8enc simply stops working. gst-launch-0.10 -v videotestsrc ! vp8enc ! fakesink Setting pipeline to PAUSED ... /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, color-matrix=(string)sdtv, chroma-site=(string)mpeg2 Pipeline is PREROLLING ... /GstPipeline:pipeline0/GstVP8Enc:vp8enc0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, color-matrix=(string)sdtv, chroma-site=(string)mpeg2 Redistribute latency... It hangs here now and never gets to status playing. Installed versions: gst-inspect-0.10 vp8enc Factory Details: Long name: On2 VP8 Encoder Class: Codec/Encoder/Video Description: Encode VP8 video streams Author(s): David Schleef <ds@entropywave.com> Rank: primary (256) Plugin Details: Name: vp8 Description: VP8 plugin Filename: /usr/lib64/gstreamer-0.10/libgstvp8.so Version: 0.10.22 License: LGPL Source module: gst-plugins-bad Source release date: 2011-05-10 Binary package: Gentoo GStreamer Ebuild Origin URL: http://www.gentoo.org media-libs/libvpx-1.1.0
Confirmed... any idea what's wrong here?
gstvp8enc.c:797:gst_vp8_enc_set_format:<vp8enc0> error: abi mismatch Updating libvpx worked fine, it started not working after I rebuild vp8enc with it. Looking at it now.
The culprit is: if (!ctx->cfg.rc_target_bitrate) return res; found (twice) in vp8e_encode. The commit adding it was 25a36d6b3c6d206ad19d47f9999eb71109f87dea (in libvpx), saying "multi-res: restore v1.0.0 API". Removing those two duplicated checks "fixes" vp8enc. I'll now go see whether the target bitrate should be initialized by us in the first place.
Created attachment 214305 [details] [review] vp8enc: fix target bitrate config with libvpx 1.1.0 libvpx 1.1.0 disallows a bitrate of 0, which was used by vp8enc as a default value. Instead, we use the default libvpx bitrate, scaled to our video size, if no bitrate was specified. This fixes encoding VP8 video with libvpx 1.1.0.
Comment on attachment 214305 [details] [review] vp8enc: fix target bitrate config with libvpx 1.1.0 Looks good and works for me, but maybe use gst_util_uint64_scale() or at least 64 bit integer arithmetic for scaling the bitrate Please push :)
Created attachment 214642 [details] [review] vp8enc: fix target bitrate config with libvpx 1.1.0 libvpx 1.1.0 disallows a bitrate of 0, which was used by vp8enc as a default value. Instead, we use the default libvpx bitrate, scaled to our video size, if no bitrate was specified. This fixes encoding VP8 video with libvpx 1.1.0.
Thanks, pushed with your comment addressed. commit 04909e2c50e6802ea5dec6d0085d60d5c57f671c Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Fri May 18 12:46:55 2012 +0100 vp8enc: fix target bitrate config with libvpx 1.1.0 libvpx 1.1.0 disallows a bitrate of 0, which was used by vp8enc as a default value. Instead, we use the default libvpx bitrate, scaled to our video size, if no bitrate was specified. This fixes encoding VP8 video with libvpx 1.1.0. https://bugzilla.gnome.org/show_bug.cgi?id=676245
*** Bug 676653 has been marked as a duplicate of this bug. ***