diff mbox series

[FFmpeg-devel] doc/ffmpeg: improve -disposition, -stats, and -progress documentation

Message ID 0FD53265-6C0B-4FE0-83CA-E820A6FA2263@gmail.com
State New
Headers show
Series [FFmpeg-devel] doc/ffmpeg: improve -disposition, -stats, and -progress documentation | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Lucz Soma Oct. 13, 2024, 1:18 p.m. UTC
-disposition:
Clarify the meaning of the default value, and how the '+' and '-'
prefixes work. Add more examples.

-stats:
Clarify that it appears as an "info"-level log.

-progress:
Add info about the "progress" key's value being "continue" or "end".
Add an example of logging to stdout.

Signed-off-by: Soma Lucz <luczsoma@gmail.com>
---
doc/ffmpeg.texi | 58 +++++++++++++++++++++++++++++++++++++------------
1 file changed, 44 insertions(+), 14 deletions(-)

Comments

Michael Niedermayer Oct. 13, 2024, 8:30 p.m. UTC | #1
On Sun, Oct 13, 2024 at 03:18:49PM +0200, Soma Lucz wrote:
> -disposition:
> Clarify the meaning of the default value, and how the '+' and '-'
> prefixes work. Add more examples.
> 
> -stats:
> Clarify that it appears as an "info"-level log.
> 
> -progress:
> Add info about the "progress" key's value being "continue" or "end".
> Add an example of logging to stdout.
> 
> Signed-off-by: Soma Lucz <luczsoma@gmail.com>
> ---
> doc/ffmpeg.texi | 58 +++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 44 insertions(+), 14 deletions(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index d11fe7c8f4..8cb48dfdf0 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -921,24 +921,25 @@ ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
> @end example
> 
> @item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
> -Sets the disposition for a stream.
> +Sets the disposition flags for a stream.

the patch lost the first column of whitespace

Applying: doc/ffmpeg: improve -disposition, -stats, and -progress documentation
error: corrupt patch at line 10
error: could not build fake ancestor
Patch failed at 0001 doc/ffmpeg: improve -disposition, -stats, and -progress documentation
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"

[...]
Anton Khirnov Oct. 15, 2024, 10:04 a.m. UTC | #2
Quoting Soma Lucz (2024-10-13 15:18:49)
> ('-' prefixes between disposition flags have no effect in this case).

This is not entirely true, you could have +foo+bar-foo that evaluates to
bar.

Otherwise looks good to me.
Lucz Soma Oct. 15, 2024, 9:01 p.m. UTC | #3
Right, thanks! I’ll remove that. Even if it were true, still a bit superfluous.

Soma

> On 2024. Oct 15., at 12:04, Anton Khirnov <anton@khirnov.net> wrote:
> 
> Quoting Soma Lucz (2024-10-13 15:18:49)
>> ('-' prefixes between disposition flags have no effect in this case).
> 
> This is not entirely true, you could have +foo+bar-foo that evaluates to
> bar.
> 
> Otherwise looks good to me.
> 
> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index d11fe7c8f4..8cb48dfdf0 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -921,24 +921,25 @@  ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
@end example

@item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
-Sets the disposition for a stream.
+Sets the disposition flags for a stream.

-By default, the disposition is copied from the input stream, unless the output
-stream this option applies to is fed by a complex filtergraph - in that case the
-disposition is unset by default.
+Default value: by default, all disposition flags are copied from the input stream,
+unless the output stream this option applies to is fed by a complex filtergraph
+- in that case no disposition flags are set by default.

-@var{value} is a sequence of items separated by '+' or '-'. The first item may
-also be prefixed with '+' or '-', in which case this option modifies the default
-value. Otherwise (the first item is not prefixed) this options overrides the
-default value. A '+' prefix adds the given disposition, '-' removes it. It is
-also possible to clear the disposition by setting it to 0.
+@var{value} is a sequence of disposition flags separated by '+' or '-'. A '+'
+prefix adds the given disposition, '-' removes it. If the first flag is also
+prefixed with '+' or '-', the resulting disposition is the default value
+updated by @var{value}. If the first flag is not prefixed, the resulting
+disposition is @var{value} ('-' prefixes between disposition flags have no effect
+in this case). It is also possible to clear the disposition by setting it to 0.

If no @code{-disposition} options were specified for an output file, ffmpeg will
-automatically set the 'default' disposition on the first stream of each type,
+automatically set the 'default' disposition flag on the first stream of each type,
when there are multiple streams of this type in the output file and no stream of
that type is already marked as default.

-The @code{-dispositions} option lists the known dispositions.
+The @code{-dispositions} option lists the known disposition flags.

For example, to make the second audio stream the default stream:
@example
@@ -956,6 +957,29 @@  To add an embedded cover/thumbnail:
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
@end example

+To add the 'original' and remove the 'comment' disposition flag from the first
+audio stream without removing its other disposition flags:
+@example
+ffmpeg -i in.mkv -c copy -disposition:a:0 +original-comment out.mkv
+@end example
+
+To remove the 'original' and add the 'comment' disposition flag to the first
+audio stream without removing its other disposition flags:
+@example
+ffmpeg -i in.mkv -c copy -disposition:a:0 -original+comment out.mkv
+@end example
+
+To set only the 'original' and 'comment' disposition flags on the first audio
+stream (and remove its other disposition flags):
+@example
+ffmpeg -i in.mkv -c copy -disposition:a:0 original+comment out.mkv
+@end example
+
+To remove all disposition flags from the first audio stream:
+@example
+ffmpeg -i in.mkv -c copy -disposition:a:0 0 out.mkv
+@end example
+
Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.

@item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
@@ -1358,8 +1382,8 @@  The default is the number of available CPUs.
Specify the preset for matching stream(s).

@item -stats (@emph{global})
-Print encoding progress/statistics. It is on by default, to explicitly
-disable it you need to specify @code{-nostats}.
+Log encoding progress/statistics as "info"-level log (see @code{-loglevel}).
+It is on by default, to explicitly disable it you need to specify @code{-nostats}.

@item -stats_period @var{time} (@emph{global})
Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
@@ -1370,10 +1394,16 @@  Send program-friendly progress information to @var{url}.
Progress information is written periodically and at the end of
the encoding process. It is made of "@var{key}=@var{value}" lines. @var{key}
consists of only alphanumeric characters. The last key of a sequence of
-progress information is always "progress".
+progress information is always "progress" with the value "continue" or "end".

The update period is set using @code{-stats_period}.

+For example, log progress information to stdout:
+
+@example
+ffmpeg -progress pipe:1 -i in.mkv out.mkv
+@end example
+
@anchor{stdin option}
@item -stdin
Enable interaction on standard input. On by default unless standard input is