FFmpeg
Data Fields
AVFrame Struct Reference

This structure describes decoded (raw) audio or video data. More...

#include <frame.h>

Data Fields

uint8_tdata [AV_NUM_DATA_POINTERS]
 pointer to the picture/channel planes. More...
 
int linesize [AV_NUM_DATA_POINTERS]
 For video, size in bytes of each picture line. More...
 
uint8_t ** extended_data
 pointers to the data planes/channels. More...
 
int nb_samples
 number of audio samples (per channel) described by this frame More...
 
int format
 format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames, enum AVSampleFormat for audio) More...
 
int key_frame
 1 -> keyframe, 0-> not More...
 
enum AVPictureType pict_type
 Picture type of the frame. More...
 
AVRational sample_aspect_ratio
 Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. More...
 
int64_t pts
 Presentation timestamp in time_base units (time when frame should be shown to user). More...
 
attribute_deprecated int64_t pkt_pts
 PTS copied from the AVPacket that was decoded to produce this frame. More...
 
int64_t pkt_dts
 DTS copied from the AVPacket that triggered returning this frame. More...
 
int coded_picture_number
 picture number in bitstream order More...
 
int display_picture_number
 picture number in display order More...
 
int quality
 quality (between 1 (good) and FF_LAMBDA_MAX (bad)) More...
 
void * opaque
 for some private data of the user More...
 
attribute_deprecated uint64_t error [AV_NUM_DATA_POINTERS]
 
int repeat_pict
 When decoding, this signals how much the picture must be delayed. More...
 
int interlaced_frame
 The content of the picture is interlaced. More...
 
int top_field_first
 If the content is interlaced, is top field displayed first. More...
 
int palette_has_changed
 Tell user application that palette has changed from previous frame. More...
 
int64_t reordered_opaque
 reordered opaque 64 bits (generally an integer or a double precision float PTS but can be anything). More...
 
int sample_rate
 Sample rate of the audio data. More...
 
uint64_t channel_layout
 Channel layout of the audio data. More...
 
AVBufferRefbuf [AV_NUM_DATA_POINTERS]
 AVBuffer references backing the data for this frame. More...
 
AVBufferRef ** extended_buf
 For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf. More...
 
int nb_extended_buf
 Number of elements in extended_buf. More...
 
AVFrameSideData ** side_data
 
int nb_side_data
 
int flags
 Frame flags, a combination of AV_FRAME_FLAGS. More...
 
enum AVColorRange color_range
 MPEG vs JPEG YUV range. More...
 
enum AVColorPrimaries color_primaries
 
enum AVColorTransferCharacteristic color_trc
 
enum AVColorSpace colorspace
 YUV colorspace type. More...
 
enum AVChromaLocation chroma_location
 
int64_t best_effort_timestamp
 frame timestamp estimated using various heuristics, in stream time base More...
 
int64_t pkt_pos
 reordered pos from the last AVPacket that has been input into the decoder More...
 
int64_t pkt_duration
 duration of the corresponding packet, expressed in AVStream->time_base units, 0 if unknown. More...
 
AVDictionarymetadata
 metadata. More...
 
int decode_error_flags
 decode error flags of the frame, set to a combination of FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there were errors during the decoding. More...
 
int channels
 number of audio channels, only used for audio. More...
 
int pkt_size
 size of the corresponding packet containing the compressed frame. More...
 
attribute_deprecated int8_t * qscale_table
 QP table. More...
 
attribute_deprecated int qstride
 QP store stride. More...
 
attribute_deprecated int qscale_type
 
attribute_deprecated AVBufferRefqp_table_buf
 
AVBufferRefhw_frames_ctx
 For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame. More...
 
AVBufferRefopaque_ref
 AVBufferRef for free use by the API user. More...
 
AVBufferRefprivate_ref
 AVBufferRef for internal use by a single libav* library. More...
 
Video dimensions

Video frames only.

The coded dimensions (in pixels) of the video frame, i.e. the size of the rectangle that contains some well-defined values.

Note
The part of the frame intended for display/presentation is further restricted by the Cropping rectangle.
int width
 
int height
 
Cropping

Video frames only. The number of pixels to discard from the the top/bottom/left/right border of the frame to obtain the sub-rectangle of the frame intended for presentation.

size_t crop_top
 
size_t crop_bottom
 
size_t crop_left
 
size_t crop_right
 

Detailed Description

This structure describes decoded (raw) audio or video data.

AVFrame must be allocated using av_frame_alloc(). Note that this only allocates the AVFrame itself, the buffers for the data must be managed through other means (see below). AVFrame must be freed with av_frame_free().

AVFrame is typically allocated once and then reused multiple times to hold different data (e.g. a single AVFrame to hold frames received from a decoder). In such a case, av_frame_unref() will free any references held by the frame and reset it to its original clean state before it is reused again.

The data described by an AVFrame is usually reference counted through the AVBuffer API. The underlying buffer references are stored in AVFrame.buf / AVFrame.extended_buf. An AVFrame is considered to be reference counted if at least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, every single data plane must be contained in one of the buffers in AVFrame.buf or AVFrame.extended_buf. There may be a single buffer for all the data, or one separate buffer for each plane, or anything in between.

sizeof(AVFrame) is not a part of the public ABI, so new fields may be added to the end with a minor bump.

Fields can be accessed through AVOptions, the name string used, matches the C structure field name for fields accessible through AVOptions. The AVClass for AVFrame can be obtained from avcodec_get_frame_class()

