Avcodec.VideoVideo codecs: lookup, supported configurations, decoders, encoders and the video fields of codec parameters.
type 'mode t = (Avutil.video, 'mode) codecA video codec.
type id = [ | `Wrapped_avframe| `None| `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| `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| `Targa_y216| `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| `Radiance_hdr| `Wbmp| `Media100| `Vqc| `Pdv| `Evc| `Rtv1| `Vmix| `Lead| `Dnxuc| `Rv60| `Jpegxl_anim| `Apv| `Prores_raw| `Jpegxs| `Webp_anim ]The identifier of a video format, FFmpeg's AV_CODEC_ID_* values of the video family. An identifier names a format; several codecs may implement the same one.
val descriptor : id -> descriptor optiondescriptor id is FFmpeg's descriptor of the format, None when FFmpeg has none for it. Every text of the result is a copy.
val codec_ids :
[ `Wrapped_avframe
| `None
| `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
| `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
| `Targa_y216
| `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
| `Radiance_hdr
| `Wbmp
| `Media100
| `Vqc
| `Pdv
| `Evc
| `Rtv1
| `Vmix
| `Lead
| `Dnxuc
| `Rv60
| `Jpegxl_anim
| `Apv
| `Prores_raw
| `Jpegxs
| `Webp_anim ]
listEvery video identifier the bindings know.
find_encoder_by_name name is the video encoder FFmpeg registers under name, for example "libx264".
find_decoder_by_name name is the video decoder FFmpeg registers under name.
val get_supported_frame_rates : _ t -> Avutil.rational listget_supported_frame_rates codec is the list of the frame rates, in frames per second, the codec declares it supports, in the codec's order. The empty list means the codec declares none, which FFmpeg uses for a codec with no restriction.
val get_supported_color_spaces : _ t -> Avutil.Color_space.t listget_supported_color_spaces codec is the list of the colour spaces the codec declares it supports, in the codec's order. The empty list means the codec declares none. A value the bindings have no constructor for is left out.
val get_supported_color_ranges : _ t -> Avutil.Color_range.t listget_supported_color_ranges codec is the list of the colour ranges the codec declares it supports, under the rules of get_supported_color_spaces.
val get_supported_pixel_formats : _ t -> Avutil.Pixel_format.t listget_supported_pixel_formats codec is the list of the pixel formats the codec declares it supports, under the rules of get_supported_color_spaces. The list may hold hardware pixel formats.
val find_best_frame_rate : _ t -> Avutil.rational -> Avutil.rationalfind_best_frame_rate codec default is default when the codec declares no frame rate or declares one equal to it as a fraction. Otherwise it is the first frame rate the codec declares.
val find_best_pixel_format :
?hwaccel:bool ->
_ t ->
Avutil.Pixel_format.t ->
Avutil.Pixel_format.tfind_best_pixel_format ?hwaccel codec default is a pixel format to give the codec, default when possible. It is default when the codec declares no pixel format or declares default. Otherwise it is the first format the codec declares that hwaccel allows, and default when none is left.
val create_decoder :
?params:Avutil.video params ->
decode t ->
Avutil.video decodercreate_decoder ?params codec allocates a decoder for codec and opens it. The decoder decodes in software and takes no option. FFmpeg chooses its number of threads.
Opening releases the OCaml runtime lock: other OCaml threads run meanwhile. On failure everything allocated is released.
type hardware_context = [ | `Device_context of Avutil.HwContext.device_context| `Frame_context of Avutil.HwContext.frame_context ]A hardware context for a video encoder:
`Device_context: a hardware device. The encoder receives frames as they are given to it.`Frame_context: a pool of hardware frames. The encoder uploads each frame given to it into a frame of the pool before encoding it, see Avcodec.encode.val create_encoder :
?opts:Avutil.opts ->
?side_data:Avutil.Frame_side_data.raw list ->
?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 encodercreate_encoder ?opts ?frame_rate ?hardware_context ~pixel_format ~width ~height ~time_base codec allocates an encoder for codec, sets the typed arguments on it, and opens it with the entries of opts.
Opening releases the OCaml runtime lock: other OCaml threads run meanwhile. On failure everything allocated is released and opts is untouched.
val get_name : (_, _) codec -> stringget_name codec is the codec's name, as Avcodec.name.
val get_description : (_, _) codec -> stringget_description codec is the codec's descriptive name, the empty string when FFmpeg gives none.
val string_of_id : id -> stringstring_of_id id is FFmpeg's name of the format, for example "h264".
val get_params_id : Avutil.video params -> idget_params_id params is the codec identifier of the parameters.
val get_width : Avutil.video params -> intget_width params is the picture width, in pixels.
val get_height : Avutil.video params -> intget_height params is the picture height, in pixels.
val get_sample_aspect_ratio : Avutil.video params -> Avutil.rationalget_sample_aspect_ratio params is the aspect ratio of one pixel, width over height, as the parameters store it. It is 0/1 when unknown.
val get_pixel_format : Avutil.video params -> Avutil.Pixel_format.t optionget_pixel_format params is the pixel format of the stream, None when the parameters have none.
val get_pixel_aspect : Avutil.video params -> Avutil.rational optionget_pixel_aspect params is get_sample_aspect_ratio as an option: None when the ratio is unknown, that is when its numerator is 0.
val get_bit_rate : Avutil.video params -> intget_bit_rate params is the average bit rate of the encoded stream, in bits per second.
val get_video_delay : Avutil.video params -> intThe number of frames the decoder outputs late because of reordering (B-frames); 0 for a stream without reordering.
The field order of interlaced video; `Unknown when unset. `Tt: top field coded and displayed first; `Bb: bottom first; `Tb: top coded first, bottom displayed first; `Bt: the reverse.
val get_field_order : Avutil.video params -> field_ordertype color = {color_range : Avutil.Color_range.t;color_primaries : Avutil.Color_primaries.t;color_trc : Avutil.Color_trc.t;color_space : Avutil.Color_space.t;chroma_location : Avutil.Chroma_location.t;}The colour properties of the stream, as the codec parameters store them.
val get_color : Avutil.video params -> color