Avcodec.Audio
Audio codecs.
type 'mode t = (Avutil.audio, 'mode) codec
Main types for audio codecs.
type id = [
| `Wrapped_avframe
| `None
| `Pcm_s16le
| `Pcm_s16be
| `Pcm_u16le
| `Pcm_u16be
| `Pcm_s8
| `Pcm_u8
| `Pcm_mulaw
| `Pcm_alaw
| `Pcm_s32le
| `Pcm_s32be
| `Pcm_u32le
| `Pcm_u32be
| `Pcm_s24le
| `Pcm_s24be
| `Pcm_u24le
| `Pcm_u24be
| `Pcm_s24daud
| `Pcm_zork
| `Pcm_s16le_planar
| `Pcm_dvd
| `Pcm_f32be
| `Pcm_f32le
| `Pcm_f64be
| `Pcm_f64le
| `Pcm_bluray
| `Pcm_lxf
| `S302m
| `Pcm_s8_planar
| `Pcm_s24le_planar
| `Pcm_s32le_planar
| `Pcm_s16be_planar
| `Pcm_s64le
| `Pcm_s64be
| `Pcm_f16le
| `Pcm_f24le
| `Pcm_vidc
| `Pcm_sga
| `Adpcm_ima_qt
| `Adpcm_ima_wav
| `Adpcm_ima_dk3
| `Adpcm_ima_dk4
| `Adpcm_ima_ws
| `Adpcm_ima_smjpeg
| `Adpcm_ms
| `Adpcm_4xm
| `Adpcm_xa
| `Adpcm_adx
| `Adpcm_ea
| `Adpcm_g726
| `Adpcm_ct
| `Adpcm_swf
| `Adpcm_yamaha
| `Adpcm_sbpro_4
| `Adpcm_sbpro_3
| `Adpcm_sbpro_2
| `Adpcm_thp
| `Adpcm_ima_amv
| `Adpcm_ea_r1
| `Adpcm_ea_r3
| `Adpcm_ea_r2
| `Adpcm_ima_ea_sead
| `Adpcm_ima_ea_eacs
| `Adpcm_ea_xas
| `Adpcm_ea_maxis_xa
| `Adpcm_ima_iss
| `Adpcm_g722
| `Adpcm_ima_apc
| `Adpcm_vima
| `Adpcm_afc
| `Adpcm_ima_oki
| `Adpcm_dtk
| `Adpcm_ima_rad
| `Adpcm_g726le
| `Adpcm_thp_le
| `Adpcm_psx
| `Adpcm_aica
| `Adpcm_ima_dat4
| `Adpcm_mtaf
| `Adpcm_agm
| `Adpcm_argo
| `Adpcm_ima_ssi
| `Adpcm_zork
| `Adpcm_ima_apm
| `Adpcm_ima_alp
| `Adpcm_ima_mtf
| `Adpcm_ima_cunning
| `Adpcm_ima_moflex
| `Adpcm_ima_acorn
| `Adpcm_xmd
| `Amr_nb
| `Amr_wb
| `Ra_144
| `Ra_288
| `Roq_dpcm
| `Interplay_dpcm
| `Xan_dpcm
| `Sol_dpcm
| `Sdx2_dpcm
| `Gremlin_dpcm
| `Derf_dpcm
| `Wady_dpcm
| `Cbd2_dpcm
| `Mp2
| `Mp3
| `Aac
| `Ac3
| `Dts
| `Vorbis
| `Dvaudio
| `Wmav1
| `Wmav2
| `Mace3
| `Mace6
| `Vmdaudio
| `Flac
| `Mp3adu
| `Mp3on4
| `Shorten
| `Alac
| `Westwood_snd1
| `Gsm
| `Qdm2
| `Cook
| `Truespeech
| `Tta
| `Smackaudio
| `Qcelp
| `Wavpack
| `Dsicinaudio
| `Imc
| `Musepack7
| `Mlp
| `Gsm_ms
| `Atrac3
| `Ape
| `Nellymoser
| `Musepack8
| `Speex
| `Wmavoice
| `Wmapro
| `Wmalossless
| `Atrac3p
| `Eac3
| `Sipr
| `Mp1
| `Twinvq
| `Truehd
| `Mp4als
| `Atrac1
| `Binkaudio_rdft
| `Binkaudio_dct
| `Aac_latm
| `Qdmc
| `Celt
| `G723_1
| `G729
| `_8svx_exp
| `_8svx_fib
| `Bmv_audio
| `Ralf
| `Iac
| `Ilbc
| `Opus
| `Comfort_noise
| `Tak
| `Metasound
| `Paf_audio
| `On2avc
| `Dss_sp
| `Codec2
| `Ffwavesynth
| `Sonic
| `Sonic_ls
| `Evrc
| `Smv
| `Dsd_lsbf
| `Dsd_msbf
| `Dsd_lsbf_planar
| `Dsd_msbf_planar
| `_4gv
| `Interplay_acm
| `Xma1
| `Xma2
| `Dst
| `Atrac3al
| `Atrac3pal
| `Dolby_e
| `Aptx
| `Aptx_hd
| `Sbc
| `Atrac9
| `Hcom
| `Acelp_kelvin
| `Mpegh_3d_audio
| `Siren
| `Hca
| `Fastaudio
| `Msnsiren
| `Dfpwm
| `Bonk
| `Misc4
| `Apac
| `Ftr
| `Wavarc
| `Rka
| `Ac4
| `Osq
]
Audio codec ids. Careful: different codecs share the same ID, e.g. aac and libfdk_aac
val descriptor : id -> descriptor option
Get the codec descriptor.
val codec_ids :
[ `Wrapped_avframe
| `None
| `Pcm_s16le
| `Pcm_s16be
| `Pcm_u16le
| `Pcm_u16be
| `Pcm_s8
| `Pcm_u8
| `Pcm_mulaw
| `Pcm_alaw
| `Pcm_s32le
| `Pcm_s32be
| `Pcm_u32le
| `Pcm_u32be
| `Pcm_s24le
| `Pcm_s24be
| `Pcm_u24le
| `Pcm_u24be
| `Pcm_s24daud
| `Pcm_zork
| `Pcm_s16le_planar
| `Pcm_dvd
| `Pcm_f32be
| `Pcm_f32le
| `Pcm_f64be
| `Pcm_f64le
| `Pcm_bluray
| `Pcm_lxf
| `S302m
| `Pcm_s8_planar
| `Pcm_s24le_planar
| `Pcm_s32le_planar
| `Pcm_s16be_planar
| `Pcm_s64le
| `Pcm_s64be
| `Pcm_f16le
| `Pcm_f24le
| `Pcm_vidc
| `Pcm_sga
| `Adpcm_ima_qt
| `Adpcm_ima_wav
| `Adpcm_ima_dk3
| `Adpcm_ima_dk4
| `Adpcm_ima_ws
| `Adpcm_ima_smjpeg
| `Adpcm_ms
| `Adpcm_4xm
| `Adpcm_xa
| `Adpcm_adx
| `Adpcm_ea
| `Adpcm_g726
| `Adpcm_ct
| `Adpcm_swf
| `Adpcm_yamaha
| `Adpcm_sbpro_4
| `Adpcm_sbpro_3
| `Adpcm_sbpro_2
| `Adpcm_thp
| `Adpcm_ima_amv
| `Adpcm_ea_r1
| `Adpcm_ea_r3
| `Adpcm_ea_r2
| `Adpcm_ima_ea_sead
| `Adpcm_ima_ea_eacs
| `Adpcm_ea_xas
| `Adpcm_ea_maxis_xa
| `Adpcm_ima_iss
| `Adpcm_g722
| `Adpcm_ima_apc
| `Adpcm_vima
| `Adpcm_afc
| `Adpcm_ima_oki
| `Adpcm_dtk
| `Adpcm_ima_rad
| `Adpcm_g726le
| `Adpcm_thp_le
| `Adpcm_psx
| `Adpcm_aica
| `Adpcm_ima_dat4
| `Adpcm_mtaf
| `Adpcm_agm
| `Adpcm_argo
| `Adpcm_ima_ssi
| `Adpcm_zork
| `Adpcm_ima_apm
| `Adpcm_ima_alp
| `Adpcm_ima_mtf
| `Adpcm_ima_cunning
| `Adpcm_ima_moflex
| `Adpcm_ima_acorn
| `Adpcm_xmd
| `Amr_nb
| `Amr_wb
| `Ra_144
| `Ra_288
| `Roq_dpcm
| `Interplay_dpcm
| `Xan_dpcm
| `Sol_dpcm
| `Sdx2_dpcm
| `Gremlin_dpcm
| `Derf_dpcm
| `Wady_dpcm
| `Cbd2_dpcm
| `Mp2
| `Mp3
| `Aac
| `Ac3
| `Dts
| `Vorbis
| `Dvaudio
| `Wmav1
| `Wmav2
| `Mace3
| `Mace6
| `Vmdaudio
| `Flac
| `Mp3adu
| `Mp3on4
| `Shorten
| `Alac
| `Westwood_snd1
| `Gsm
| `Qdm2
| `Cook
| `Truespeech
| `Tta
| `Smackaudio
| `Qcelp
| `Wavpack
| `Dsicinaudio
| `Imc
| `Musepack7
| `Mlp
| `Gsm_ms
| `Atrac3
| `Ape
| `Nellymoser
| `Musepack8
| `Speex
| `Wmavoice
| `Wmapro
| `Wmalossless
| `Atrac3p
| `Eac3
| `Sipr
| `Mp1
| `Twinvq
| `Truehd
| `Mp4als
| `Atrac1
| `Binkaudio_rdft
| `Binkaudio_dct
| `Aac_latm
| `Qdmc
| `Celt
| `G723_1
| `G729
| `_8svx_exp
| `_8svx_fib
| `Bmv_audio
| `Ralf
| `Iac
| `Ilbc
| `Opus
| `Comfort_noise
| `Tak
| `Metasound
| `Paf_audio
| `On2avc
| `Dss_sp
| `Codec2
| `Ffwavesynth
| `Sonic
| `Sonic_ls
| `Evrc
| `Smv
| `Dsd_lsbf
| `Dsd_msbf
| `Dsd_lsbf_planar
| `Dsd_msbf_planar
| `_4gv
| `Interplay_acm
| `Xma1
| `Xma2
| `Dst
| `Atrac3al
| `Atrac3pal
| `Dolby_e
| `Aptx
| `Aptx_hd
| `Sbc
| `Atrac9
| `Hcom
| `Acelp_kelvin
| `Mpegh_3d_audio
| `Siren
| `Hca
| `Fastaudio
| `Msnsiren
| `Dfpwm
| `Bonk
| `Misc4
| `Apac
| `Ftr
| `Wavarc
| `Rka
| `Ac4
| `Osq ]
list
List of all audio codec IDs.
Find an encoder from its name.
Raise Error if the codec is not found or is not an audio codec.
Find an encoder from its id.
Raise Error if the codec is not found or is not an audio codec.
Find a decoder from its name.
Raise Error if the codec is not found or is not an audio codec.
Find a decoder from its id.
Raise Error if the codec is not found or is not an audio codec.
val get_supported_channel_layouts : _ t -> Avutil.Channel_layout.t list
Return the list of supported channel layouts of the codec.
val find_best_channel_layout :
_ t ->
Avutil.Channel_layout.t ->
Avutil.Channel_layout.t
Avcodec.Audio.find_best_channel_layout codec default
return the best channel layout of the codec
codec or the default
value if the codec has no channel layout.
val get_supported_sample_formats : _ t -> Avutil.Sample_format.t list
Return the list of supported sample formats of the codec.
val find_best_sample_format :
_ t ->
Avutil.Sample_format.t ->
Avutil.Sample_format.t
Avcodec.Audio.find_best_sample_format codec default
return the best sample format of the codec
codec or the default
value if the codec has no sample format.
val get_supported_sample_rates : _ t -> int list
Return the list of supported sample rates of the codec.
val find_best_sample_rate : _ t -> int -> int
Avcodec.Audio.find_best_sample_rate codec default
return the best sample rate of the codec
codec or the default
value if the codec has no sample rate.
val create_parser :
?params:Avutil.audio params ->
decode t ->
Avutil.audio Packet.parser
Avcodec.Audio.create_parser codec
create an audio packet parser.
Raise Error if the parser creation failed.
val create_decoder :
?params:Avutil.audio params ->
decode t ->
Avutil.audio decoder
Avcodec.Audio.create_decoder ~params codec
create an audio decoder.
Raise Error if the decoder creation failed.
val sample_format : Avutil.audio decoder -> Avutil.Sample_format.t
Avcodec.Audio.sample_format decoder
returns the output sample format for the given decoder.
val create_encoder :
?opts:Avutil.opts ->
channel_layout:Avutil.Channel_layout.t ->
sample_rate:int ->
sample_format:Avutil.Sample_format.t ->
time_base:Avutil.rational ->
encode t ->
Avutil.audio encoder
Avcodec.Audio.create_encoder
create an audio encoder.
Params have the same semantics as in Av.new_audio_stream
Raise Error if the encoder creation failed.
val frame_size : Avutil.audio encoder -> int
Get the desired frame_size for this encoder.
val get_name : (_, _) codec -> string
Return the name of a codec.
val get_description : (_, _) codec -> string
Return the description of a codec.
val string_of_id : id -> string
Return the name of the codec ID.
val get_params_id : Avutil.audio params -> id
Return the id of the codec params.
val get_channel_layout : Avutil.audio params -> Avutil.Channel_layout.t
Return the channel layout set for the codec params.
val get_nb_channels : Avutil.audio params -> int
Returns the number of channels set for the codec params.
val get_sample_format : Avutil.audio params -> Avutil.Sample_format.t
Returns the sample format set for the codec params.
val get_bit_rate : Avutil.audio params -> int
Returns the bit rate set for the codec params.
val get_sample_rate : Avutil.audio params -> int
Returns the sample rate set for the codec.