Examples
decode_audio.c, decode_video.c, demuxing_decoding.c, encode_audio.c, encode_video.c, filter_audio.c, filtering_audio.c, filtering_video.c, hw_decode.c, muxing.c, qsvdec.c, transcode_aac.c, transcoding.c, vaapi_encode.c, and vaapi_transcode.c.

Definition at line 295 of file frame.h.

Field Documentation

◆ data

uint8_t* AVFrame::data[AV_NUM_DATA_POINTERS]

pointer to the picture/channel planes.

This might be different from the first allocated byte

Some decoders access areas outside 0,0 - width,height, please see avcodec_align_dimensions2(). Some filters and swscale can read up to 16 bytes beyond the planes, if these filters are to be used, then 16 extra bytes must be allocated.

NOTE: Except for hwaccel formats, pointers not needed by the format MUST be set to NULL.

Examples
hw_decode.c, muxing.c, qsvdec.c, and vaapi_encode.c.

Definition at line 309 of file frame.h.

Referenced by aac_decode_er_frame(), aac_decode_frame_int(), alloc_frame_buffer(), alloc_picture(), alpha_composite(), analyze_plane(), aom_decode(), apng_encode_frame(), apply_motion_generic(), audio_decode_frame(), av_frame_move_ref(), av_frame_ref(), avcodec_encode_audio2(), avgblur_opencl_filter_frame(), avs_decode_frame(), avui_decode_frame(), avui_encode_frame(), bethsoftvid_decode_frame(), blend_plane(), blend_slice_packed_rgb(), bmp_decode_frame(), bmp_encode_frame(), calc_diffs(), cdg_border_preset(), cdg_decode_frame(), cdg_load_palette(), cdg_scroll(), cdg_tile_block(), cfhd_decode(), chroma_mc_bi(), cinvideo_decode_frame(), comp_block(), compare(), compare_fields(), compute_crc_of_packets(), compute_sat_hue_metrics16(), compute_sat_hue_metrics8(), config_output(), config_video_output(), control_port_cb(), copy_block(), copy_chroma(), copy_fields(), copy_from(), copy_plane(), copyadd_block(), cover_rect(), cuda_transfer_data_from(), cuda_transfer_data_to(), cuvid_output_frame(), d3d11va_transfer_data(), debug_mean_error(), decimate_frame(), decode_argb(), decode_argb_frame(), decode_argbi(), decode_argx(), decode_argxi(), decode_aybr(), decode_aybri(), decode_block(), decode_byry(), decode_byryi(), decode_c82i(), decode_c82p(), decode_ca2i(), decode_ca2p(), decode_ca4i(), decode_ca4p(), decode_frame(), decode_idat_chunk(), decode_inter(), decode_inter_plane(), decode_mb_row_no_filter(), decode_packet(), decode_rgb(), decode_rgb24_frame(), decode_rgbi(), decode_rgbx(), decode_rgbxi(), decode_rle(), decode_rle16(), decode_rle_bpp2(), decode_rle_bpp4(), decode_slice(), decode_slice_thread(), decode_write(), decode_ybr(), decode_ybr10(), decode_ybr10i(), decode_ybri(), decode_ybyr(), decode_yry10(), decode_yry10i(), decode_yuv_frame(), deint_vaapi_filter_frame(), deinterlace_slice(), detect_scene_change(), displace_packed(), displace_planar(), draw_axis_rgb(), draw_axis_yuv(), draw_blank_frame(), draw_frame(), draw_horiz_band(), draw_sono(), draw_spatial(), drawline(), drawtext(), drm_map_frame(), dxtory_decode_v1_410(), dxtory_decode_v1_420(), dxtory_decode_v1_444(), dxtory_decode_v1_rgb(), dxva2_map_frame(), dxva2_transfer_data_from(), dxva2_unmap_frame(), encode_apng(), encode_bitstream(), encode_frame(), encode_gbrp10(), encode_gbrp12(), encode_headers(), encode_picture_ls(), encode_rgb48_10bit(), encode_slice(), escape130_decode_frame(), estimate_best_b_count(), eval_motion_dist(), ff_alloc_picture(), ff_apply_vector_2x2(), ff_apply_vector_4x4(), ff_h263_decode_frame(), ff_mpeg4_encode_mb(), ff_print_debug_info2(), ff_vaapi_get_surface_id(), ff_vaapi_vpp_init_params(), ff_vc1_interp_mc(), ff_vc1_mc_1mv(), ff_vc1_mc_4mv_chroma(), ff_vc1_mc_4mv_luma(), ff_vdpau_get_surface_id(), ffmal_copy_frame(), ffmmal_add_packet(), ffmmal_fill_input_port(), fill_picture(), fill_picture_monoblack(), fill_picture_rgb(), fill_yuv_image(), filter(), filter_frame(), filter_frame16(), filter_frame8(), filter_mb_row(), filter_slice(), fits_encode_frame(), fixstride(), flashsv2_encode_frame(), flashsv_encode_frame(), flush(), frame_copy_video(), g2m_decode_frame(), gather_data_for_cel(), gather_data_for_subcel(), get_scene_score(), decklink_frame::GetBytes(), getpix(), gif_encode_frame(), gif_fill(), gif_fill_rect(), h264_field_start(), handle_p_frame_apng(), handle_p_frame_png(), handle_small_bpp(), hls_prediction_unit(), image_copy_16_to_8(), init(), inject_frame(), inter_pred(), interpolate(), ir2_decode_frame(), is_frozen(), jpeg2000_decode_frame(), lag_decode_frame(), lagfun_frame16(), lagfun_frame8(), libopenjpeg_copy_to_packed16(), libopenjpeg_copy_to_packed8(), libopenjpeg_copyto16(), libopenjpeg_copyto8(), libopenjpeg_encode_frame(), libx265_encode_frame(), load_input_picture(), load_palette(), luma_abs_diff(), luma_mc_bi(), magy_decode_frame(), magy_decode_slice(), magy_decode_slice10(), magy_encode_frame(), main(), match_video_size(), mc_dir_part(), mjpeg_decode_scan(), mp_decode_frame(), mp_get_yuv_from_rgb(), mp_read_changes_map(), mp_set_rgb_from_yuv(), msrle_decode_8_16_24_32(), msrle_decode_pal4(), mxpeg_check_dimensions(), mxpeg_decode_frame(), omx_encode_frame(), opencl_map_frame(), opencl_transfer_data_from(), opencl_transfer_data_to(), opencl_unmap_frame(), overlay_ass_image(), overlay_opencl_blend(), pack_yuv(), pam_encode_frame(), pcx_decode_frame(), plot_spectrum_column(), pnm_decode_frame(), pnm_encode_frame(), pp_filter_frame(), print_long_term(), print_short_term(), process_frame(), process_slice_uyvy422(), process_slice_yuv420p(), process_slice_yuv422p(), process_slice_yuv444p(), ptx_decode_frame(), put_blocks(), qsv_frame_lock(), qsv_map_from(), qsv_map_to(), qsv_transfer_data_child(), qsv_transfer_data_to(), query_frame(), request_frame(), run_test(), sbc_encode_frame(), scale_slice(), seqvideo_decode(), set_frame_data(), set_processing_window(), skip_check(), smvjpeg_decode_frame(), sub2video_heartbeat(), submit_frame(), sunrast_decode_frame(), svc_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), svq3_mc_dir_part(), targa_encode_frame(), targa_encode_normal(), targa_encode_rle(), tm2_decode_blocks(), to_meta_with_crop(), truemotion2rt_decode_frame(), try_push_frame(), txd_decode_frame(), uninit(), unpack_gray(), unpack_yuv(), unrefcount_frame(), update_histogram_diff(), update_sono_rgb(), update_sono_yuv(), utvideo_encode_frame(), v308_decode_frame(), v308_encode_frame(), v408_decode_frame(), v408_encode_frame(), v410_decode_frame(), v410_encode_frame(), vaapi_encode_issue(), vaapi_map_frame(), vaapi_unmap_frame(), vble_restore_plane(), vc1_decode_skip_blocks(), vcr1_decode_frame(), vdpau_transfer_data_from(), vdpau_transfer_data_to(), video_decode(), video_decode_example(), video_get_buffer(), videotoolbox_retrieve_data(), vp56_render_mb(), vp7_fade_frame(), vp8_lossy_decode_alpha(), vpx_decode(), vt_map_frame(), vt_unmap(), xbm_decode_frame(), xbm_encode_frame(), xpm_decode_frame(), xvid_encode_frame(), xvid_encode_init(), xwd_decode_frame(), xwd_encode_frame(), y216_decode_frame(), y41p_decode_frame(), y41p_encode_frame(), yuv4_decode_frame(), yuv4_encode_frame(), zero12v_decode_frame(), and zerocodec_decode_frame().

