package ffmpeg-avcodec

  1. Overview
  2. Docs
On This Page
  1. Constants

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.

module Unknown : sig ... end
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
  460. | `First_subtitle
  461. | `Dvd_subtitle
  462. | `Dvb_subtitle
  463. | `Text
  464. | `Xsub
  465. | `Ssa
  466. | `Mov_text
  467. | `Hdmv_pgs_subtitle
  468. | `Dvb_teletext
  469. | `Srt
  470. | `Microdvd
  471. | `Eia_608
  472. | `Jacosub
  473. | `Sami
  474. | `Realtext
  475. | `Stl
  476. | `Subviewer1
  477. | `Subviewer
  478. | `Subrip
  479. | `Webvtt
  480. | `Mpl2
  481. | `Vplayer
  482. | `Pjs
  483. | `Ass
  484. | `Hdmv_text_subtitle
  485. | `Ttml
  486. | `Arib_caption
  487. | `First_unknown
  488. | `Ttf
  489. | `Scte_35
  490. | `Epg
  491. | `Bintext
  492. | `Xbin
  493. | `Idf
  494. | `Otf
  495. | `Smpte_klv
  496. | `Dvd_nav
  497. | `Timed_id3
  498. | `Bin_data
  499. | `Probe
  500. | `Mpeg2ts
  501. | `Mpeg4systems
  502. | `Ffmetadata
  503. | `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.