package ffmpeg-avcodec

  1. Overview
  2. Docs

Video codecs.

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

Main types for video 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
]

Video 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 : [ `Mpeg1video | `Mpeg2video | `H261 | `H263 | `Rv10 | `Rv20 | `Mjpeg | `Mjpegb | `Ljpeg | `Sp5x | `Jpegls | `Mpeg4 | `Rawvideo | `Msmpeg4v1 | `Msmpeg4v2 | `Msmpeg4v3 | `Wmv1 | `Wmv2 | `H263p | `H263i | `Flv1 | `Svq1 | `Svq3 | `Dvvideo | `Huffyuv | `Cyuv | `H264 | `Indeo3 | `Vp3 | `Theora | `Asv1 | `Asv2 | `Ffv1 | `_4xm | `Vcr1 | `Cljr | `Mdec | `Roq | `Interplay_video | `Xan_wc3 | `Xan_wc4 | `Rpza | `Cinepak | `Ws_vqa | `Msrle | `Msvideo1 | `Idcin | `_8bps | `Smc | `Flic | `Truemotion1 | `Vmdvideo | `Mszh | `Zlib | `Qtrle | `Tscc | `Ulti | `Qdraw | `Vixl | `Qpeg | `Png | `Ppm | `Pbm | `Pgm | `Pgmyuv | `Pam | `Ffvhuff | `Rv30 | `Rv40 | `Vc1 | `Wmv3 | `Loco | `Wnv1 | `Aasc | `Indeo2 | `Fraps | `Truemotion2 | `Bmp | `Cscd | `Mmvideo | `Zmbv | `Avs | `Smackvideo | `Nuv | `Kmvc | `Flashsv | `Cavs | `Jpeg2000 | `Vmnc | `Vp5 | `Vp6 | `Vp6f | `Targa | `Dsicinvideo | `Tiertexseqvideo | `Tiff | `Gif | `Dxa | `Dnxhd | `Thp | `Sgi | `C93 | `Bethsoftvid | `Ptx | `Txd | `Vp6a | `Amv | `Vb | `Pcx | `Sunrast | `Indeo4 | `Indeo5 | `Mimic | `Rl2 | `Escape124 | `Dirac | `Bfi | `Cmv | `Motionpixels | `Tgv | `Tgq | `Tqi | `Aura | `Aura2 | `V210x | `Tmv | `V210 | `Dpx | `Mad | `Frwu | `Flashsv2 | `Cdgraphics | `R210 | `Anm | `Binkvideo | `Iff_ilbm | `Kgv1 | `Yop | `Vp8 | `Pictor | `Ansi | `A64_multi | `A64_multi5 | `R10k | `Mxpeg | `Lagarith | `Prores | `Jv | `Dfa | `Wmv3image | `Vc1image | `Utvideo | `Bmv_video | `Vble | `Dxtory | `V410 | `Xwd | `Cdxl | `Xbm | `Zerocodec | `Mss1 | `Msa1 | `Tscc2 | `Mts2 | `Cllc | `Mss2 | `Vp9 | `Aic | `Escape130 | `G2m | `Webp | `Hnm4_video | `Hevc | `Fic | `Alias_pix | `Brender_pix | `Paf_video | `Exr | `Vp7 | `Sanm | `Sgirle | `Mvc1 | `Mvc2 | `Hqx | `Tdsc | `Hq_hqa | `Hap | `Dds | `Dxv | `Screenpresso | `Rscc | `Avs2 | `Pgx | `Avs3 | `Msp2 | `Vvc | `Y41p | `Avrp | `_012v | `Avui | `Ayuv | `Targa_y216 | `V308 | `V408 | `Yuv4 | `Avrn | `Cpia | `Xface | `Snow | `Smvjpeg | `Apng | `Daala | `Cfhd | `Truemotion2rt | `M101 | `Magicyuv | `Sheervideo | `Ylc | `Psd | `Pixlet | `Speedhq | `Fmvc | `Scpr | `Clearvideo | `Xpm | `Av1 | `Bitpacked | `Mscc | `Srgc | `Svg | `Gdv | `Fits | `Imm4 | `Prosumer | `Mwsc | `Wcmv | `Rasc | `Hymt | `Arbc | `Agm | `Lscr | `Vp4 | `Imm5 | `Mvdv | `Mvha | `Cdtoons | `Mv30 | `Notchlc | `Pfm | `Mobiclip | `Photocd | `Ipu | `Argo | `Cri | `Simbiosis_imx | `Sga_video | `Gem | `Vbn | `Jpegxl | `Qoi | `Phm ] list

List all video codec IDs.

val encoders : encode t list

List of all available video encoders.

val decoders : decode t list

List of all available video 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_frame_rates : _ t -> Avutil.rational list

Return the list of supported frame rates of the codec.

val find_best_frame_rate : _ t -> Avutil.rational -> Avutil.rational

Avcodec.Video.find_best_frame_rate codec default return the best frame rate of the codec codec or the default value if the codec has no frame rate.

val get_supported_pixel_formats : _ t -> Avutil.Pixel_format.t list

Return the list of supported pixel formats of the codec.

val find_best_pixel_format : ?hwaccel:bool -> _ t -> Avutil.Pixel_format.t -> Avutil.Pixel_format.t

Avcodec.Video.find_best_pixel_format codec default return the best pixel format of the codec codec or the default value if the codec has no pixel format.

val create_parser : ?params:Avutil.video params -> decode t -> Avutil.video Packet.parser

Avcodec.Video.create_parser codec create an video packet parser.

Raise Error if the parser creation failed.

val create_decoder : ?params:Avutil.video params -> decode t -> Avutil.video decoder

Avcodec.Video.create_decoder codec create a video decoder.

Raise Error if the decoder creation failed.

type hardware_context = [
  1. | `Device_context of Avutil.HwContext.device_context
  2. | `Frame_context of Avutil.HwContext.frame_context
]
val create_encoder : ?opts:Avutil.opts -> ?frame_rate:Avutil.rational -> ?hardware_context:hardware_context -> pixel_format:Avutil.Pixel_format.t -> width:int -> height:int -> time_base:Avutil.rational -> encode t -> Avutil.video encoder

Avcodec.Video.create_encoder create a video encoder.

Params have the same semantics as in Av.new_video_stream

Raise Error if the encoder creation failed.

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.

val get_id : _ t -> id

Return the ID (class) of a codec.

val get_params_id : Avutil.video params -> id

Return the id of the codec params.

val get_width : Avutil.video params -> int

Returns the width set for the codec params.

val get_height : Avutil.video params -> int

Returns the height set for the codec params.

val get_sample_aspect_ratio : Avutil.video params -> Avutil.rational

Returns the sample aspect ratio set for the codec params.

val get_pixel_format : Avutil.video params -> Avutil.Pixel_format.t option

Returns the pixel format set for the codec params.

val get_pixel_aspect : Avutil.video params -> Avutil.rational option

Returns the pixel aspect set for the codec params.

val get_bit_rate : Avutil.video params -> int

Returns the bit rate set for the codec.

OCaml

Innovation. Community. Security.