◆ linesize

int AVFrame::linesize[AV_NUM_DATA_POINTERS]

For video, size in bytes of each picture line.

For audio, size in bytes of each plane.

For audio, only linesize[0] may be set. For planar audio, each channel plane must be the same size.

For video the linesizes should be multiples of the CPUs alignment preference, this is 16 or 32 for modern desktop CPUs. Some code requires such alignment other code can be slower without correct alignment, for yet other it makes no difference.

Note
The linesize may be larger than the size of usable data – there may be extra padding present for performance reasons.
Examples
hw_decode.c, muxing.c, and qsvdec.c.

Definition at line 326 of file frame.h.

Referenced by alloc_frame_buffer(), alloc_picture(), alpha_composite(), analyze_plane(), aom_decode(), apng_encode_frame(), apply_motion_generic(), av_frame_ref(), avs_decode_frame(), avui_decode_frame(), avui_encode_frame(), bethsoftvid_decode_frame(), blend_plane(), blend_slice_packed_rgb(), bmp_decode_frame(), bmp_encode_frame(), calc_diffs(), cdg_border_preset(), cdg_decode_frame(), cdg_scroll(), cdg_tile_block(), cfhd_decode(), chroma_mc_bi(), cinvideo_decode_frame(), comp_block(), compare(), compare_fields(), compute_crc_of_packets(), compute_sat_hue_metrics16(), compute_sat_hue_metrics8(), config_output(), config_video_output(), copy_block(), copy_chroma(), copy_fields(), copy_from(), copy_plane(), copyadd_block(), cover_rect(), cuda_transfer_data_from(), cuda_transfer_data_to(), cuvid_output_frame(), d3d11va_transfer_data(), debug_mean_error(), decimate_frame(), decode_argb(), decode_argb_frame(), decode_argbi(), decode_argx(), decode_argxi(), decode_aybr(), decode_aybri(), decode_block(), decode_byry(), decode_byryi(), decode_c82i(), decode_c82p(), decode_ca2i(), decode_ca2p(), decode_ca4i(), decode_ca4p(), decode_frame(), decode_idat_chunk(), decode_inter(), decode_inter_plane(), decode_packet(), decode_rgb(), decode_rgb24_frame(), decode_rgbi(), decode_rgbx(), decode_rgbxi(), decode_rle(), decode_rle16(), decode_rle_bpp2(), decode_rle_bpp4(), decode_slice(), decode_slice_thread(), decode_write(), decode_ybr(), decode_ybr10(), decode_ybr10i(), decode_ybri(), decode_ybyr(), decode_yry10(), decode_yry10i(), decode_yuv_frame(), deinterlace_slice(), detect_scene_change(), dirac_decode_data_unit(), displace_packed(), displace_planar(), draw_axis_rgb(), draw_axis_yuv(), draw_blank_frame(), draw_frame(), draw_horiz_band(), draw_sono(), draw_spatial(), drawline(), drawtext(), drm_map_frame(), dxtory_decode_v1_410(), dxtory_decode_v1_420(), dxtory_decode_v1_444(), dxtory_decode_v1_rgb(), dxva2_map_frame(), dxva2_transfer_data_from(), encode_bitstream(), encode_frame(), encode_gbrp10(), encode_gbrp12(), encode_picture_ls(), encode_rgb48_10bit(), encode_slice(), escape130_decode_frame(), estimate_best_b_count(), eval_motion_dist(), ff_alloc_picture(), ff_apply_vector_2x2(), ff_apply_vector_4x4(), ff_h263_decode_frame(), ff_init_block_index(), ff_print_debug_info2(), ff_vp56_decode_mbs(), fill_picture(), fill_picture_monoblack(), fill_picture_rgb(), fill_yuv_image(), filter(), filter_frame(), filter_frame16(), filter_frame8(), filter_slice(), fits_encode_frame(), fixstride(), flashsv2_encode_frame(), flashsv_encode_frame(), frame_copy_video(), g2m_decode_frame(), gather_data_for_cel(), gather_data_for_subcel(), get_buffer(), get_scene_score(), decklink_frame::GetBytes(), decklink_frame::GetFlags(), getpix(), decklink_frame::GetRowBytes(), gif_encode_frame(), gif_fill(), gif_fill_rect(), gray16(), gray8(), h264_field_start(), h264_frame_start(), hls_prediction_unit(), image_copy_16_to_8(), init(), inject_frame(), inter_pred(), interpolate(), ir2_decode_frame(), is_frozen(), lag_decode_frame(), lagfun_frame16(), lagfun_frame8(), libopenjpeg_copy_to_packed16(), libopenjpeg_copy_to_packed8(), libopenjpeg_copyto16(), libopenjpeg_copyto8(), libopenjpeg_encode_frame(), libx265_encode_frame(), load_input_picture(), load_palette(), luma_abs_diff(), luma_mc_bi(), magy_decode_frame(), magy_decode_slice(), magy_decode_slice10(), magy_encode_frame(), mp_get_yuv_from_rgb(), mp_read_changes_map(), mp_set_rgb_from_yuv(), mpeg_motion_lowres(), mpv_reconstruct_mb_internal(), msrle_decode_8_16_24_32(), msrle_decode_pal4(), mxpeg_check_dimensions(), opencl_transfer_data_from(), overlay_ass_image(), pack_yuv(), pam_encode_frame(), pcx_decode_frame(), plot_spectrum_column(), pnm_decode_frame(), pnm_encode_frame(), pp_filter_frame(), process_frame(), process_slice_uyvy422(), process_slice_yuv420p(), process_slice_yuv422p(), process_slice_yuv444p(), ptx_decode_frame(), put_blocks(), qsv_frame_lock(), qtrle_encode_line(), request_frame(), run_test(), scale_slice(), seq_decode_op1(), seq_decode_op2(), seq_decode_op3(), seqvideo_decode(), set_frame_data(), set_processing_window(), skip_check(), smvjpeg_decode_frame(), submit_frame(), sunrast_decode_frame(), svc_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), targa_encode_normal(), targa_encode_rle(), tm2_decode_blocks(), to_meta_with_crop(), truemotion2rt_decode_frame(), try_push_frame(), txd_decode_frame(), unpack_gray(), unpack_yuv(), unrefcount_frame(), update_histogram_diff(), update_sono_rgb(), update_sono_yuv(), utvideo_encode_frame(), v308_decode_frame(), v308_encode_frame(), v408_decode_frame(), v408_encode_frame(), v410_decode_frame(), v410_encode_frame(), vaapi_map_frame(), vble_restore_plane(), vcr1_decode_frame(), vdpau_transfer_data_from(), video_decode(), video_decode_example(), video_get_buffer(), video_image_display(), videotoolbox_retrieve_data(), vp7_fade_frame(), vp8_lossy_decode_alpha(), vpx_decode(), vt_map_frame(), xbm_decode_frame(), xbm_encode_frame(), xpm_decode_frame(), xvid_encode_frame(), xwd_decode_frame(), xwd_encode_frame(), y216_decode_frame(), y41p_decode_frame(), y41p_encode_frame(), yuv4_decode_frame(), yuv4_encode_frame(), zero12v_decode_frame(), and zerocodec_decode_frame().

