Skip to content

Commit

Permalink
fix(ffmpeg): ensure width is dividable by 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Jul 18, 2018
1 parent 7b54c4b commit 577236a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/ffmpeg/producer/av_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>(start_time) / AV_TIME_BASE))
.str();
} else if (media_type == AVMEDIA_TYPE_AUDIO) {
Expand Down

0 comments on commit 577236a

Please sign in to comment.