Skip to content

Commit ed670b9

Browse files
committed
ffmpeg: add support for muxing AVStreamGroups
Starting with IAMF support. Signed-off-by: James Almer <[email protected]>
1 parent 556b596 commit ed670b9

File tree

4 files changed

+546
-0
lines changed

4 files changed

+546
-0
lines changed

doc/ffmpeg.texi

+200
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,206 @@ Not all muxers support embedded thumbnails, and those who do, only support a few
623623
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
624624
@var{stream}(s) to it.
625625

626+
@item -stream_group type=@var{type}:st=@var{stream}[:st=@var{stream}][:stg=@var{stream_group}][:id=@var{stream_group_id}...] (@emph{output})
627+
628+
Creates a stream group of the specified @var{type}, @var{stream_group_id} and adds the specified
629+
@var{stream}(s) and/or previously defined @var{stream_group}(s) to it.
630+
631+
@var{type} can be one of the following:
632+
@table @option
633+
634+
@item iamf_audio_element
635+
Groups @var{stream}s that belong to the same IAMF Audio Element
636+
637+
For this group @var{type}, the following options are available
638+
@table @option
639+
@item audio_element_type
640+
The Audio Element type. The following values are supported:
641+
642+
@table @option
643+
@item channel
644+
Scalable channel audio representation
645+
@item scene
646+
Ambisonics representation
647+
@end table
648+
649+
@item demixing
650+
Demixing information used to reconstruct a scalable channel audio representation.
651+
This option must be separated from the rest with a ',', and takes the following
652+
key=value options
653+
654+
@table @option
655+
@item parameter_id
656+
An identifier parameters blocks in frames may refer to
657+
@item dmixp_mode
658+
A pre-defined combination of demixing parameters
659+
@end table
660+
661+
@item recon_gain
662+
Recon gain information used to reconstruct a scalable channel audio representation.
663+
This option must be separated from the rest with a ',', and takes the following
664+
key=value options
665+
666+
@table @option
667+
@item parameter_id
668+
An identifier parameters blocks in frames may refer to
669+
@end table
670+
671+
@item layer
672+
A layer defining a Channel Layout in the Audio Element.
673+
This option must be separated from the rest with a ','. Several ',' separated entries
674+
can be defined, and at least one must be set.
675+
676+
It takes the following ":"-separated key=value options
677+
678+
@table @option
679+
@item ch_layout
680+
The layer's channel layout
681+
@item flags
682+
The following flags are available:
683+
684+
@table @option
685+
@item recon_gain
686+
Wether to signal if recon_gain is present as metadata in parameter blocks within frames
687+
@end table
688+
689+
@item output_gain
690+
@item output_gain_flags
691+
Which channels output_gain applies to. The following flags are available:
692+
693+
@table @option
694+
@item FL
695+
@item FR
696+
@item BL
697+
@item BR
698+
@item TFL
699+
@item TFR
700+
@end table
701+
702+
@item ambisonics_mode
703+
The ambisonics mode. This has no effect if audio_element_type is set to channel.
704+
705+
The following values are supported:
706+
707+
@table @option
708+
@item mono
709+
Each ambisonics channel is coded as an individual mono stream in the group
710+
@end table
711+
712+
@end table
713+
714+
@item default_w
715+
Default weight value
716+
717+
@end table
718+
719+
@item iamf_mix_presentation
720+
Groups @var{stream}s that belong to all IAMF Audio Element the same
721+
IAMF Mix Presentation references
722+
723+
For this group @var{type}, the following options are available
724+
725+
@table @option
726+
@item submix
727+
A sub-mix within the Mix Presentation.
728+
This option must be separated from the rest with a ','. Several ',' separated entries
729+
can be defined, and at least one must be set.
730+
731+
It takes the following ":"-separated key=value options
732+
733+
@table @option
734+
@item parameter_id
735+
An identifier parameters blocks in frames may refer to, for post-processing the mixed
736+
audio signal to generate the audio signal for playback
737+
@item parameter_rate
738+
The sample rate duration fields in parameters blocks in frames that refer to this
739+
@var{parameter_id} are expressed as
740+
@item default_mix_gain
741+
Default mix gain value to apply when there are no parameter blocks sharing the same
742+
@var{parameter_id} for a given frame
743+
744+
@item element
745+
References an Audio Element used in this Mix Presentation to generate the final output
746+
audio signal for playback.
747+
This option must be separated from the rest with a '|'. Several '|' separated entries
748+
can be defined, and at least one must be set.
749+
750+
It takes the following ":"-separated key=value options:
751+
752+
@table @option
753+
@item stg
754+
The @var{stream_group_id} for an Audio Element which this sub-mix refers to
755+
@item parameter_id
756+
An identifier parameters blocks in frames may refer to, for applying any processing to
757+
the referenced and rendered Audio Element before being summed with other processed Audio
758+
Elements
759+
@item parameter_rate
760+
The sample rate duration fields in parameters blocks in frames that refer to this
761+
@var{parameter_id} are expressed as
762+
@item default_mix_gain
763+
Default mix gain value to apply when there are no parameter blocks sharing the same
764+
@var{parameter_id} for a given frame
765+
@item annotations
766+
A key=value string describing the sub-mix element where "key" is a string conforming to
767+
BCP-47 that specifies the language for the "value" string. "key" must be the same as the
768+
one in the mix's @var{annotations}
769+
@item headphones_rendering_mode
770+
Indicates whether the input channel-based Audio Element is rendered to stereo loudspeakers
771+
or spatialized with a binaural renderer when played back on headphones.
772+
This has no effect if the referenced Audio Element's @var{audio_element_type} is set to
773+
channel.
774+
775+
The following values are supported:
776+
777+
@table @option
778+
@item stereo
779+
@item binaural
780+
@end table
781+
782+
@end table
783+
784+
@item layout
785+
Specifies the layouts for this sub-mix on which the loudness information was measured.
786+
This option must be separated from the rest with a '|'. Several '|' separated entries
787+
can be defined, and at least one must be set.
788+
789+
It takes the following ":"-separated key=value options:
790+
791+
@table @option
792+
@item layout_type
793+
794+
@table @option
795+
@item loudspeakers
796+
The layout follows the loudspeaker sound system convention of ITU-2051-3.
797+
@item binaural
798+
The layout is binaural.
799+
@end table
800+
801+
@item sound_system
802+
Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2 and 3.1.2
803+
This has no effect if @var{layout_type} is set to binaural.
804+
@item integrated_loudness
805+
The program integrated loudness information, as defined in ITU-1770-4.
806+
@item digital_peak
807+
The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
808+
@item true_peak
809+
The true peak of the audio signal, as defined in ITU-1770-4.
810+
@item dialog_anchored_loudness
811+
The Dialogue loudness information, as defined in ITU-1770-4.
812+
@item album_anchored_loudness
813+
The Album loudness information, as defined in ITU-1770-4.
814+
@end table
815+
816+
@end table
817+
818+
@item annotations
819+
A key=value string string describing the mix where "key" is a string conforming to BCP-47
820+
that specifies the language for the "value" string. "key" must be the same as the ones in
821+
all sub-mix element's @var{annotations}s
822+
@end table
823+
824+
@end table
825+
626826
@item -target @var{type} (@emph{output})
627827
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
628828
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or

fftools/ffmpeg.h

+2
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ typedef struct OptionsContext {
284284
int nb_disposition;
285285
SpecifierOpt *program;
286286
int nb_program;
287+
SpecifierOpt *stream_groups;
288+
int nb_stream_groups;
287289
SpecifierOpt *time_bases;
288290
int nb_time_bases;
289291
SpecifierOpt *enc_time_bases;

0 commit comments

Comments
 (0)