◆ extended_data

uint8_t** AVFrame::extended_data

pointers to the data planes/channels.

For video, this should simply point to data[].

For planar audio, each channel has a separate data pointer, and linesize[0] contains the size of each channel buffer. For packed audio, there is just one data pointer, and linesize[0] contains the total size of the buffer for all channels.

Note: Both data and extended_data should always be set in a valid frame, but for planar audio with more channels that can fit in data, extended_data must be used in order to access all channels.

Examples
transcode_aac.c.

Definition at line 342 of file frame.h.

Referenced by audio_decode_frame(), av_frame_move_ref(), av_frame_ref(), avcodec_encode_audio2(), celt_frame_setup_input(), compand_delay(), compand_drain(), compand_nodelay(), convert_coeffs(), decode_packet(), filter_channel(), filter_frame(), fir_quantum(), flush_frame(), frame_configure_elements(), frame_copy_audio(), mcompand_channel(), move_audio(), on2avc_reconstruct_channel(), on2avc_reconstruct_channel_ext(), output_frame(), read_decode_convert_and_store(), request_frame(), return_audio_frame(), run_channel_fft(), spatial_activate(), step_collect_psy_metrics(), try_push_frame(), unrefcount_frame(), and video_get_buffer().

◆ width

int AVFrame::width
Examples
hw_decode.c, muxing.c, qsvdec.c, and vaapi_encode.c.

