ffmpeg: init filtergraphs only after we have a frame on each input
authorAnton Khirnov <anton@khirnov.net>
Fri, 27 May 2016 10:14:33 +0000 (12:14 +0200)
committerwm4 <nfxjfg@googlemail.com>
Fri, 3 Mar 2017 07:45:43 +0000 (08:45 +0100)
commitaf1761f7b5b1b72197dc40934953b775c2d951cc
tree46941e97c792c8331d288639e4f39231bcb0f017
parent4ee5aed122ba7d289c1686eca6eba161d5d62304
ffmpeg: init filtergraphs only after we have a frame on each input

This makes sure the actual stream parameters are used, which is
important mainly for hardware decoding+filtering cases, which would
previously require various weird workarounds to handle the fact that a
fake software graph has to be constructed, but never used.
This should also improve behaviour in rare cases where
avformat_find_stream_info() does not provide accurate information.

This merges Libav commit a3a0230. It was previously skipped.

The code in flush_encoders() which sets up a "fake" format wasn't in
Libav. I'm not sure if it's a good idea, but it tends to give
behavior closer to the old one in certain corner cases.

The vp8-size-change gives different result, because now the size of
the first frame is used. libavformat reported the size of the largest
frame for some reason.

The exr tests now use the sample aspect ratio of the first frame. For
some reason libavformat determines 0/1 as aspect ratio, while the
decoder returns the correct one.

The ffm and mxf tests change the field_order values. I'm assuming
another libavformat/decoding mismatch.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
18 files changed:
ffmpeg.c
ffmpeg.h
ffmpeg_cuvid.c
ffmpeg_filter.c
ffmpeg_opt.c
ffmpeg_qsv.c
tests/ref/fate/exr-rgb-scanline-pxr24-half-uint32-13x9
tests/ref/fate/exr-rgba-scanline-float-half-b44-12x8-l1
tests/ref/fate/exr-rgba-scanline-float-half-b44-12x8-l2
tests/ref/fate/exr-rgba-scanline-float-half-b44-13x9-l1
tests/ref/fate/exr-rgba-scanline-float-half-b44-13x9-l2
tests/ref/fate/exr-rgba-scanline-float-half-b44a-12x8-l1
tests/ref/fate/exr-rgba-scanline-float-half-b44a-12x8-l2
tests/ref/fate/exr-rgba-scanline-float-half-b44a-13x9-l1
tests/ref/fate/exr-rgba-scanline-float-half-b44a-13x9-l2
tests/ref/fate/vp8-size-change
tests/ref/lavf/ffm
tests/ref/lavf/mxf