package ffmpeg-avcodec

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Audio codecs.

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

Main types for audio codecs.

type id = [
  1. | `None
  2. | `Mpeg1video
  3. | `Mpeg2video
  4. | `H261
  5. | `H263
  6. | `Rv10
  7. | `Rv20
  8. | `Mjpeg
  9. | `Mjpegb
  10. | `Ljpeg
  11. | `Sp5x
  12. | `Jpegls
  13. | `Mpeg4
  14. | `Rawvideo
  15. | `Msmpeg4v1
  16. | `Msmpeg4v2
  17. | `Msmpeg4v3
  18. | `Wmv1
  19. | `Wmv2
  20. | `H263p
  21. | `H263i
  22. | `Flv1
  23. | `Svq1
  24. | `Svq3
  25. | `Dvvideo
  26. | `Huffyuv
  27. | `Cyuv
  28. | `H264
  29. | `Indeo3
  30. | `Vp3
  31. | `Theora
  32. | `Asv1
  33. | `Asv2
  34. | `Ffv1
  35. | `_4xm
  36. | `Vcr1
  37. | `Cljr
  38. | `Mdec
  39. | `Roq
  40. | `Interplay_video
  41. | `Xan_wc3
  42. | `Xan_wc4
  43. | `Rpza
  44. | `Cinepak
  45. | `Ws_vqa
  46. | `Msrle
  47. | `Msvideo1
  48. | `Idcin
  49. | `_8bps
  50. | `Smc
  51. | `Flic
  52. | `Truemotion1
  53. | `Vmdvideo
  54. | `Mszh
  55. | `Zlib
  56. | `Qtrle
  57. | `Tscc
  58. | `Ulti
  59. | `Qdraw
  60. | `Vixl
  61. | `Qpeg
  62. | `Png
  63. | `Ppm
  64. | `Pbm
  65. | `Pgm
  66. | `Pgmyuv
  67. | `Pam
  68. | `Ffvhuff
  69. | `Rv30
  70. | `Rv40
  71. | `Vc1
  72. | `Wmv3
  73. | `Loco
  74. | `Wnv1
  75. | `Aasc
  76. | `Indeo2
  77. | `Fraps
  78. | `Truemotion2
  79. | `Bmp
  80. | `Cscd
  81. | `Mmvideo
  82. | `Zmbv
  83. | `Avs
  84. | `Smackvideo
  85. | `Nuv
  86. | `Kmvc
  87. | `Flashsv
  88. | `Cavs
  89. | `Jpeg2000
  90. | `Vmnc
  91. | `Vp5
  92. | `Vp6
  93. | `Vp6f
  94. | `Targa
  95. | `Dsicinvideo
  96. | `Tiertexseqvideo
  97. | `Tiff
  98. | `Gif
  99. | `Dxa
  100. | `Dnxhd
  101. | `Thp
  102. | `Sgi
  103. | `C93
  104. | `Bethsoftvid
  105. | `Ptx
  106. | `Txd
  107. | `Vp6a
  108. | `Amv
  109. | `Vb
  110. | `Pcx
  111. | `Sunrast
  112. | `Indeo4
  113. | `Indeo5
  114. | `Mimic
  115. | `Rl2
  116. | `Escape124
  117. | `Dirac
  118. | `Bfi
  119. | `Cmv
  120. | `Motionpixels
  121. | `Tgv
  122. | `Tgq
  123. | `Tqi
  124. | `Aura
  125. | `Aura2
  126. | `V210x
  127. | `Tmv
  128. | `V210
  129. | `Dpx
  130. | `Mad
  131. | `Frwu
  132. | `Flashsv2
  133. | `Cdgraphics
  134. | `R210
  135. | `Anm
  136. | `Binkvideo
  137. | `Iff_ilbm
  138. | `Kgv1
  139. | `Yop
  140. | `Vp8
  141. | `Pictor
  142. | `Ansi
  143. | `A64_multi
  144. | `A64_multi5
  145. | `R10k
  146. | `Mxpeg
  147. | `Lagarith
  148. | `Prores
  149. | `Jv
  150. | `Dfa
  151. | `Wmv3image
  152. | `Vc1image
  153. | `Utvideo
  154. | `Bmv_video
  155. | `Vble
  156. | `Dxtory
  157. | `V410
  158. | `Xwd
  159. | `Cdxl
  160. | `Xbm
  161. | `Zerocodec
  162. | `Mss1
  163. | `Msa1
  164. | `Tscc2
  165. | `Mts2
  166. | `Cllc
  167. | `Mss2
  168. | `Vp9
  169. | `Aic
  170. | `Escape130
  171. | `G2m
  172. | `Webp
  173. | `Hnm4_video
  174. | `Hevc
  175. | `Fic
  176. | `Alias_pix
  177. | `Brender_pix
  178. | `Paf_video
  179. | `Exr
  180. | `Vp7
  181. | `Sanm
  182. | `Sgirle
  183. | `Mvc1
  184. | `Mvc2
  185. | `Hqx
  186. | `Tdsc
  187. | `Hq_hqa
  188. | `Hap
  189. | `Dds
  190. | `Dxv
  191. | `Screenpresso
  192. | `Rscc
  193. | `Avs2
  194. | `Pgx
  195. | `Avs3
  196. | `Msp2
  197. | `Vvc
  198. | `Y41p
  199. | `Avrp
  200. | `_012v
  201. | `Avui
  202. | `Ayuv
  203. | `Targa_y216
  204. | `V308
  205. | `V408
  206. | `Yuv4
  207. | `Avrn
  208. | `Cpia
  209. | `Xface
  210. | `Snow
  211. | `Smvjpeg
  212. | `Apng
  213. | `Daala
  214. | `Cfhd
  215. | `Truemotion2rt
  216. | `M101
  217. | `Magicyuv
  218. | `Sheervideo
  219. | `Ylc
  220. | `Psd
  221. | `Pixlet
  222. | `Speedhq
  223. | `Fmvc
  224. | `Scpr
  225. | `Clearvideo
  226. | `Xpm
  227. | `Av1
  228. | `Bitpacked
  229. | `Mscc
  230. | `Srgc
  231. | `Svg
  232. | `Gdv
  233. | `Fits
  234. | `Imm4
  235. | `Prosumer
  236. | `Mwsc
  237. | `Wcmv
  238. | `Rasc
  239. | `Hymt
  240. | `Arbc
  241. | `Agm
  242. | `Lscr
  243. | `Vp4
  244. | `Imm5
  245. | `Mvdv
  246. | `Mvha
  247. | `Cdtoons
  248. | `Mv30
  249. | `Notchlc
  250. | `Pfm
  251. | `Mobiclip
  252. | `Photocd
  253. | `Ipu
  254. | `Argo
  255. | `Cri
  256. | `Simbiosis_imx
  257. | `Sga_video
  258. | `Gem
  259. | `Vbn
  260. | `Jpegxl
  261. | `Qoi
  262. | `Phm
  263. | `First_audio
  264. | `Pcm_s16le
  265. | `Pcm_s16be
  266. | `Pcm_u16le
  267. | `Pcm_u16be
  268. | `Pcm_s8
  269. | `Pcm_u8
  270. | `Pcm_mulaw
  271. | `Pcm_alaw
  272. | `Pcm_s32le
  273. | `Pcm_s32be
  274. | `Pcm_u32le
  275. | `Pcm_u32be
  276. | `Pcm_s24le
  277. | `Pcm_s24be
  278. | `Pcm_u24le
  279. | `Pcm_u24be
  280. | `Pcm_s24daud
  281. | `Pcm_zork
  282. | `Pcm_s16le_planar
  283. | `Pcm_dvd
  284. | `Pcm_f32be
  285. | `Pcm_f32le
  286. | `Pcm_f64be
  287. | `Pcm_f64le
  288. | `Pcm_bluray
  289. | `Pcm_lxf
  290. | `S302m
  291. | `Pcm_s8_planar
  292. | `Pcm_s24le_planar
  293. | `Pcm_s32le_planar
  294. | `Pcm_s16be_planar
  295. | `Pcm_s64le
  296. | `Pcm_s64be
  297. | `Pcm_f16le
  298. | `Pcm_f24le
  299. | `Pcm_vidc
  300. | `Pcm_sga
  301. | `Adpcm_ima_qt
  302. | `Adpcm_ima_wav
  303. | `Adpcm_ima_dk3
  304. | `Adpcm_ima_dk4
  305. | `Adpcm_ima_ws
  306. | `Adpcm_ima_smjpeg
  307. | `Adpcm_ms
  308. | `Adpcm_4xm
  309. | `Adpcm_xa
  310. | `Adpcm_adx
  311. | `Adpcm_ea
  312. | `Adpcm_g726
  313. | `Adpcm_ct
  314. | `Adpcm_swf
  315. | `Adpcm_yamaha
  316. | `Adpcm_sbpro_4
  317. | `Adpcm_sbpro_3
  318. | `Adpcm_sbpro_2
  319. | `Adpcm_thp
  320. | `Adpcm_ima_amv
  321. | `Adpcm_ea_r1
  322. | `Adpcm_ea_r3
  323. | `Adpcm_ea_r2
  324. | `Adpcm_ima_ea_sead
  325. | `Adpcm_ima_ea_eacs
  326. | `Adpcm_ea_xas
  327. | `Adpcm_ea_maxis_xa
  328. | `Adpcm_ima_iss
  329. | `Adpcm_g722
  330. | `Adpcm_ima_apc
  331. | `Adpcm_vima
  332. | `Adpcm_afc
  333. | `Adpcm_ima_oki
  334. | `Adpcm_dtk
  335. | `Adpcm_ima_rad
  336. | `Adpcm_g726le
  337. | `Adpcm_thp_le
  338. | `Adpcm_psx
  339. | `Adpcm_aica
  340. | `Adpcm_ima_dat4
  341. | `Adpcm_mtaf
  342. | `Adpcm_agm
  343. | `Adpcm_argo
  344. | `Adpcm_ima_ssi
  345. | `Adpcm_zork
  346. | `Adpcm_ima_apm
  347. | `Adpcm_ima_alp
  348. | `Adpcm_ima_mtf
  349. | `Adpcm_ima_cunning
  350. | `Adpcm_ima_moflex
  351. | `Adpcm_ima_acorn
  352. | `Amr_nb
  353. | `Amr_wb
  354. | `Ra_144
  355. | `Ra_288
  356. | `Roq_dpcm
  357. | `Interplay_dpcm
  358. | `Xan_dpcm
  359. | `Sol_dpcm
  360. | `Sdx2_dpcm
  361. | `Gremlin_dpcm
  362. | `Derf_dpcm
  363. | `Mp2
  364. | `Mp3
  365. | `Aac
  366. | `Ac3
  367. | `Dts
  368. | `Vorbis
  369. | `Dvaudio
  370. | `Wmav1
  371. | `Wmav2
  372. | `Mace3
  373. | `Mace6
  374. | `Vmdaudio
  375. | `Flac
  376. | `Mp3adu
  377. | `Mp3on4
  378. | `Shorten
  379. | `Alac
  380. | `Westwood_snd1
  381. | `Gsm
  382. | `Qdm2
  383. | `Cook
  384. | `Truespeech
  385. | `Tta
  386. | `Smackaudio
  387. | `Qcelp
  388. | `Wavpack
  389. | `Dsicinaudio
  390. | `Imc
  391. | `Musepack7
  392. | `Mlp
  393. | `Gsm_ms
  394. | `Atrac3
  395. | `Ape
  396. | `Nellymoser
  397. | `Musepack8
  398. | `Speex
  399. | `Wmavoice
  400. | `Wmapro
  401. | `Wmalossless
  402. | `Atrac3p
  403. | `Eac3
  404. | `Sipr
  405. | `Mp1
  406. | `Twinvq
  407. | `Truehd
  408. | `Mp4als
  409. | `Atrac1
  410. | `Binkaudio_rdft
  411. | `Binkaudio_dct
  412. | `Aac_latm
  413. | `Qdmc
  414. | `Celt
  415. | `G723_1
  416. | `G729
  417. | `_8svx_exp
  418. | `_8svx_fib
  419. | `Bmv_audio
  420. | `Ralf
  421. | `Iac
  422. | `Ilbc
  423. | `Opus
  424. | `Comfort_noise
  425. | `Tak
  426. | `Metasound
  427. | `Paf_audio
  428. | `On2avc
  429. | `Dss_sp
  430. | `Codec2
  431. | `Ffwavesynth
  432. | `Sonic
  433. | `Sonic_ls
  434. | `Evrc
  435. | `Smv
  436. | `Dsd_lsbf
  437. | `Dsd_msbf
  438. | `Dsd_lsbf_planar
  439. | `Dsd_msbf_planar
  440. | `_4gv
  441. | `Interplay_acm
  442. | `Xma1
  443. | `Xma2
  444. | `Dst
  445. | `Atrac3al
  446. | `Atrac3pal
  447. | `Dolby_e
  448. | `Aptx
  449. | `Aptx_hd
  450. | `Sbc
  451. | `Atrac9
  452. | `Hcom
  453. | `Acelp_kelvin
  454. | `Mpegh_3d_audio
  455. | `Siren
  456. | `Hca
  457. | `Fastaudio
  458. | `Msnsiren
  459. | `Dfpwm
]

Audio codec ids. Careful: different codecs share the same ID, e.g. aac and libfdk_aac

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 -> ?channels:int -> ?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 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.