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
879879
880880 @item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
881881 @item -force_key_frames[:@var{stream_specifier}] expr:@var{expr} (@emph{output,per-stream})
882−Force key frames at the specified timestamps, more precisely at the first
883−frames after each specified time.
882+@item -force_key_frames[:@var{stream_specifier}] source (@emph{output,per-stream})
884883
885−If the argument is prefixed with @code{expr:}, the string @var{expr}
886−is interpreted like an expression and is evaluated for each frame. A
887−key frame is forced in case the evaluation is non-zero.
884+@var{force_key_frames} can take arguments of the following form:
885+
886+@table @option
887+
888+@item @var{time}[,@var{time}...]
889+If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
890+output timestamp as per the encoder time base and force a keyframe at the first frame having
891+timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
892+coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
893+The default encoder time base is the inverse of the output framerate but may be set otherwise
894+via @code{-enc_time_base}.
888895
889896 If one of the times is "@code{chapters}[@var{delta}]", it is expanded into
890897 the 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
898905 -force_key_frames 0:05:00,chapters-0.1
899906 @end example
900907
908+@item expr:@var{expr}
909+If the argument is prefixed with @code{expr:}, the string @var{expr}
910+is interpreted like an expression and is evaluated for each frame. A
911+key frame is forced in case the evaluation is non-zero.
912+
901913 The expression in @var{expr} can contain the following constants:
902914 @table @option
903915 @item n
@@ -925,6 +937,12 @@ starting from second 13: · 21 unmodified lines
925937 -force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
926938 @end example
927939
940+@item source
941+If the argument is @code{source}, ffmpeg will force a key frame if
942+the current frame being encoded is marked as a key frame in its source.
943+
944+@end table
945+
928946 Note that forcing too many keyframes is very harmful for the lookahead
929947 algorithms of certain encoders: using fixed-GOP options or similar
930948 would 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