History

doc/ffmpeg: document value source for -force_key_frames

Also clarify behaviour in case of specified timestamps

Gyan Doshi committed 7 years ago

Commit fa677751 parent c3a17ff1 file · +23 −5Browse files

Unified · Split

doc/ffmpeg.texi+23−5
@@ -879,12 +879,19 @@ Deprecated see -bsf · 878 unmodified lines
879 879
880@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})880@item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
881@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})881@item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
882Force key frames at the specified timestamps, more precisely at the first882@item -force_key_frames[:@var{stream_specifier}] source (@emph{output,per-stream})
883frames after each specified time.
884 883
885If the argument is prefixed with @code{expr:}, the string @var{expr}884@var{force_key_frames} can take arguments of the following form:
886is interpreted like an expression and is evaluated for each frame. A885
887key frame is forced in case the evaluation is non-zero.886@table @option
887
888@item @var{time}[,@var{time}...]
889If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
890output timestamp as per the encoder time base and force a keyframe at the first frame having
891timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
892coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
893The default encoder time base is the inverse of the output framerate but may be set otherwise
894via @code{-enc_time_base}.
888 895
889If one of the times is "@code{chapters}[@var{delta}]", it is expanded into896If one of the times is "@code{chapters}[@var{delta}]", it is expanded into
890the time of the beginning of all chapters in the file, shifted by897the time of the beginning of all chapters in the file, shifted by
@@ -898,6 +905,11 @@ before the beginning of every chapter: · 7 unmodified lines
898-force_key_frames 0:05:00,chapters-0.1905-force_key_frames 0:05:00,chapters-0.1
899@end example906@end example
900 907
908@item expr:@var{expr}
909If the argument is prefixed with @code{expr:}, the string @var{expr}
910is interpreted like an expression and is evaluated for each frame. A
911key frame is forced in case the evaluation is non-zero.
912
901The expression in @var{expr} can contain the following constants:913The expression in @var{expr} can contain the following constants:
902@table @option914@table @option
903@item n915@item n
@@ -925,6 +937,12 @@ starting from second 13: · 21 unmodified lines
925-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))937-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
926@end example938@end example
927 939
940@item source
941If the argument is @code{source}, ffmpeg will force a key frame if
942the current frame being encoded is marked as a key frame in its source.
943
944@end table
945
928Note that forcing too many keyframes is very harmful for the lookahead946Note that forcing too many keyframes is very harmful for the lookahead
929algorithms of certain encoders: using fixed-GOP options or similar947algorithms of certain encoders: using fixed-GOP options or similar
930would be more efficient.948would be more efficient.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t