diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-05-11 13:33:26 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-05-12 11:54:40 +0300 |
commit | eb365cc3bb9361469ce11f7fe99f26c892b0663e (patch) | |
tree | 61618d163c561468cd22387d3100e7186fe253d2 /ext | |
parent | 692df969ea5fbdf033f20d9ad8c763f7b666f3c2 (diff) | |
download | gstreamer-plugins-good-eb365cc3bb9361469ce11f7fe99f26c892b0663e.tar.gz |
vp[89]enc: Don't set timebase from the framerate
The framerate very often is just an indication of the ideal framerate, not the
actual framerate of the stream. By just using the framerate, we confuse the
rate control algorithm algorithm as multiple frames will map to the same PTS
or have durations of 0.
https://bugzilla.gnome.org/show_bug.cgi?id=749122
Diffstat (limited to 'ext')
-rw-r--r-- | ext/vpx/gstvp8enc.c | 10 | ||||
-rw-r--r-- | ext/vpx/gstvp9enc.c | 10 |
2 files changed, 0 insertions, 20 deletions
diff --git a/ext/vpx/gstvp8enc.c b/ext/vpx/gstvp8enc.c index ee1cbb9f1..2d9500df7 100644 --- a/ext/vpx/gstvp8enc.c +++ b/ext/vpx/gstvp8enc.c @@ -1540,22 +1540,12 @@ gst_vp8_enc_set_format (GstVideoEncoder * video_encoder, GST_DEBUG_OBJECT (video_encoder, "Using timebase configuration"); encoder->cfg.g_timebase.num = encoder->timebase_n; encoder->cfg.g_timebase.den = encoder->timebase_d; - } else if (GST_VIDEO_INFO_FPS_D (info) != 0 - && GST_VIDEO_INFO_FPS_N (info) != 0) { - /* GstVideoInfo holds either the framerate or max-framerate (if framerate - * is 0) in FPS so this will be used if max-framerate or framerate - * is set */ - GST_DEBUG_OBJECT (video_encoder, "Setting timebase from framerate"); - encoder->cfg.g_timebase.num = GST_VIDEO_INFO_FPS_D (info); - encoder->cfg.g_timebase.den = GST_VIDEO_INFO_FPS_N (info); } else { /* Zero framerate and max-framerate but still need to setup the timebase to avoid * a divide by zero error. Presuming the lowest common denominator will be RTP - * VP8 payload draft states clock rate of 90000 which should work for anyone where * FPS < 90000 (shouldn't be too many cases where it's higher) though wouldn't be optimal. RTP specification * http://tools.ietf.org/html/draft-ietf-payload-vp8-01 section 6.3.1 */ - GST_WARNING_OBJECT (encoder, - "No timebase and zero framerate setting timebase to 1/90000"); encoder->cfg.g_timebase.num = 1; encoder->cfg.g_timebase.den = 90000; } diff --git a/ext/vpx/gstvp9enc.c b/ext/vpx/gstvp9enc.c index 532b59ebd..c73034182 100644 --- a/ext/vpx/gstvp9enc.c +++ b/ext/vpx/gstvp9enc.c @@ -1513,22 +1513,12 @@ gst_vp9_enc_set_format (GstVideoEncoder * video_encoder, GST_DEBUG_OBJECT (video_encoder, "Using timebase configuration"); encoder->cfg.g_timebase.num = encoder->timebase_n; encoder->cfg.g_timebase.den = encoder->timebase_d; - } else if (GST_VIDEO_INFO_FPS_D (info) != 0 - && GST_VIDEO_INFO_FPS_N (info) != 0) { - /* GstVideoInfo holds either the framerate or max-framerate (if framerate - * is 0) in FPS so this will be used if max-framerate or framerate - * is set */ - GST_DEBUG_OBJECT (video_encoder, "Setting timebase from framerate"); - encoder->cfg.g_timebase.num = GST_VIDEO_INFO_FPS_D (info); - encoder->cfg.g_timebase.den = GST_VIDEO_INFO_FPS_N (info); } else { /* Zero framerate and max-framerate but still need to setup the timebase to avoid * a divide by zero error. Presuming the lowest common denominator will be RTP - * VP9 payload draft states clock rate of 90000 which should work for anyone where * FPS < 90000 (shouldn't be too many cases where it's higher) though wouldn't be optimal. RTP specification * http://tools.ietf.org/html/draft-ietf-payload-vp9-01 section 6.3.1 */ - GST_WARNING_OBJECT (encoder, - "No timebase and zero framerate setting timebase to 1/90000"); encoder->cfg.g_timebase.num = 1; encoder->cfg.g_timebase.den = 90000; } |