From 577236ab81ae65a6a67a495b9ba4438c0448b09a Mon Sep 17 00:00:00 2001 From: ronag Date: Wed, 18 Jul 2018 12:16:49 +0200 Subject: [PATCH] fix(ffmpeg): ensure width is dividable by 4 --- src/modules/ffmpeg/producer/av_producer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/ffmpeg/producer/av_producer.cpp b/src/modules/ffmpeg/producer/av_producer.cpp index b04129adab..06f3560c87 100644 --- a/src/modules/ffmpeg/producer/av_producer.cpp +++ b/src/modules/ffmpeg/producer/av_producer.cpp @@ -152,7 +152,8 @@ struct Filter filter_spec += (boost::format(",bwdif=mode=send_field:parity=auto:deint=all")).str(); - filter_spec += (boost::format(",fps=fps=%d/%d:start_time=%f") % format_desc.framerate.numerator() % + // NOTE: trunc is for width % 4 == 0 or OpenGL will complain during texture uploads. + filter_spec += (boost::format(",fps=fps=%d/%d:start_time=%f,scale=trunc(iw/4)*4:ih") % format_desc.framerate.numerator() % format_desc.framerate.denominator() % (static_cast(start_time) / AV_TIME_BASE)) .str(); } else if (media_type == AVMEDIA_TYPE_AUDIO) {