Go to the documentation of this file.
21 #ifndef AVCODEC_AVCODEC_H
22 #define AVCODEC_AVCODEC_H
46 #ifndef HAVE_AV_CONFIG_H
190 #if FF_API_BUFFER_MIN_SIZE
198 #define AV_INPUT_BUFFER_MIN_SIZE 16384
220 #define AV_CODEC_FLAG_UNALIGNED (1 << 0)
224 #define AV_CODEC_FLAG_QSCALE (1 << 1)
228 #define AV_CODEC_FLAG_4MV (1 << 2)
232 #define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3)
236 #define AV_CODEC_FLAG_QPEL (1 << 4)
237 #if FF_API_DROPCHANGED
244 #define AV_CODEC_FLAG_DROPCHANGED (1 << 5)
264 #define AV_CODEC_FLAG_RECON_FRAME (1 << 6)
299 #define AV_CODEC_FLAG_COPY_OPAQUE (1 << 7)
306 #define AV_CODEC_FLAG_FRAME_DURATION (1 << 8)
310 #define AV_CODEC_FLAG_PASS1 (1 << 9)
314 #define AV_CODEC_FLAG_PASS2 (1 << 10)
318 #define AV_CODEC_FLAG_LOOP_FILTER (1 << 11)
322 #define AV_CODEC_FLAG_GRAY (1 << 13)
326 #define AV_CODEC_FLAG_PSNR (1 << 15)
330 #define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18)
334 #define AV_CODEC_FLAG_LOW_DELAY (1 << 19)
338 #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
342 #define AV_CODEC_FLAG_BITEXACT (1 << 23)
347 #define AV_CODEC_FLAG_AC_PRED (1 << 24)
351 #define AV_CODEC_FLAG_INTERLACED_ME (1 << 29)
352 #define AV_CODEC_FLAG_CLOSED_GOP (1U << 31)
357 #define AV_CODEC_FLAG2_FAST (1 << 0)
361 #define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2)
365 #define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3)
371 #define AV_CODEC_FLAG2_CHUNKS (1 << 15)
375 #define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16)
380 #define AV_CODEC_FLAG2_SHOW_ALL (1 << 22)
384 #define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28)
388 #define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29)
392 #define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30)
398 #define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31)
406 #define AV_CODEC_EXPORT_DATA_MVS (1 << 0)
410 #define AV_CODEC_EXPORT_DATA_PRFT (1 << 1)
415 #define AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS (1 << 2)
420 #define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3)
425 #define AV_GET_BUFFER_FLAG_REF (1 << 0)
430 #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0)
562 #if FF_API_TICKS_PER_FRAME
731 #define SLICE_FLAG_CODED_ORDER 0x0001
732 #define SLICE_FLAG_ALLOW_FIELD 0x0002
733 #define SLICE_FLAG_ALLOW_PLANE 0x0004
897 #define FF_CMP_SATD 2
899 #define FF_CMP_PSNR 4
902 #define FF_CMP_ZERO 7
903 #define FF_CMP_VSAD 8
904 #define FF_CMP_VSSE 9
905 #define FF_CMP_NSSE 10
906 #define FF_CMP_W53 11
907 #define FF_CMP_W97 12
908 #define FF_CMP_DCTMAX 13
909 #define FF_CMP_DCT264 14
910 #define FF_CMP_MEDIAN_SAD 15
911 #define FF_CMP_CHROMA 256
963 #define FF_MB_DECISION_SIMPLE 0
964 #define FF_MB_DECISION_BITS 1
965 #define FF_MB_DECISION_RD 2
1246 #define FF_COMPRESSION_DEFAULT -1
1350 #define FF_BUG_AUTODETECT 1
1351 #define FF_BUG_XVID_ILACE 4
1352 #define FF_BUG_UMP4 8
1353 #define FF_BUG_NO_PADDING 16
1354 #define FF_BUG_AMV 32
1355 #define FF_BUG_QPEL_CHROMA 64
1356 #define FF_BUG_STD_QPEL 128
1357 #define FF_BUG_QPEL_CHROMA2 256
1358 #define FF_BUG_DIRECT_BLOCKSIZE 512
1359 #define FF_BUG_EDGE 1024
1360 #define FF_BUG_HPEL_CHROMA 2048
1361 #define FF_BUG_DC_CLIP 4096
1362 #define FF_BUG_MS 8192
1363 #define FF_BUG_TRUNCATED 16384
1364 #define FF_BUG_IEDGE 32768
1387 #define FF_EC_GUESS_MVS 1
1388 #define FF_EC_DEBLOCK 2
1389 #define FF_EC_FAVOR_INTER 256
1397 #define FF_DEBUG_PICT_INFO 1
1398 #define FF_DEBUG_RC 2
1399 #define FF_DEBUG_BITSTREAM 4
1400 #define FF_DEBUG_MB_TYPE 8
1401 #define FF_DEBUG_QP 16
1402 #define FF_DEBUG_DCT_COEFF 0x00000040
1403 #define FF_DEBUG_SKIP 0x00000080
1404 #define FF_DEBUG_STARTCODE 0x00000100
1405 #define FF_DEBUG_ER 0x00000400
1406 #define FF_DEBUG_MMCO 0x00000800
1407 #define FF_DEBUG_BUGS 0x00001000
1408 #define FF_DEBUG_BUFFERS 0x00008000
1409 #define FF_DEBUG_THREADS 0x00010000
1410 #define FF_DEBUG_GREEN_MD 0x00800000
1411 #define FF_DEBUG_NOMC 0x01000000
1535 #define FF_DCT_AUTO 0
1536 #define FF_DCT_FASTINT 1
1537 #define FF_DCT_INT 2
1538 #define FF_DCT_MMX 3
1539 #define FF_DCT_ALTIVEC 5
1540 #define FF_DCT_FAAN 6
1548 #define FF_IDCT_AUTO 0
1549 #define FF_IDCT_INT 1
1550 #define FF_IDCT_SIMPLE 2
1551 #define FF_IDCT_SIMPLEMMX 3
1552 #define FF_IDCT_ARM 7
1553 #define FF_IDCT_ALTIVEC 8
1554 #define FF_IDCT_SIMPLEARM 10
1555 #define FF_IDCT_XVID 14
1556 #define FF_IDCT_SIMPLEARMV5TE 16
1557 #define FF_IDCT_SIMPLEARMV6 17
1558 #define FF_IDCT_FAAN 20
1559 #define FF_IDCT_SIMPLENEON 22
1560 #define FF_IDCT_SIMPLEAUTO 128
1593 #define FF_THREAD_FRAME 1
1594 #define FF_THREAD_SLICE 2
1640 #if FF_API_FF_PROFILE_LEVEL
1643 #define FF_PROFILE_UNKNOWN -99
1644 #define FF_PROFILE_RESERVED -100
1646 #define FF_PROFILE_AAC_MAIN 0
1647 #define FF_PROFILE_AAC_LOW 1
1648 #define FF_PROFILE_AAC_SSR 2
1649 #define FF_PROFILE_AAC_LTP 3
1650 #define FF_PROFILE_AAC_HE 4
1651 #define FF_PROFILE_AAC_HE_V2 28
1652 #define FF_PROFILE_AAC_LD 22
1653 #define FF_PROFILE_AAC_ELD 38
1654 #define FF_PROFILE_MPEG2_AAC_LOW 128
1655 #define FF_PROFILE_MPEG2_AAC_HE 131
1657 #define FF_PROFILE_DNXHD 0
1658 #define FF_PROFILE_DNXHR_LB 1
1659 #define FF_PROFILE_DNXHR_SQ 2
1660 #define FF_PROFILE_DNXHR_HQ 3
1661 #define FF_PROFILE_DNXHR_HQX 4
1662 #define FF_PROFILE_DNXHR_444 5
1664 #define FF_PROFILE_DTS 20
1665 #define FF_PROFILE_DTS_ES 30
1666 #define FF_PROFILE_DTS_96_24 40
1667 #define FF_PROFILE_DTS_HD_HRA 50
1668 #define FF_PROFILE_DTS_HD_MA 60
1669 #define FF_PROFILE_DTS_EXPRESS 70
1670 #define FF_PROFILE_DTS_HD_MA_X 61
1671 #define FF_PROFILE_DTS_HD_MA_X_IMAX 62
1674 #define FF_PROFILE_EAC3_DDP_ATMOS 30
1676 #define FF_PROFILE_TRUEHD_ATMOS 30
1678 #define FF_PROFILE_MPEG2_422 0
1679 #define FF_PROFILE_MPEG2_HIGH 1
1680 #define FF_PROFILE_MPEG2_SS 2
1681 #define FF_PROFILE_MPEG2_SNR_SCALABLE 3
1682 #define FF_PROFILE_MPEG2_MAIN 4
1683 #define FF_PROFILE_MPEG2_SIMPLE 5
1685 #define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
1686 #define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
1688 #define FF_PROFILE_H264_BASELINE 66
1689 #define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
1690 #define FF_PROFILE_H264_MAIN 77
1691 #define FF_PROFILE_H264_EXTENDED 88
1692 #define FF_PROFILE_H264_HIGH 100
1693 #define FF_PROFILE_H264_HIGH_10 110
1694 #define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA)
1695 #define FF_PROFILE_H264_MULTIVIEW_HIGH 118
1696 #define FF_PROFILE_H264_HIGH_422 122
1697 #define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA)
1698 #define FF_PROFILE_H264_STEREO_HIGH 128
1699 #define FF_PROFILE_H264_HIGH_444 144
1700 #define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
1701 #define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
1702 #define FF_PROFILE_H264_CAVLC_444 44
1704 #define FF_PROFILE_VC1_SIMPLE 0
1705 #define FF_PROFILE_VC1_MAIN 1
1706 #define FF_PROFILE_VC1_COMPLEX 2
1707 #define FF_PROFILE_VC1_ADVANCED 3
1709 #define FF_PROFILE_MPEG4_SIMPLE 0
1710 #define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1
1711 #define FF_PROFILE_MPEG4_CORE 2
1712 #define FF_PROFILE_MPEG4_MAIN 3
1713 #define FF_PROFILE_MPEG4_N_BIT 4
1714 #define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5
1715 #define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
1716 #define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
1717 #define FF_PROFILE_MPEG4_HYBRID 8
1718 #define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
1719 #define FF_PROFILE_MPEG4_CORE_SCALABLE 10
1720 #define FF_PROFILE_MPEG4_ADVANCED_CODING 11
1721 #define FF_PROFILE_MPEG4_ADVANCED_CORE 12
1722 #define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
1723 #define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14
1724 #define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15
1726 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
1727 #define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
1728 #define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
1729 #define FF_PROFILE_JPEG2000_DCINEMA_2K 3
1730 #define FF_PROFILE_JPEG2000_DCINEMA_4K 4
1732 #define FF_PROFILE_VP9_0 0
1733 #define FF_PROFILE_VP9_1 1
1734 #define FF_PROFILE_VP9_2 2
1735 #define FF_PROFILE_VP9_3 3
1737 #define FF_PROFILE_HEVC_MAIN 1
1738 #define FF_PROFILE_HEVC_MAIN_10 2
1739 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3
1740 #define FF_PROFILE_HEVC_REXT 4
1741 #define FF_PROFILE_HEVC_SCC 9
1743 #define FF_PROFILE_VVC_MAIN_10 1
1744 #define FF_PROFILE_VVC_MAIN_10_444 33
1746 #define FF_PROFILE_AV1_MAIN 0
1747 #define FF_PROFILE_AV1_HIGH 1
1748 #define FF_PROFILE_AV1_PROFESSIONAL 2
1750 #define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
1751 #define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
1752 #define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
1753 #define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
1754 #define FF_PROFILE_MJPEG_JPEG_LS 0xf7
1756 #define FF_PROFILE_SBC_MSBC 1
1758 #define FF_PROFILE_PRORES_PROXY 0
1759 #define FF_PROFILE_PRORES_LT 1
1760 #define FF_PROFILE_PRORES_STANDARD 2
1761 #define FF_PROFILE_PRORES_HQ 3
1762 #define FF_PROFILE_PRORES_4444 4
1763 #define FF_PROFILE_PRORES_XQ 5
1765 #define FF_PROFILE_ARIB_PROFILE_A 0
1766 #define FF_PROFILE_ARIB_PROFILE_C 1
1768 #define FF_PROFILE_KLVA_SYNC 0
1769 #define FF_PROFILE_KLVA_ASYNC 1
1771 #define FF_PROFILE_EVC_BASELINE 0
1772 #define FF_PROFILE_EVC_MAIN 1
1784 #if FF_API_FF_PROFILE_LEVEL
1787 #define FF_LEVEL_UNKNOWN -99
1796 #define FF_CODEC_PROPERTY_LOSSLESS 0x00000001
1797 #define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002
1798 #define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004
1877 #define FF_SUB_CHARENC_MODE_DO_NOTHING -1
1878 #define FF_SUB_CHARENC_MODE_AUTOMATIC 0
1879 #define FF_SUB_CHARENC_MODE_PRE_DECODER 1
1880 #define FF_SUB_CHARENC_MODE_IGNORE 2
2128 #define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200
2138 #define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
2144 #define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1)
2158 #define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2)
2174 #define AV_HWACCEL_FLAG_UNSAFE_OUTPUT (1 << 3)
2198 #define AV_SUBTITLE_FLAG_FORCED 0x00000001
2372 #if FF_API_AVCODEC_CLOSE
2467 int *got_sub_ptr,
const AVPacket *avpkt);
2734 #define AV_PARSER_PTS_NB 4
2741 #define PARSER_FLAG_COMPLETE_FRAMES 0x0001
2742 #define PARSER_FLAG_ONCE 0x0002
2744 #define PARSER_FLAG_FETCHED_OFFSET 0x0004
2745 #define PARSER_FLAG_USE_CODEC_TS 0x1000
2874 const uint8_t **poutbuf,
int *poutbuf_size,
2875 const uint8_t *buf,
int buf_size);
2926 uint8_t **poutbuf,
int *poutbuf_size,
2927 const uint8_t *buf,
int buf_size,
2993 int has_alpha,
int *loss_ptr);
3032 int buf_size,
int align);
int(* func)(AVBPrint *dst, const char *in, const char *arg)
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
int frame_size
Number of samples per channel in an audio frame.
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
void * hwaccel_context
Legacy hardware accelerator context.
static enum AVPixelFormat hw_pix_fmt
AVPixelFormat
Pixel format.
int keyint_min
minimum GOP size
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
Read encoded data from the encoder.
int workaround_bugs
Work around bugs in encoders which sometimes cannot be detected automatically.
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
Callback to negotiate the pixel format.
int dts_sync_point
Synchronization point for start of timestamp generation.
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
enum AVColorSpace colorspace
YUV colorspace type.
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVFrameSideData ** decoded_side_data
Array containing static side data, such as HDR10 CLL / MDCV structures.
const AVClass * av_class
information on struct for av_log
int sample_rate
samples per second
int64_t rc_min_rate
minimum bitrate
int output_picture_number
Picture number incremented in presentation or output order.
This struct describes the properties of an encoded stream.
enum AVMediaType type
Type of codec implemented by the hardware accelerator.
@ AV_PICTURE_STRUCTURE_UNKNOWN
unknown
int duration
Duration of the current frame.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
const struct AVCodecDescriptor * codec_descriptor
AVCodecDescriptor.
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
const AVCodecParser * av_parser_iterate(void **opaque)
Iterate over all registered codec parsers.
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions,...
int mv0_threshold
Note: Value depends upon the compare function used for fullpel ME.
float lumi_masking
luminance masking (0-> disabled)
This structure describes decoded (raw) audio or video data.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
int pts_dts_delta
Presentation delay of current frame in units of AVCodecContext.time_base.
enum AVFieldOrder field_order
Field order.
int capabilities
Hardware accelerated codec capabilities.
float b_quant_offset
qscale offset between IP and B-frames
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
uint8_t * subtitle_header
int cur_frame_start_index
int me_pre_cmp
motion estimation prepass comparison function
AVColorPrimaries
Chromaticity coordinates of the source primaries.
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *pix_fmt_list, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
Find the best pixel format to convert to given a certain source pixel format.
int mb_decision
macroblock decision mode
int avcodec_is_open(AVCodecContext *s)
int qmax
maximum quantizer
int coded_width
Dimensions of the coded video.
int me_subpel_quality
subpel ME quality
int mb_cmp
macroblock comparison function (not supported yet)
unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt)
Return a value representing the fourCC code associated to the pixel format pix_fmt,...
@ SUBTITLE_ASS
Formatted text, the ass field must be set by the decoder and is authoritative.
const struct AVCodecParser * parser
int skip_top
Number of macroblock rows at the top which are skipped.
int64_t offset
byte offset from starting packet start
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
enum AVDiscard skip_idct
Skip IDCT/dequantization for selected frames.
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
const struct AVCodec * codec
AVChannelLayout ch_layout
Audio channel layout.
enum AVDiscard skip_frame
Skip decoding for selected frames.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
int x
top left corner of pict, undefined when pict is not set
int initial_padding
Audio only.
int refs
number of reference frames
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int, int), void *arg, int *ret, int count)
int flags
AV_CODEC_FLAG_*.
int bit_rate_tolerance
number of bits the bitstream is allowed to diverge from the reference.
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
int dct_algo
DCT algorithm, see FF_DCT_* below.
AVCodecParserContext * av_parser_init(int codec_id)
int64_t max_samples
The number of samples per frame to maximally accept.
char * ass
0 terminated ASS/SSA compatible event line.
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
Decode a subtitle message.
@ AV_PICTURE_STRUCTURE_FRAME
coded as frame
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
int64_t cur_frame_end[AV_PARSER_PTS_NB]
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int * side_data_prefer_packet
Decoding only.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
This struct describes the properties of a single codec described by an AVCodecID.
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
int global_quality
Global quality for codecs which cannot change it per frame.
static enum AVPixelFormat pix_fmt
int y
top left corner of pict, undefined when pict is not set
int error_concealment
error concealment flags
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used...
attribute_deprecated int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
int thread_type
Which multithreading methods to use.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align)
Fill AVFrame audio data and linesize pointers.
int format
The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat...
int64_t pts
Same as packet pts, in AV_TIME_BASE.
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
int64_t max_pixels
The number of pixels per image to maximally accept.
int64_t rc_max_rate
maximum bitrate
uint64_t error[AV_NUM_DATA_POINTERS]
error
char * text
0 terminated plain UTF-8 text
float p_masking
p block masking (0-> disabled)
int dts_ref_dts_delta
Offset of the current timestamp against last timestamp sync point in units of AVCodecContext....
int repeat_pict
This field is used for proper frame duration computation in lavf.
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
coded as bottom field
int rc_buffer_size
decoder bitstream buffer size
char * sub_charenc
Character encoding of the input subtitles file.
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
int w
width of pict, undefined when pict is not set
Describe the class of an AVClass context structure.
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
int apply_cropping
Video decoding only.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
int slice_flags
slice flags
void(* parser_close)(AVCodecParserContext *s)
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Rational number (pair of numerator and denominator).
float qblur
amount of qscale smoothing over time (0.0-1.0)
@ AV_PICTURE_STRUCTURE_TOP_FIELD
coded as top field
int64_t bit_rate
the average bitrate
int(* split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
int subtitle_header_size
Header containing style information for text subtitles.
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
int trailing_padding
Audio only.
int ildct_cmp
interlaced DCT comparison function
const char * avcodec_license(void)
Return the libavcodec license.
float rc_min_vbv_overflow_use
Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow.
int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
unsigned avcodec_version(void)
Return the LIBAVCODEC_VERSION_INT constant.
int me_cmp
motion estimation comparison function
enum AVPictureStructure picture_structure
Indicate whether a picture is coded as a frame, top field or bottom field.
int trellis
trellis RD quantization
int level
Encoding level descriptor.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
const AVClass * avcodec_get_subtitle_rect_class(void)
Get the AVClass for AVSubtitleRect.
AVCodecID
Identify the syntax and semantics of the bitstream.
float temporal_cplx_masking
temporary complexity masking (0-> disabled)
float qcompress
amount of qscale change between easy & hard scenes (0.0-1.0)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
const OptionDef options[]
char * stats_out
pass1 encoding statistics output buffer
int flags2
AV_CODEC_FLAG2_*.
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
int extra_hw_frames
Video decoding only.
An AVChannelLayout holds information about the channel layout of audio data.
int64_t next_frame_offset
int64_t cur_frame_offset[AV_PARSER_PTS_NB]
enum AVSampleFormat sample_fmt
audio sample format
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
int width
Dimensions of the decoded video intended for presentation.
#define AV_NUM_DATA_POINTERS
int me_range
maximum motion estimation search range in subpel units If 0 then no limit.
int(* parser_parse)(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int skip_alpha
Skip processing alpha if supported by codec.
uint16_t * chroma_intra_matrix
custom intra quantization matrix
int skip_bottom
Number of macroblock rows at the bottom which are skipped.
int last_predictor_count
amount of previous MV predictors (2a+1 x 2a+1 square)
uint32_t end_display_time
@ SUBTITLE_TEXT
Plain text, the text field must be set by the decoder and is authoritative.
static const uint8_t *BS_FUNC() align(BSCTX *bc)
Skip bits to a byte boundary.
#define attribute_deprecated
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
int me_sub_cmp
subpixel motion estimation comparison function
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
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 offset
enum AVSampleFormat request_sample_fmt
desired sample format
enum AVDiscard skip_loop_filter
Skip loop filtering for selected frames.
unsigned nb_side_data_prefer_packet
Number of entries in side_data_prefer_packet.
@ SUBTITLE_BITMAP
A bitmap, pict will be set.
float b_quant_factor
qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q...
int64_t cur_frame_pts[AV_PARSER_PTS_NB]
AVChromaLocation
Location of chroma samples.
int64_t cur_frame_pos[AV_PARSER_PTS_NB]
Position of the packet in file.
const char * name
Name of the hardware accelerated codec.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
int64_t pos
Byte position of currently parsed frame in stream.
unsigned properties
Properties of the stream that gets decoded.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int nb_colors
number of colors in pict, undefined when pict is not set
int intra_dc_precision
precision of the intra DC coefficient - 8
AVColorSpace
YUV colorspace type.
int cutoff
Audio cutoff bandwidth (0 means "automatic")
int hwaccel_flags
Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated decoding (if active).
AVSampleFormat
Audio sample formats.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
int(* parser_init)(AVCodecParserContext *s)
int dia_size
ME diamond size & shape.
uint8_t * dump_separator
dump format separator.
int mb_lmin
minimum MB Lagrange multiplier
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
Supply a raw video or audio frame to the encoder.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
int sub_charenc_mode
Subtitles character encoding mode.
int64_t frame_num
Frame counter, set by libavcodec.
int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, AVBufferRef *device_ref, enum AVPixelFormat hw_pix_fmt, AVBufferRef **out_frames_ref)
Create and return a AVHWFramesContext with values adequate for hardware decoding.
int h
height of pict, undefined when pict is not set
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal codec state / flush internal buffers.
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
void * opaque
Private data of the user, can be used to carry app specific stuff.
void(* draw_horiz_band)(struct AVCodecContext *s, const AVFrame *src, int offset[AV_NUM_DATA_POINTERS], int y, int type, int height)
If non NULL, 'draw_horiz_band' is called by the libavcodec decoder to draw a horizontal band.
int max_qdiff
maximum quantizer difference between frames
float dark_masking
darkness masking (0-> disabled)
main external API structure.
int active_thread_type
Which multithreading methods are in use by the codec.
enum AVFieldOrder field_order
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
int qmin
minimum quantizer
void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call.
int(* get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int flags)
This callback is called at the beginning of each packet to get a data buffer for it.
float spatial_cplx_masking
spatial complexity masking (0-> disabled)
float i_quant_offset
qscale offset between P and I-frames
int discard_damaged_percentage
The percentage of damaged samples to discard a frame.
attribute_deprecated int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
int mb_lmax
maximum MB Lagrange multiplier
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
int pre_dia_size
ME prepass diamond size & shape.
int coded_width
Bitstream width / height, may be different from width/height e.g.
enum AVMediaType codec_type
int seek_preroll
Number of samples to skip after a discontinuity.
int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts, int64_t pos)
Parse a packet.
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
A reference to a data buffer.
float rc_max_available_vbv_use
Ratecontrol attempt to use, at maximum, of what can be used without an underflow.
int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
Structure to hold side data for an AVFrame.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int slices
Number of slices.
This structure stores compressed data.
int avcodec_default_get_encode_buffer(AVCodecContext *s, AVPacket *pkt, int flags)
The default callback for AVCodecContext.get_encode_buffer().
int64_t last_pos
Previous frame byte position.
uint16_t * inter_matrix
custom inter quantization matrix Must be allocated with the av_malloc() family of functions,...
int rc_override_count
ratecontrol override, see RcOverride
const char * avcodec_configuration(void)
Return the libavcodec build-time configuration.
int width
picture width / height.
#define flags(name, subs,...)
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
int64_t cur_frame_dts[AV_PARSER_PTS_NB]
char * codec_whitelist
',' separated list of allowed decoders.
AVColorRange
Visual content value range.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
enum AVPixelFormat pix_fmt
Supported pixel format.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
uint32_t start_display_time
void av_parser_close(AVCodecParserContext *s)
enum AVCodecID id
Codec implemented by the hardware accelerator.