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
]
Constants
val flag_qscale : int
val params : 'media encoder -> 'media params

Get the params of a given encoder

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.

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.