package ffmpeg-avcodec

  1. Overview
  2. Docs
On This Page
  1. Constants
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module contains decoders and encoders for audio, video and subtitle codecs.

type ('media, 'mode) codec
type 'media params
type 'media decoder
type 'media encoder
type encode = [
  1. | `Encoder
]
type decode = [
  1. | `Decoder
]
type profile = {
  1. id : int;
  2. profile_name : string;
}
type descriptor = {
  1. media_type : Avutil.media_type;
  2. name : string;
  3. long_name : string option;
  4. properties : [ `Intra_only | `Lossy | `Lossless | `Reorder | `Bitmap_sub | `Text_sub ] list;
  5. mime_types : string list;
  6. profiles : profile list;
}
Constants
val flag_qscale : int
val params : 'media encoder -> 'media params

Get the params of a given encoder

val descriptor : 'media params -> descriptor option

Get the params descriptor.

val time_base : 'media encoder -> Avutil.rational

Get the time base of a given encoder.

val name : (_, _) codec -> string

Get the name of a given codec.

type capability = [
  1. | `Draw_horiz_band
  2. | `Dr1
  3. | `Truncated
  4. | `Delay
  5. | `Small_last_frame
  6. | `Subframes
  7. | `Experimental
  8. | `Channel_conf
  9. | `Frame_threads
  10. | `Slice_threads
  11. | `Param_change
  12. | `Other_threads
  13. | `Auto_threads
  14. | `Variable_frame_size
  15. | `Avoid_probing
  16. | `Intra_only
  17. | `Lossless
  18. | `Hardware
  19. | `Hybrid
  20. | `Encoder_reordered_opaque
  21. | `Encoder_flush
]

Codec capabilities.

val capabilities : ([< `Audio | `Video ], encode) codec -> capability list

Get the encoding capabilities for this codec.

type hw_config_method = [
  1. | `Hw_device_ctx
  2. | `Hw_frames_ctx
  3. | `Internal
  4. | `Ad_hoc
]

Codec hardware config method.

type hw_config = {
  1. pixel_format : Avutil.Pixel_format.t;
  2. methods : hw_config_method list;
  3. device_type : Avutil.HwContext.device_type;
}

Hardward config for the given codec.

val hw_configs : ([< `Audio | `Video ], _) codec -> hw_config list

Get the codec's hardward configs.

module Packet : sig ... end

Packet.

module Audio : sig ... end

Audio codecs.

module Video : sig ... end

Video codecs.

module Subtitle : sig ... end

Subtitle codecs.

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

Avcodec.decode decoder f packet applies function f to the decoded frames frome the packet according to the decoder configuration.

Raise Error if the decoding failed.

val flush_decoder : 'media decoder -> ('media Avutil.frame -> unit) -> unit

Avcodec.flush_decoder decoder f applies function f to the decoded frames frome the buffered packets in the decoder.

Raise Error if the decoding failed.

val encode : 'media encoder -> ('media Packet.t -> unit) -> 'media Avutil.frame -> unit

Avcodec.encode encoder f frame applies function f to the encoded packets from the frame according to the encoder configuration.

Raise Error if the encoding failed.

val flush_encoder : 'media encoder -> ('media Packet.t -> unit) -> unit

Avcodec.flush_encoder encoder applies function f to the encoded packets from the buffered frames in the encoder.

Raise Error if the encoding failed.

OCaml

Innovation. Community. Security.