1 From 04909e2c50e6802ea5dec6d0085d60d5c57f671c Mon Sep 17 00:00:00 2001
2 From: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
3 Date: Fri, 18 May 2012 12:46:55 +0100
4 Subject: [PATCH] vp8enc: fix target bitrate config with libvpx 1.1.0
6 libvpx 1.1.0 disallows a bitrate of 0, which was used by
7 vp8enc as a default value.
9 Instead, we use the default libvpx bitrate, scaled to our
10 video size, if no bitrate was specified.
12 This fixes encoding VP8 video with libvpx 1.1.0.
14 https://bugzilla.gnome.org/show_bug.cgi?id=676245
16 ext/vp8/gstvp8enc.c | 6 +++++-
17 1 file changed, 5 insertions(+), 1 deletion(-)
19 Index: gst-plugins-bad0.10/ext/vp8/gstvp8enc.c
20 ===================================================================
21 --- gst-plugins-bad0.10.orig/ext/vp8/gstvp8enc.c 2012-02-21 11:25:03.000000000 +0100
22 +++ gst-plugins-bad0.10/ext/vp8/gstvp8enc.c 2012-05-22 11:41:43.589686599 +0200
27 + /* Scale default bitrate to our size */
28 + cfg.rc_target_bitrate = gst_util_uint64_scale (cfg.rc_target_bitrate,
29 + state->width * state->height,
32 cfg.g_w = state->width;
33 cfg.g_h = state->height;
34 cfg.g_timebase.num = state->fps_d;
37 cfg.rc_min_quantizer = (gint) (63 - encoder->quality * 6.2);
38 cfg.rc_max_quantizer = (gint) (63 - encoder->quality * 6.2);
39 - cfg.rc_target_bitrate = encoder->bitrate;
41 cfg.rc_dropframe_thresh = encoder->drop_frame;
42 cfg.rc_resize_allowed = encoder->resize_allowed;