mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
[MOVED FROM BAD 106/134] 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
This commit is contained in:
parent
4fa72a5c23
commit
dccf3dc0b6
1 changed files with 4 additions and 1 deletions
|
@ -716,6 +716,10 @@ gst_vp8_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* Scale default bitrate to our size */
|
||||
cfg.rc_target_bitrate = gst_util_uint64_scale (cfg.rc_target_bitrate,
|
||||
info->width * info->height, cfg.g_w * cfg.g_h);
|
||||
|
||||
cfg.g_w = info->width;
|
||||
cfg.g_h = info->height;
|
||||
cfg.g_timebase.num = info->fps_d;
|
||||
|
@ -739,7 +743,6 @@ gst_vp8_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
|
|||
} 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;
|
||||
|
|
Loading…
Reference in a new issue