@@ -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];
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 <linjie.fu@intel.com> --- fftools/ffmpeg.c | 9 +++++++++ 1 file changed, 9 insertions(+)