Commit 9134e9f8 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Use input framerate as timebase if none was explicitly specified.

After patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7f8913c21e40] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Before patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fbdaac22780] PSNR y:27.427366 u:41.505376 v:36.853477 average:28.990890 min:22.219454 max:52.509271
$ ffmpeg -i x.ivf -f rawvideo x.yuv
$ ffmpeg -f rawvideo -vcodec rawvideo -video_size 352x240 -framerate 29.97 -i x.yuv -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fadf9e013a0] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Change-Id: Ifac2d6c2ff8379b2d318fe5cfe4be0bf1bc9f27f
parent c0307e6c
......@@ -2074,6 +2074,8 @@ int main(int argc, const char **argv_) {
if (!global.have_framerate) {
global.framerate.num = input.framerate.numerator;
global.framerate.den = input.framerate.denominator;
FOREACH_STREAM(stream->config.cfg.g_timebase.den = global.framerate.num;
stream->config.cfg.g_timebase.num = global.framerate.den);
}
FOREACH_STREAM(set_default_kf_interval(stream, &global));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment