vp8enc fix

This commit is contained in:
Adel Gadllah 2012-05-29 23:12:16 +02:00
parent f2399b1f72
commit 6e52784f75
2 changed files with 30 additions and 1 deletions

View File

@ -14,7 +14,7 @@
Summary: GStreamer streaming media framework "bad" plug-ins
Name: gstreamer-plugins-bad-free
Version: 0.10.23
Release: 3%{?dist}
Release: 4%{?dist}
# The freeze and nfs plugins are LGPLv2 (only)
License: LGPLv2+ and LGPLv2
Group: Applications/Multimedia
@ -24,6 +24,8 @@ URL: http://gstreamer.freedesktop.org/
# modified with gst-p-bad-cleanup.sh from SOURCE1
Source: gst-plugins-bad-free-%{version}.tar.xz
Source1: gst-p-bad-cleanup.sh
# Based on upstream 04909e2c50e68
Patch0: vp8enc-bitrate-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: %{gstreamer} >= %{gst_minver}
@ -147,6 +149,7 @@ aren't tested well enough, or the code is not of good enough quality.
%prep
%setup -q -n gst-plugins-bad-%{version}
%patch0 -p1 -b .vp8enc_bitrate
sed -i 's/opencv <= 2.2.0/opencv <= 2.4.0/g' configure
%build
@ -345,6 +348,9 @@ sed -i 's/opencv <= 2.2.0/opencv <= 2.4.0/g' configure
%doc %{_datadir}/gtk-doc/html/gst-plugins-bad-libs-%{majorminor}
%changelog
* Tue May 29 2012 Adel Gadllah <adel.gadllah@gmail.com> 0.10.23-4
- Backport upstream patch to fix vp8enc (GNOME #676653, #676245)
* Tue Mar 05 2012 Benjamin Otte <otte@redhat.com> 0.10.23-3
- Reorganize spec file to optionally build without extras package

23
vp8enc-bitrate-fix.patch Normal file
View File

@ -0,0 +1,23 @@
diff -ru gst-plugins-bad-0.10.23.orign/ext/vp8/gstvp8enc.c gst-plugins-bad-0.10.23/ext/vp8/gstvp8enc.c
--- gst-plugins-bad-0.10.23.orign/ext/vp8/gstvp8enc.c 2012-01-25 18:10:21.000000000 +0100
+++ gst-plugins-bad-0.10.23/ext/vp8/gstvp8enc.c 2012-05-28 14:21:16.552995768 +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;