package ffmpeg-avcodec

  1. Overview
  2. Docs

Audio codecs.

type 'mode t = (Avutil.audio, 'mode) codec

Main types for audio codecs.

type id = [
  1. | `Wrapped_avframe
  2. | `None
  3. | `Pcm_s16le
  4. | `Pcm_s16be
  5. | `Pcm_u16le
  6. | `Pcm_u16be
  7. | `Pcm_s8
  8. | `Pcm_u8
  9. | `Pcm_mulaw
  10. | `Pcm_alaw
  11. | `Pcm_s32le
  12. | `Pcm_s32be
  13. | `Pcm_u32le
  14. | `Pcm_u32be
  15. | `Pcm_s24le
  16. | `Pcm_s24be
  17. | `Pcm_u24le
  18. | `Pcm_u24be
  19. | `Pcm_s24daud
  20. | `Pcm_zork
  21. | `Pcm_s16le_planar
  22. | `Pcm_dvd
  23. | `Pcm_f32be
  24. | `Pcm_f32le
  25. | `Pcm_f64be
  26. | `Pcm_f64le
  27. | `Pcm_bluray
  28. | `Pcm_lxf
  29. | `S302m
  30. | `Pcm_s8_planar
  31. | `Pcm_s24le_planar
  32. | `Pcm_s32le_planar
  33. | `Pcm_s16be_planar
  34. | `Pcm_s64le
  35. | `Pcm_s64be
  36. | `Pcm_f16le
  37. | `Pcm_f24le
  38. | `Pcm_vidc
  39. | `Pcm_sga
  40. | `Adpcm_ima_qt
  41. | `Adpcm_ima_wav
  42. | `Adpcm_ima_dk3
  43. | `Adpcm_ima_dk4
  44. | `Adpcm_ima_ws
  45. | `Adpcm_ima_smjpeg
  46. | `Adpcm_ms
  47. | `Adpcm_4xm
  48. | `Adpcm_xa
  49. | `Adpcm_adx
  50. | `Adpcm_ea
  51. | `Adpcm_g726
  52. | `Adpcm_ct
  53. | `Adpcm_swf
  54. | `Adpcm_yamaha
  55. | `Adpcm_sbpro_4
  56. | `Adpcm_sbpro_3
  57. | `Adpcm_sbpro_2
  58. | `Adpcm_thp
  59. | `Adpcm_ima_amv
  60. | `Adpcm_ea_r1
  61. | `Adpcm_ea_r3
  62. | `Adpcm_ea_r2
  63. | `Adpcm_ima_ea_sead
  64. | `Adpcm_ima_ea_eacs
  65. | `Adpcm_ea_xas
  66. | `Adpcm_ea_maxis_xa
  67. | `Adpcm_ima_iss
  68. | `Adpcm_g722
  69. | `Adpcm_ima_apc
  70. | `Adpcm_vima
  71. | `Adpcm_afc
  72. | `Adpcm_ima_oki
  73. | `Adpcm_dtk
  74. | `Adpcm_ima_rad
  75. | `Adpcm_g726le
  76. | `Adpcm_thp_le
  77. | `Adpcm_psx
  78. | `Adpcm_aica
  79. | `Adpcm_ima_dat4
  80. | `Adpcm_mtaf
  81. | `Adpcm_agm
  82. | `Adpcm_argo
  83. | `Adpcm_ima_ssi
  84. | `Adpcm_zork
  85. | `Adpcm_ima_apm
  86. | `Adpcm_ima_alp
  87. | `Adpcm_ima_mtf
  88. | `Adpcm_ima_cunning
  89. | `Adpcm_ima_moflex
  90. | `Adpcm_ima_acorn
  91. | `Amr_nb
  92. | `Amr_wb
  93. | `Ra_144
  94. | `Ra_288
  95. | `Roq_dpcm
  96. | `Interplay_dpcm
  97. | `Xan_dpcm
  98. | `Sol_dpcm
  99. | `Sdx2_dpcm
  100. | `Gremlin_dpcm
  101. | `Derf_dpcm
  102. | `Mp2
  103. | `Mp3
  104. | `Aac
  105. | `Ac3
  106. | `Dts
  107. | `Vorbis
  108. | `Dvaudio
  109. | `Wmav1
  110. | `Wmav2
  111. | `Mace3
  112. | `Mace6
  113. | `Vmdaudio
  114. | `Flac
  115. | `Mp3adu
  116. | `Mp3on4
  117. | `Shorten
  118. | `Alac
  119. | `Westwood_snd1
  120. | `Gsm
  121. | `Qdm2
  122. | `Cook
  123. | `Truespeech
  124. | `Tta
  125. | `Smackaudio
  126. | `Qcelp
  127. | `Wavpack
  128. | `Dsicinaudio
  129. | `Imc
  130. | `Musepack7
  131. | `Mlp
  132. | `Gsm_ms
  133. | `Atrac3
  134. | `Ape
  135. | `Nellymoser
  136. | `Musepack8
  137. | `Speex
  138. | `Wmavoice
  139. | `Wmapro
  140. | `Wmalossless
  141. | `Atrac3p
  142. | `Eac3
  143. | `Sipr
  144. | `Mp1
  145. | `Twinvq
  146. | `Truehd
  147. | `Mp4als
  148. | `Atrac1
  149. | `Binkaudio_rdft
  150. | `Binkaudio_dct
  151. | `Aac_latm
  152. | `Qdmc
  153. | `Celt
  154. | `G723_1
  155. | `G729
  156. | `_8svx_exp
  157. | `_8svx_fib
  158. | `Bmv_audio
  159. | `Ralf
  160. | `Iac
  161. | `Ilbc
  162. | `Opus
  163. | `Comfort_noise
  164. | `Tak
  165. | `Metasound
  166. | `Paf_audio
  167. | `On2avc
  168. | `Dss_sp
  169. | `Codec2
  170. | `Ffwavesynth
  171. | `Sonic
  172. | `Sonic_ls
  173. | `Evrc
  174. | `Smv
  175. | `Dsd_lsbf
  176. | `Dsd_msbf
  177. | `Dsd_lsbf_planar
  178. | `Dsd_msbf_planar
  179. | `_4gv
  180. | `Interplay_acm
  181. | `Xma1
  182. | `Xma2
  183. | `Dst
  184. | `Atrac3al
  185. | `Atrac3pal
  186. | `Dolby_e
  187. | `Aptx
  188. | `Aptx_hd
  189. | `Sbc
  190. | `Atrac9
  191. | `Hcom
  192. | `Acelp_kelvin
  193. | `Mpegh_3d_audio
  194. | `Siren
  195. | `Hca
  196. | `Fastaudio
  197. | `Msnsiren
  198. | `Dfpwm
]

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 | `Amr_nb | `Amr_wb | `Ra_144 | `Ra_288 | `Roq_dpcm | `Interplay_dpcm | `Xan_dpcm | `Sol_dpcm | `Sdx2_dpcm | `Gremlin_dpcm | `Derf_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 ] list

List of all audio codec IDs.

val encoders : encode t list

List of all available audio encoders.

val decoders : decode t list

List of all available audio decoders.

val find_encoder_by_name : string -> encode t

Find an encoder from its name.

Raise Error if the codec is not found or is not an audio codec.

val find_encoder : id -> encode t

Find an encoder from its id.

Raise Error if the codec is not found or is not an audio codec.

val find_decoder_by_name : string -> decode t

Find a decoder from its name.

Raise Error if the codec is not found or is not an audio codec.

val find_decoder : id -> decode t

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.

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_id : _ t -> id

Return the ID (class) of a codec.

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.

OCaml

Innovation. Community. Security.