Definition at line 353 of file frame.h.

Referenced by alloc_frame_buffer(), alloc_picture(), apng_encode_frame(), apply_color_indexing_transform(), av_frame_copy(), av_frame_move_ref(), av_frame_ref(), bidirectional_obmc(), bilateral_obmc(), blend_frame(), blend_slice_packed_rgb(), blend_slice_planar_rgb(), blend_slice_yuv(), calc_diffs(), compare(), config_input(), cover_rect(), cuvid_output_frame(), d3d11va_transfer_data(), debug_mean_error(), decklink_write_video_packet(), decode_frame(), decode_frame_common(), decode_packet(), decode_video(), decode_write(), deint_vaapi_filter_frame(), do_blend(), draw_axis_rgb(), draw_axis_yuv(), draw_frame(), drawtext(), drm_map_frame(), drm_transfer_data_from(), encode_apng(), encode_frame(), ff_libwebp_get_frame(), ff_mjpeg_decode_sos(), ff_vaapi_vpp_init_params(), filter(), filter_frame(), fixstride(), format_init(), frame_copy_props(), frame_copy_video(), get_scene_score(), getpix(), h264_field_start(), init(), init_stage(), inter_pred(), interpolate(), libopenjpeg_copy_to_packed16(), libopenjpeg_copy_to_packed8(), load_palette(), luma_abs_diff(), magy_encode_frame(), main(), mc_chroma_scaled(), mc_luma_scaled(), misc_vaapi_filter_frame(), nvdec_mjpeg_start_frame(), nvdec_mpeg12_start_frame(), nvdec_mpeg4_start_frame(), nvdec_vc1_start_frame(), nvdec_vp8_start_frame(), nvdec_vp9_start_frame(), opencl_map_frame(), overlay_ass_image(), pp_filter_frame(), procamp_vaapi_filter_frame(), qsv_frame_lock(), qsv_map_from(), qsv_map_to(), query_frame(), queue_picture(), scale_vaapi_filter_frame(), sender_thread(), set_frame_data(), set_processing_window(), smvjpeg_decode_frame(), sub2video_get_blank_frame(), submit_frame(), transpose_vaapi_filter_frame(), unrefcount_frame(), update_histogram_diff(), update_sono_rgb(), update_sono_yuv(), vaapi_map_frame(), vaapi_transfer_data_from(), var_size_bmc(), videotoolbox_retrieve_data(), and vt_transfer_data_from().

◆ height

int AVFrame::height
Examples
hw_decode.c, muxing.c, qsvdec.c, and vaapi_encode.c.

Definition at line 353 of file frame.h.

Referenced by alloc_frame_buffer(), alloc_picture(), apng_encode_frame(), av_frame_copy(), av_frame_move_ref(), av_frame_ref(), bidirectional_obmc(), bilateral_obmc(), blend_frame(), blend_slice_packed_rgb(), blend_slice_planar_rgb(), blend_slice_yuv(), calc_diffs(), compare(), config_input(), cover_rect(), cuvid_output_frame(), d3d11va_transfer_data(), debug_mean_error(), decklink_write_video_packet(), decode_frame(), decode_frame_common(), decode_packet(), decode_video(), decode_write(), deint_vaapi_filter_frame(), do_blend(), draw_axis_rgb(), draw_axis_yuv(), draw_frame(), draw_sono(), drawtext(), drm_map_frame(), drm_transfer_data_from(), encode_apng(), encode_frame(), ff_h263_decode_frame(), ff_libwebp_get_frame(), ff_mjpeg_decode_sos(), ff_vaapi_vpp_init_params(), filter(), filter_frame(), fixstride(), format_init(), frame_copy_props(), frame_copy_video(), get_scene_score(), decklink_frame::GetBytes(), getpix(), gif_fill(), h264_field_start(), init(), init_stage(), inter_pred(), interpolate(), libopenjpeg_copy_to_packed16(), libopenjpeg_copy_to_packed8(), load_palette(), luma_abs_diff(), magy_encode_frame(), main(), mc_chroma_scaled(), mc_luma_scaled(), misc_vaapi_filter_frame(), nvdec_mjpeg_start_frame(), nvdec_mpeg12_start_frame(), nvdec_mpeg4_start_frame(), nvdec_vc1_start_frame(), nvdec_vp8_start_frame(), nvdec_vp9_start_frame(), opencl_map_frame(), overlay_ass_image(), pp_filter_frame(), procamp_vaapi_filter_frame(), qsv_frame_lock(), qsv_map_from(), qsv_map_to(), query_frame(), queue_picture(), scale_vaapi_filter_frame(), sender_thread(), set_frame_data(), set_processing_window(), smvjpeg_decode_frame(), sub2video_get_blank_frame(), submit_frame(), transpose_vaapi_filter_frame(), unrefcount_frame(), update_histogram_diff(), vaapi_map_frame(), vaapi_transfer_data_from(), var_size_bmc(), videotoolbox_retrieve_data(), and vt_transfer_data_from().

