ffmpeg: add option fps_mode

fps_mode sets video sync per output stream. Overrides vsync for matching
streams.

vsync is deprecated.
This commit is contained in:
Gyan Doshi
2022-06-07 17:36:54 +05:30
parent cb204f007b
commit 09c53a04c5
5 changed files with 47 additions and 21 deletions

View File

@@ -3017,11 +3017,12 @@ static int init_output_stream_encode(OutputStream *ost, AVFrame *frame)
if (!(enc_ctx->time_base.num && enc_ctx->time_base.den))
enc_ctx->time_base = av_buffersink_get_time_base(ost->filter->filter);
if ( av_q2d(enc_ctx->time_base) < 0.001 && video_sync_method != VSYNC_PASSTHROUGH
&& (video_sync_method == VSYNC_CFR || video_sync_method == VSYNC_VSCFR ||
(video_sync_method == VSYNC_AUTO && !(of->format->flags & AVFMT_VARIABLE_FPS)))){
if ( av_q2d(enc_ctx->time_base) < 0.001 && ost->vsync_method != VSYNC_PASSTHROUGH
&& (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR ||
(ost->vsync_method == VSYNC_AUTO && !(of->format->flags & AVFMT_VARIABLE_FPS)))){
av_log(oc, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n"
"Please consider specifying a lower framerate, a different muxer or -vsync 2\n");
"Please consider specifying a lower framerate, a different muxer or "
"setting vsync/fps_mode to vfr\n");
}
enc_ctx->width = av_buffersink_get_w(ost->filter->filter);