Avcodec.AudioAudio codecs: lookup, supported configurations, decoders, encoders and the audio fields of codec parameters.
type 'mode t = (Avutil.audio, 'mode) codecAn audio codec.
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| `Adpcm_ima_xbox| `Adpcm_sanyo| `Adpcm_ima_hvqm4| `Adpcm_ima_pda| `Adpcm_n64| `Adpcm_ima_hvqm2| `Adpcm_ima_magix| `Adpcm_psxc| `Adpcm_circus| `Adpcm_ima_escape| `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| `Qoa| `Lc3| `G728| `Ahx| `Apple_apac ]The identifier of an audio format, FFmpeg's AV_CODEC_ID_* values of the audio family. An identifier names a format; several codecs may implement the same one.
val descriptor : id -> descriptor optiondescriptor id is FFmpeg's descriptor of the format, None when FFmpeg has none for it. Every text of the result is a copy.
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
| `Adpcm_ima_xbox
| `Adpcm_sanyo
| `Adpcm_ima_hvqm4
| `Adpcm_ima_pda
| `Adpcm_n64
| `Adpcm_ima_hvqm2
| `Adpcm_ima_magix
| `Adpcm_psxc
| `Adpcm_circus
| `Adpcm_ima_escape
| `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
| `Qoa
| `Lc3
| `G728
| `Ahx
| `Apple_apac ]
listEvery audio identifier the bindings know.
find_encoder_by_name name is the audio encoder FFmpeg registers under name, for example "libmp3lame".
find_decoder_by_name name is the audio decoder FFmpeg registers under name.
val get_supported_channel_layouts : _ t -> Avutil.Channel_layout.t listget_supported_channel_layouts codec is the list of the channel layouts the codec declares it supports, in the codec's order. Each layout is an independent copy. The empty list means the codec declares none, which FFmpeg uses for a codec with no restriction.
val get_supported_sample_formats : _ t -> Avutil.Sample_format.t listget_supported_sample_formats codec is the list of the sample formats the codec declares it supports, in the codec's order. The empty list means the codec declares none. A format the bindings have no constructor for is left out.
val get_supported_sample_rates : _ t -> int listget_supported_sample_rates codec is the list of the sample rates, in Hz, the codec declares it supports, in the codec's order. The empty list means the codec declares none.
val find_best_channel_layout :
_ t ->
Avutil.Channel_layout.t ->
Avutil.Channel_layout.tfind_best_channel_layout codec default is a channel layout the codec supports, default when possible. It is default when the codec declares no layout or declares one equal to it under Avutil.Channel_layout.compare. Otherwise it is the first layout the codec declares.
val find_best_sample_format :
_ t ->
Avutil.Sample_format.t ->
Avutil.Sample_format.tfind_best_sample_format codec default is default when the codec declares no sample format or declares default. Otherwise it is the first sample format the codec declares.
val find_best_sample_rate : _ t -> int -> intfind_best_sample_rate codec default is default when the codec declares no sample rate or declares default. Otherwise it is the first sample rate the codec declares.
val create_decoder :
?params:Avutil.audio params ->
decode t ->
Avutil.audio decodercreate_decoder ?params codec allocates a decoder for codec and opens it. The decoder decodes in software and takes no option. FFmpeg chooses its number of threads.
Opening releases the OCaml runtime lock: other OCaml threads run meanwhile. On failure everything allocated is released.
val sample_format : Avutil.audio decoder -> Avutil.Sample_format.tsample_format decoder is the sample format of the frames the decoder currently produces.
val create_encoder :
?opts:Avutil.opts ->
?side_data:Avutil.Frame_side_data.raw list ->
channel_layout:Avutil.Channel_layout.t ->
sample_rate:int ->
sample_format:Avutil.Sample_format.t ->
time_base:Avutil.rational ->
encode t ->
Avutil.audio encodercreate_encoder ?opts ~channel_layout ~sample_rate ~sample_format ~time_base codec allocates an encoder for codec, sets the four typed arguments on it, and opens it with the entries of opts.
Opening releases the OCaml runtime lock: other OCaml threads run meanwhile. On failure everything allocated is released and opts is untouched.
val frame_size : Avutil.audio encoder -> intframe_size encoder is the number of samples per channel the encoder wants in each frame given to Avcodec.encode. It is 0 for an encoder that accepts frames of any size.
val get_name : (_, _) codec -> stringget_name codec is the codec's name, as Avcodec.name.
val get_description : (_, _) codec -> stringget_description codec is the codec's descriptive name, the empty string when FFmpeg gives none.
val string_of_id : id -> stringstring_of_id id is FFmpeg's name of the format, for example "mp3".
val get_params_id : Avutil.audio params -> idget_params_id params is the codec identifier of the parameters.
val get_channel_layout : Avutil.audio params -> Avutil.Channel_layout.tget_channel_layout params is an independent copy of the channel layout of the stream.
val get_nb_channels : Avutil.audio params -> intget_nb_channels params is the number of channels of the stream's channel layout.
val get_sample_format : Avutil.audio params -> Avutil.Sample_format.tget_sample_format params is the sample format of the stream.
val get_bit_rate : Avutil.audio params -> intget_bit_rate params is the average bit rate of the encoded stream, in bits per second.
val get_sample_rate : Avutil.audio params -> intget_sample_rate params is the sample rate of the stream, in Hz.
val get_initial_padding : Avutil.audio params -> intget_initial_padding params is the number of priming samples per channel the encoder puts before the first input sample; 0 when unset.