◆ nb_samples

int AVFrame::nb_samples

◆ format

int AVFrame::format

format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames, enum AVSampleFormat for audio)

Examples
hw_decode.c, muxing.c, and vaapi_encode.c.

Definition at line 368 of file frame.h.

Referenced by alloc_frame_buffer(), alloc_picture(), apng_encode_frame(), audio_decode_frame(), av_frame_copy(), av_frame_ref(), av_hwframe_map(), avfilter_link(), bmp_decode_frame(), buffer_offset(), celt_frame_setup_input(), clear_unused_frames(), config_input(), config_output(), config_props(), cuvid_output_frame(), d3d11va_transfer_data(), decode_frame(), decode_frame_common(), decode_packet(), decode_video(), decode_write(), deint_vaapi_filter_frame(), drm_map_from(), drm_transfer_data_from(), dxva2_map_frame(), dxva2_map_from(), dxva2_transfer_data_from(), dxva2_transfer_data_to(), encode_apng(), encode_frame(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_filter_frame(), ff_h263_decode_frame(), ff_libwebp_get_frame(), ff_mjpeg_decode_sos(), ff_tlog_link(), fill_frameinfo_by_link(), filter(), filter_frame(), fixstride(), frame_copy_audio(), frame_copy_video(), h264_field_start(), handle_p_frame_png(), have_alpha_planar(), image_copy_16_to_8(), init(), jpeg2000_decode_tile(), libopenjpeg_copy_to_packed16(), libopenjpeg_copyto16(), main(), misc_vaapi_filter_frame(), opencl_map_frame(), opencl_map_from(), opencl_map_to(), opencl_transfer_data_from(), output_frame(), pick_format(), print_digraph(), print_link_prop(), procamp_vaapi_filter_frame(), qsv_frame_lock(), qsv_map_from(), queue_picture(), request_frame(), return_audio_frame(), run_test(), scale_vaapi_filter_frame(), sender_thread(), sub2video_get_blank_frame(), submit_frame(), take_samples(), tiff_unpack_strip(), transfer_data_alloc(), transpose_vaapi_filter_frame(), unrefcount_frame(), update_sono_yuv(), vaapi_map_frame(), vaapi_map_from(), vaapi_map_to_memory(), vaapi_transfer_data_from(), vdpau_transfer_data_from(), video_get_buffer(), videotoolbox_retrieve_data(), vt_map_frame(), and vt_transfer_data_from().

◆ key_frame

int AVFrame::key_frame

◆ pict_type

enum AVPictureType AVFrame::pict_type

Picture type of the frame.

Examples
transcoding.c.

Definition at line 378 of file frame.h.

Referenced by avs_decode_frame(), avui_decode_frame(), bmp_decode_frame(), bmp_encode_frame(), cdxl_decode_frame(), cllc_decode_frame(), decode_frame(), decode_idat_chunk(), decode_video(), dirac_decode_data_unit(), dnxhd_decode_frame(), dnxhd_encode_init(), do_video_out(), dxv_decode(), encode_frame(), encode_init(), ff_draw_horiz_band(), ff_mpeg4_encode_mb(), ff_print_debug_info2(), ff_qsv_encode(), ff_vc1_parse_frame_header_adv(), ff_vp56_decode_mbs(), filter_encode_write_frame(), filter_frame(), fits_decode_frame(), flashsv_encode_frame(), frame_copy_props(), g2m_decode_frame(), h264_frame_start(), h264_select_output_frame(), hap_decode(), hq_hqa_decode_frame(), jpeg2000_decode_frame(), lag_decode_frame(), libopenjpeg_decode_frame(), libx265_encode_frame(), ljpeg_encode_init(), magy_decode_frame(), mxpeg_decode_frame(), pam_encode_init(), pcx_decode_frame(), pcx_encode_init(), pixlet_decode_frame(), png_enc_init(), pnm_decode_frame(), pnm_encode_init(), pp_filter_frame(), process_output_surface(), ptx_decode_frame(), qtrle_encode_frame(), queue_picture(), ratecontrol_1pass(), raw_encode_init(), set_direct_mv(), storeframe(), sunrast_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), targa_encode_init(), truemotion2rt_decode_frame(), txd_decode_frame(), utvideo_encode_frame(), v308_decode_frame(), v408_decode_frame(), v410_decode_frame(), v410_encode_frame(), vble_decode_frame(), vc1_decode_frame(), vcr1_decode_frame(), vp8_lossless_decode_frame(), XAVS_frame(), xbm_decode_frame(), xpm_decode_frame(), xvid_encode_frame(), xwd_decode_frame(), xwd_encode_frame(), y216_decode_frame(), y41p_decode_frame(), yuv4_decode_frame(), zero12v_decode_frame(), and zerocodec_decode_frame().

◆ sample_aspect_ratio

