This ensures that an encoder is able to cope with input frames with resolution changing only if it declares the capability of AV_CODEC_CAP_VARIABLE_DIMENSIONS.
Signed-off-by: Linjie Fu <[email protected]> --- fftools/ffmpeg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 2e9448e..5859781 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1056,6 +1056,15 @@ static void do_video_out(OutputFile *of, InputStream *ist = NULL; AVFilterContext *filter = ost->filter->filter; + if (next_picture && (enc->width != next_picture->width || + enc->height != next_picture->height)) { + if (!(enc->codec->capabilities & AV_CODEC_CAP_VARIABLE_DIMENSIONS)) { + av_log(NULL, AV_LOG_ERROR, "Variable dimension encoding " + "is not supported by %s.\n", enc->codec->name); + goto error; + } + } + if (ost->source_index >= 0) ist = input_streams[ost->source_index]; -- 2.7.4 _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
