Module Avutil.Frame_side_data

Side data of frames: the kinds FFmpeg defines, raw entries and their typed content.

type kind = [
  1. | `Panscan
  2. | `A53_cc
  3. | `Stereo3d
  4. | `Matrixencoding
  5. | `Downmix_info
  6. | `Replaygain
  7. | `Displaymatrix
  8. | `Afd
  9. | `Motion_vectors
  10. | `Skip_samples
  11. | `Audio_service_type
  12. | `Mastering_display_metadata
  13. | `Gop_timecode
  14. | `Spherical
  15. | `Content_light_level
  16. | `Icc_profile
  17. | `S12m_timecode
  18. | `Dynamic_hdr_plus
  19. | `Regions_of_interest
  20. | `Video_enc_params
  21. | `Sei_unregistered
  22. | `Film_grain_params
  23. | `Detection_bboxes
  24. | `Dovi_rpu_buffer
  25. | `Dovi_metadata
  26. | `Dynamic_hdr_vivid
  27. | `Ambient_viewing_environment
  28. | `Video_hint
  29. | `Lcevc
  30. | `View_id
  31. | `_3d_reference_displays
  32. | `Exif
  33. | `Dynamic_hdr_smpte_2094_app5
  34. | `Iamf_mix_gain_param
  35. | `Iamf_demixing_info_param
  36. | `Iamf_recon_gain_info_param
  37. | `Raw_color_params
]
type prop = [
  1. | `Global
  2. | `Multi
  3. | `Size_dependent
  4. | `Color_dependent
  5. | `Channel_dependent
]
type raw = private {
  1. kind : kind;
  2. data : string;
}

One entry as a frame holds it: its kind and a copy of its payload. The record is private: an entry comes from Frame.side_data or from encode, never from arbitrary bytes, because FFmpeg reads a payload at the size its kind implies. For most kinds the payload is a C structure of the FFmpeg build in use: it must not be stored or sent to another process.

type t = [
  1. | `Display_matrix of Display_matrix.t
]

The kinds whose content the bindings translate.

val kinds : kind list

Every kind of the installed headers, in FFmpeg's enumeration order.

val name : kind -> string

FFmpeg's name of the kind, empty when it has none.

val props : kind -> prop list

The properties FFmpeg gives the kind, such as `Global for a kind that applies to a whole stream.

val decode : raw -> t option

The content of an entry. None for a kind outside t and for a payload too short for its kind.

val encode : t -> raw

The entry holding a content. decode (encode d) is Some d.

val display_matrix : raw list -> Display_matrix.t option

The matrix of the first entry that holds one.