Skip to content

Commit 577236a

Browse files
committed
fix(ffmpeg): ensure width is dividable by 4
1 parent 7b54c4b commit 577236a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/ffmpeg/producer/av_producer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ struct Filter
152152

153153
filter_spec += (boost::format(",bwdif=mode=send_field:parity=auto:deint=all")).str();
154154

155-
filter_spec += (boost::format(",fps=fps=%d/%d:start_time=%f") % format_desc.framerate.numerator() %
155+
// NOTE: trunc is for width % 4 == 0 or OpenGL will complain during texture uploads.
156+
filter_spec += (boost::format(",fps=fps=%d/%d:start_time=%f,scale=trunc(iw/4)*4:ih") % format_desc.framerate.numerator() %
156157
format_desc.framerate.denominator() % (static_cast<double>(start_time) / AV_TIME_BASE))
157158
.str();
158159
} else if (media_type == AVMEDIA_TYPE_AUDIO) {

0 commit comments

Comments
 (0)