[FFmpeg-devel] [PATCH 19/23] fftools/ffmpeg: add support for multiview video

James Almer jamrial at gmail.com
Mon Sep 16 00:54:27 EEST 2024


On 9/14/2024 7:45 AM, Anton Khirnov wrote:
> This extends the syntax for specifying input streams in -map and complex
> filtergraph labels, to allow selecting a view by view ID, index, or
> position. The corresponding decoder is then set up to decode the
> appropriate view and send frames for that view to the correct
> filtergraph input(s).
> ---
>   doc/ffmpeg.texi           |  30 ++-
>   fftools/cmdutils.c        |   2 +-
>   fftools/cmdutils.h        |   2 +
>   fftools/ffmpeg.h          |  45 ++++-
>   fftools/ffmpeg_dec.c      | 387 +++++++++++++++++++++++++++++++++++++-
>   fftools/ffmpeg_demux.c    |  24 ++-
>   fftools/ffmpeg_filter.c   |  71 ++++---
>   fftools/ffmpeg_mux_init.c |  34 ++--
>   fftools/ffmpeg_opt.c      |  70 ++++++-
>   9 files changed, 610 insertions(+), 55 deletions(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 842e92ad1a..34007f7ea2 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -1799,7 +1799,7 @@ Set the size of the canvas used to render subtitles.
>   @section Advanced options
>   
>   @table @option
> - at item -map [-]@var{input_file_id}[:@var{stream_specifier}][?] | @var{[linklabel]} (@emph{output})
> + at item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][?] | @var{[linklabel]} (@emph{output})
>   
>   Create one or more streams in the output file. This option has two forms for
>   specifying the data source(s): the first selects one or more streams from some
> @@ -1814,6 +1814,26 @@ only those streams that match the specifier are used (see the
>   A @code{-} character before the stream identifier creates a "negative" mapping.
>   It disables matching streams from already created mappings.
>   
> +An optional @var{view_specifier} may be given after the stream specifier, which
> +for multiview video specifies the view to be used. The view specifier may have
> +one of the following formats:
> + at table @option
> + at item view:@var{view_id}
> +select a view by its ID; @var{view_id} may be set to 'all' to use all the views
> +interleaved into one stream;
> +
> + at item vidx:@var{view_idx}
> +select a view by its index; i.e. 0 is the base view, 1 is the first non-base
> +view, etc.

I tried

./ffmpeg -i ../build/multiview.mov -map 0:v:view:1 -an -sn -f null -

and

./ffmpeg -i ../build/multiview.mov -map 0:v:vidx:1 -an -sn -f null -

with multiview.mov and in both cases both views are output. Am i missing 
something? I recall this working before.
view:0 and vidx:0 work the same as not setting any map (Just the base 
view is output), which is intended.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240915/8af68d54/attachment.sig>


More information about the ffmpeg-devel mailing list