From 04909e2c50e6802ea5dec6d0085d60d5c57f671c Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 18 May 2012 12:46:55 +0100 Subject: [PATCH] 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 --- ext/vp8/gstvp8enc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: gst-plugins-bad0.10/ext/vp8/gstvp8enc.c =================================================================== --- gst-plugins-bad0.10.orig/ext/vp8/gstvp8enc.c 2012-02-21 11:25:03.000000000 +0100 +++ gst-plugins-bad0.10/ext/vp8/gstvp8enc.c 2012-05-22 11:41:43.589686599 +0200 @@ -732,6 +732,11 @@ return FALSE; } + /* Scale default bitrate to our size */ + cfg.rc_target_bitrate = gst_util_uint64_scale (cfg.rc_target_bitrate, + state->width * state->height, + cfg.g_w * cfg.g_h); + cfg.g_w = state->width; cfg.g_h = state->height; cfg.g_timebase.num = state->fps_d; @@ -755,7 +760,6 @@ } else { cfg.rc_min_quantizer = (gint) (63 - encoder->quality * 6.2); cfg.rc_max_quantizer = (gint) (63 - encoder->quality * 6.2); - cfg.rc_target_bitrate = encoder->bitrate; } cfg.rc_dropframe_thresh = encoder->drop_frame; cfg.rc_resize_allowed = encoder->resize_allowed;