Avutil.FrameFrames: the properties common to audio and video frames.
One decoded audio or video frame. 'media is audio or video and matches the content of the frame.
The value owns one FFmpeg frame, which is released when the value is collected; there is no explicit close. The data buffers of the frame are reference counted by FFmpeg and may be shared with other frames. The size of those buffers is reported to the garbage collector.
A function of the bindings that takes a frame leaves it unchanged and usable, apart from the setters below and Video.frame_visit with ~make_writable:true. A frame has no lock: any number of threads may read one at the same time, and a thread that changes one must be its only user at that moment. The bindings do not detect a violation.
val pts : _ t -> Stdlib.Int64.t optionThe presentation timestamp of the frame, in units of the time base the frame is handled with. None when the frame has none (FFmpeg's AV_NOPTS_VALUE).
val set_pts : _ t -> Stdlib.Int64.t option -> unitset_pts frame pts writes the presentation timestamp of frame, None meaning no timestamp. It writes the same value as the best-effort timestamp, so best_effort_timestamp agrees with pts afterwards.
val duration : _ t -> Stdlib.Int64.t optionThe duration of the frame, in the same units as pts. None when the duration is 0, which FFmpeg reads as unknown.
val set_duration : _ t -> Stdlib.Int64.t option -> unitset_duration frame duration writes the duration of frame, None being stored as 0.
val pkt_dts : _ t -> Stdlib.Int64.t optionThe decoding timestamp copied from the packet that produced the frame. None when the frame has none (AV_NOPTS_VALUE).
val set_pkt_dts : _ t -> Stdlib.Int64.t option -> unitset_pkt_dts frame dts writes that decoding timestamp, None meaning no timestamp.
val metadata : _ t -> (string * string) listThe metadata of the frame as (key, value) pairs, in the order FFmpeg holds them. The strings are copies.
val set_metadata : _ t -> (string * string) list -> unitset_metadata frame l replaces the whole metadata of frame with l. Entries that are absent from l are removed, a key that appears several times in l keeps its last value, and the empty list leaves the frame with no metadata. A key or a value ends at its first NUL byte.
val best_effort_timestamp : _ t -> Stdlib.Int64.t optionThe timestamp FFmpeg estimates for the frame when decoding, which its own components read. None when the frame has none (AV_NOPTS_VALUE). FFmpeg fills it only when decoding; set_pts writes it too.
val side_data : _ t -> Frame_side_data.raw listEvery side-data entry of the frame, in the frame's order. An entry whose kind the bindings have no constructor for is left out.
val find_side_data : _ t -> Frame_side_data.kind -> Frame_side_data.raw optionfind_side_data frame kind is the first entry of that kind, None when the frame has none. It copies that entry only.
val add_side_data : _ t -> Frame_side_data.raw -> unitadd_side_data frame entry attaches a copy of entry. An entry of the same kind is replaced, unless the kind has the `Multi property, in which case the entry is appended. On failure the frame is unchanged.
val remove_side_data : _ t -> Frame_side_data.kind -> unitremove_side_data frame kind removes every entry of that kind.