Go to the documentation of this file.
25 #ifndef AVUTIL_FRAME_H
26 #define AVUTIL_FRAME_H
326 #define AV_NUM_DATA_POINTERS 8
504 #if FF_API_OLD_CHANNEL_LAYOUT
559 #define AV_FRAME_FLAG_CORRUPT (1 << 0)
563 #define AV_FRAME_FLAG_DISCARD (1 << 2)
630 #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
631 #define FF_DECODE_ERROR_MISSING_REFERENCE 2
632 #define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
633 #define FF_DECODE_ERROR_DECODE_SLICES 8
635 #if FF_API_OLD_CHANNEL_LAYOUT
708 #if FF_API_COLORSPACE_NAME
AVBufferRef ** extended_buf
For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers,...
enum AVColorTransferCharacteristic color_trc
enum AVColorRange color_range
MPEG vs JPEG YUV range.
AVColorTransferCharacteristic
Color Transfer Characteristic.
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
int coded_picture_number
picture number in bitstream order
@ AV_FRAME_DATA_FILM_GRAIN_PARAMS
Film grain parameters for a frame, described by AVFilmGrainParams.
enum AVColorPrimaries color_primaries
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
void * opaque
for some private data of the user
enum AVColorSpace colorspace
YUV colorspace type.
This structure describes decoded (raw) audio or video data.
int av_frame_make_writable(AVFrame *frame)
Ensure that the frame data is writable, avoiding data copy if possible.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int top_field_first
If the content is interlaced, is top field displayed first.
@ AV_FRAME_DATA_DOVI_RPU_BUFFER
Dolby Vision RPU raw data, suitable for passing to x265 or other libraries.
int64_t pkt_duration
duration of the corresponding packet, expressed in AVStream->time_base units, 0 if unknown.
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
int av_frame_apply_cropping(AVFrame *frame, int flags)
Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
enum AVChromaLocation chroma_location
@ AV_FRAME_DATA_MATRIXENCODING
The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
@ AV_FRAME_CROP_UNALIGNED
Apply the maximum possible cropping, even if it requires setting the AVFrame.data[] entries to unalig...
int key_frame
1 -> keyframe, 0-> not
static double val(void *priv, double ch)
AVChannelLayout ch_layout
Channel layout of the audio data.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
attribute_deprecated int channels
number of audio channels, only used for audio.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
attribute_deprecated uint64_t channel_layout
Channel layout of the audio data.
Structure describing a single Region Of Interest.
int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
@ AV_FRAME_DATA_AUDIO_SERVICE_TYPE
This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defi...
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
@ AV_FRAME_DATA_DYNAMIC_HDR_VIVID
HDR Vivid dynamic metadata associated with a video frame.
@ AV_FRAME_DATA_SPHERICAL
The data represents the AVSphericalMapping structure defined in libavutil/spherical....
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Rational number (pair of numerator and denominator).
uint32_t self_size
Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
AVActiveFormatDescription
@ AV_FRAME_DATA_ICC_PROFILE
The data contains an ICC profile as an opaque octet buffer following the format described by ISO 1507...
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
AVFrameSideData * av_frame_new_side_data_from_buf(AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
Add a new side data to a frame from an existing AVBufferRef.
int64_t pkt_dts
DTS copied from the AVPacket that triggered returning this frame.
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
int64_t best_effort_timestamp
frame timestamp estimated using various heuristics, in stream time base
enum AVPictureType pict_type
Picture type of the frame.
@ AV_FRAME_DATA_REPLAYGAIN
ReplayGain information in the form of the AVReplayGain struct.
@ AV_FRAME_DATA_PANSCAN
The data is the AVPanScan struct defined in libavcodec.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
An AVChannelLayout holds information about the channel layout of audio data.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
int quality
quality (between 1 (good) and FF_LAMBDA_MAX (bad))
int sample_rate
Sample rate of the audio data.
#define AV_NUM_DATA_POINTERS
const attribute_deprecated char * av_get_colorspace_name(enum AVColorSpace val)
Get the name of a colorspace.
AVRational time_base
Time base for the timestamps in this frame.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
#define attribute_deprecated
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type.
AVBufferRef * private_ref
AVBufferRef for internal use by a single libav* library.
@ AV_FRAME_DATA_SKIP_SAMPLES
Recommmends skipping the specified number of samples.
AVChromaLocation
Location of chroma samples.
int interlaced_frame
The content of the picture is interlaced.
int nb_samples
number of audio samples (per channel) described by this frame
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
int top
Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge ...
uint8_t ** extended_data
pointers to the data planes/channels.
AVColorSpace
YUV colorspace type.
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
AVFrameSideData ** side_data
int decode_error_flags
decode error flags of the frame, set to a combination of FF_DECODE_ERROR_xxx flags if the decoder pro...
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
int palette_has_changed
Tell user application that palette has changed from previous frame.
@ AV_FRAME_DATA_VIDEO_ENC_PARAMS
Encoding parameters for a video frame, as described by AVVideoEncParams.
AVDictionary * metadata
metadata.
enum AVFrameSideDataType type
int pkt_size
size of the corresponding packet containing the compressed frame.
int64_t reordered_opaque
reordered opaque 64 bits (generally an integer or a double precision float PTS but can be anything).
A reference to a data buffer.
Structure to hold side data for an AVFrame.
const char * av_frame_side_data_name(enum AVFrameSideDataType type)
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_FRAME_DATA_MOTION_VECTORS
Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec A...
AVBufferRef * av_frame_get_plane_buffer(AVFrame *frame, int plane)
Get the buffer reference a given data plane is stored in.
AVColorRange
Visual content value range.
int display_picture_number
picture number in display order
AVRational qoffset
Quantisation offset.
@ AV_FRAME_DATA_DOWNMIX_INFO
Metadata relevant to a downmix procedure.
int repeat_pict
When decoding, this signals how much the picture must be delayed.
@ AV_FRAME_DATA_DETECTION_BBOXES
Bounding boxes for object detection and classification, as described by AVDetectionBBoxHeader.
int nb_extended_buf
Number of elements in extended_buf.