AVRational AVFrame::sample_aspect_ratio

◆ pts

int64_t AVFrame::pts

◆ pkt_pts

attribute_deprecated int64_t AVFrame::pkt_pts

PTS copied from the AVPacket that was decoded to produce this frame.

Deprecated:
use the pts field instead

Definition at line 396 of file frame.h.

Referenced by frame_copy_props(), and svc_decode_frame().

◆ pkt_dts

int64_t AVFrame::pkt_dts

DTS copied from the AVPacket that triggered returning this frame.

(if frame threading isn't used) This is also the Presentation time of this AVFrame calculated from only AVPacket.dts values without pts values.

Definition at line 404 of file frame.h.

Referenced by ff_thread_decode_frame(), frame_copy_props(), svc_decode_frame(), and video_decode_example().

◆ coded_picture_number

int AVFrame::coded_picture_number

picture number in bitstream order

Definition at line 409 of file frame.h.

Referenced by decode_packet(), ff_mpv_frame_start(), frame_copy_props(), and h264_frame_start().

◆ display_picture_number

int AVFrame::display_picture_number

picture number in display order

Definition at line 413 of file frame.h.

Referenced by dirac_decode_frame(), frame_copy_props(), and load_input_picture().

◆ quality

int AVFrame::quality

quality (between 1 (good) and FF_LAMBDA_MAX (bad))

Definition at line 418 of file frame.h.

Referenced by dnxhd_encode_picture(), do_video_out(), encode_frame(), filter(), frame_copy_props(), ratecontrol_1pass(), svq1_encode_frame(), XAVS_frame(), and xvid_encode_frame().

◆ opaque

void* AVFrame::opaque

for some private data of the user

Definition at line 423 of file frame.h.

Referenced by ff_print_debug_info2(), and frame_copy_props().

◆ error

attribute_deprecated uint64_t AVFrame::error[AV_NUM_DATA_POINTERS]
Deprecated:
unused

Definition at line 430 of file frame.h.

Referenced by frame_copy_props(), and storeframe().

◆ repeat_pict

int AVFrame::repeat_pict

When decoding, this signals how much the picture must be delayed.

extra_delay = repeat_pict / (2*fps)

Definition at line 437 of file frame.h.

Referenced by ff_yadif_filter_frame(), frame_copy_props(), h264_export_frame_props(), and submit_frame().

◆ interlaced_frame

int AVFrame::interlaced_frame

◆ top_field_first

int AVFrame::top_field_first

◆ palette_has_changed

int AVFrame::palette_has_changed

Tell user application that palette has changed from previous frame.

Definition at line 452 of file frame.h.

Referenced by cdg_load_palette(), cinvideo_decode_frame(), decode_frame(), frame_copy_props(), and seqvideo_decode().

◆ reordered_opaque

int64_t AVFrame::reordered_opaque

reordered opaque 64 bits (generally an integer or a double precision float PTS but can be anything).

The user sets AVCodecContext.reordered_opaque to represent the input at that time, the decoder reorders values as needed and sets AVFrame.reordered_opaque to exactly one of the values provided by the user through AVCodecContext.reordered_opaque

Definition at line 462 of file frame.h.

Referenced by frame_copy_props().

◆ sample_rate

int AVFrame::sample_rate

◆ channel_layout

uint64_t AVFrame::channel_layout

◆ buf

AVBuffer references backing the data for this frame.

If all elements of this array are NULL, then this frame is not reference counted. This array must be filled contiguously – if buf[i] is non-NULL then buf[j] must also be non-NULL for all j < i.

There may be at most one AVBuffer per data plane, so for video this array always contains all the references. For planar audio with more than AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in this array. Then the extra AVBufferRef pointers are stored in the extended_buf array.

Definition at line 486 of file frame.h.

Referenced by av_frame_ref(), av_hwframe_transfer_data(), avcodec_receive_frame(), avcodec_send_packet(), ff_alloc_picture(), ff_h264_build_ref_list(), ff_h264_ref_picture(), ff_h264_unref_picture(), ff_hwframe_map_create(), ff_hwframe_map_replace(), ff_mpeg_ref_picture(), frame_worker_thread(), h264_decode_frame(), h264_initialise_ref_list(), h264_slice_init(), load_input_picture(), pic_is_unused(), qsv_frame_lock(), qsv_transfer_data_child(), and video_get_buffer().

◆ extended_buf

AVBufferRef** AVFrame::extended_buf

For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf.

Note that this is different from AVFrame.extended_data, which always contains all the pointers. This array only contains the extra pointers, which cannot fit into AVFrame.buf.

This array is always allocated using av_malloc() by whoever constructs the frame. It is freed in av_frame_unref().

Definition at line 500 of file frame.h.

Referenced by av_frame_ref().

◆ nb_extended_buf

int AVFrame::nb_extended_buf

Number of elements in extended_buf.

Definition at line 504 of file frame.h.

Referenced by av_frame_ref().

◆ side_data

AVFrameSideData** AVFrame::side_data

Definition at line 506 of file frame.h.

◆ nb_side_data

int AVFrame::nb_side_data

Definition at line 507 of file frame.h.

◆ flags

int AVFrame::flags

◆ color_range

enum AVColorRange AVFrame::color_range

MPEG vs JPEG YUV range.

  • encoding: Set by user
  • decoding: Set by libavcodec

Definition at line 539 of file frame.h.

Referenced by config_output(), frame_copy_props(), magy_decode_frame(), pixlet_decode_frame(), and vaapi_vpp_colour_properties().

◆ color_primaries

enum AVColorPrimaries AVFrame::color_primaries

◆ color_trc

enum AVColorTransferCharacteristic AVFrame::color_trc

◆ colorspace

enum AVColorSpace AVFrame::colorspace

YUV colorspace type.

  • encoding: Set by user
  • decoding: Set by libavcodec

Definition at line 550 of file frame.h.

Referenced by encode_frame(), frame_copy_props(), magy_decode_frame(), prores_encode_frame(), and vaapi_vpp_colour_properties().

◆ chroma_location

enum AVChromaLocation AVFrame::chroma_location

Definition at line 552 of file frame.h.

Referenced by format_init(), frame_copy_props(), and vaapi_vpp_colour_properties().

◆ best_effort_timestamp

int64_t AVFrame::best_effort_timestamp

frame timestamp estimated using various heuristics, in stream time base

  • encoding: unused
  • decoding: set by libavcodec, read by user.

Definition at line 559 of file frame.h.

Referenced by decode_video(), and frame_copy_props().

◆ pkt_pos

int64_t AVFrame::pkt_pos

reordered pos from the last AVPacket that has been input into the decoder

  • encoding: unused
  • decoding: Read by user.

Definition at line 566 of file frame.h.

Referenced by do_blend(), frame_copy_props(), and request_frame().

◆ pkt_duration

int64_t AVFrame::pkt_duration

duration of the corresponding packet, expressed in AVStream->time_base units, 0 if unknown.

  • encoding: unused
  • decoding: Read by user.

Definition at line 574 of file frame.h.

Referenced by compute_crc_of_packets(), decode_video(), do_video_out(), frame_copy_props(), and video_decode_example().

◆ metadata

AVDictionary* AVFrame::metadata

metadata.

  • encoding: Set by user.
  • decoding: Set by libavcodec.

Definition at line 581 of file frame.h.

Referenced by decode_frame(), decode_frame_common(), filter(), filter_frame(), fits_decode_frame(), frame_copy_props(), output_frame(), receiver_thread(), sender_thread(), and set_meta().

◆ decode_error_flags

int AVFrame::decode_error_flags

decode error flags of the frame, set to a combination of FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there were errors during the decoding.

  • encoding: unused
  • decoding: set by libavcodec, read by user.

Definition at line 590 of file frame.h.

Referenced by check_decode_result(), and frame_copy_props().

◆ channels

int AVFrame::channels

◆ pkt_size

int AVFrame::pkt_size

size of the corresponding packet containing the compressed frame.

It is set to a negative value if unknown.

  • encoding: unused
  • decoding: set by libavcodec, read by user.

Definition at line 610 of file frame.h.

Referenced by frame_copy_props().

◆ qscale_table

attribute_deprecated int8_t* AVFrame::qscale_table

QP table.

Definition at line 617 of file frame.h.

Referenced by ff_print_debug_info2(), and frame_copy_props().

◆ qstride

attribute_deprecated int AVFrame::qstride

QP store stride.

Definition at line 622 of file frame.h.

Referenced by frame_copy_props().

◆ qscale_type

attribute_deprecated int AVFrame::qscale_type

Definition at line 625 of file frame.h.

Referenced by frame_copy_props().

◆ qp_table_buf

attribute_deprecated AVBufferRef* AVFrame::qp_table_buf

Definition at line 628 of file frame.h.

Referenced by frame_copy_props().

◆ hw_frames_ctx

AVBufferRef* AVFrame::hw_frames_ctx

◆ opaque_ref

AVBufferRef* AVFrame::opaque_ref

AVBufferRef for free use by the API user.

FFmpeg will never check the contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. av_frame_copy_props() calls create a new reference with av_buffer_ref() for the target frame's opaque_ref field.

This is unrelated to the opaque field, although it serves a similar purpose.

Definition at line 645 of file frame.h.

Referenced by frame_copy_props().

◆ crop_top

size_t AVFrame::crop_top

Definition at line 655 of file frame.h.

Referenced by ff_vaapi_vpp_init_params(), frame_copy_props(), and h264_frame_start().

◆ crop_bottom

size_t AVFrame::crop_bottom

Definition at line 656 of file frame.h.

Referenced by ff_vaapi_vpp_init_params(), frame_copy_props(), and h264_frame_start().

◆ crop_left

size_t AVFrame::crop_left

Definition at line 657 of file frame.h.

Referenced by ff_vaapi_vpp_init_params(), frame_copy_props(), and h264_frame_start().

◆ crop_right

size_t AVFrame::crop_right

Definition at line 658 of file frame.h.

Referenced by ff_vaapi_vpp_init_params(), frame_copy_props(), and h264_frame_start().

◆ private_ref

AVBufferRef* AVFrame::private_ref

AVBufferRef for internal use by a single libav* library.

Must not be used to transfer data between libraries. Has to be NULL when ownership of the frame leaves the respective library.

Code outside the FFmpeg libs should never check or change the contents of the buffer ref.

FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. av_frame_copy_props() calls create a new reference with av_buffer_ref() for the target frame's private_ref field.

Definition at line 674 of file frame.h.

Referenced by frame_copy_props(), nvdec_mjpeg_start_frame(), nvdec_mpeg12_start_frame(), nvdec_mpeg4_start_frame(), nvdec_vc1_start_frame(), nvdec_vp8_start_frame(), and nvdec_vp9_start_frame().


The documentation for this struct was generated from the following file: