FFmpeg
Loading...
Searching...
No Matches
videotoolboxenc.c File Reference
#include <Availability.h>
#include <CoreMedia/CoreMedia.h>
#include <CoreVideo/CoreVideo.h>
#include <dlfcn.h>
#include <pthread.h>
#include <TargetConditionals.h>
#include <VideoToolbox/VideoToolbox.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/hwcontext_videotoolbox.h"
#include "atsc_a53.h"
#include "codec_internal.h"
#include "encode.h"
#include "h264.h"
#include "h264_sei.h"
#include "hwconfig.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ExtraSEI
 
struct  BufNode
 
struct  VTEncContext
 

Macros

#define TARGET_CPU_ARM64   0
 
#define REORDER_DELAY   2
 
#define GET_SYM(symbol, defaultVal)
 
#define H264_PROFILE_CONSTRAINED_HIGH   (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 
#define COMMON_OPTIONS
 
#define OFFSET(x)
 

Typedefs

typedef OSStatus(* getParameterSetAtIndex) (CMFormatDescriptionRef videoDesc, size_t parameterSetIndex, const uint8_t **parameterSetPointerOut, size_t *parameterSetSizeOut, size_t *parameterSetCountOut, int *NALUnitHeaderLengthOut)
 

Enumerations

enum  { kCMVideoCodecType_HEVC = 'hvc1' }
 
enum  { kCMVideoCodecType_HEVCWithAlpha = 'muxa' }
 
enum  { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' }
 
enum  { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' }
 
enum  { kVTQPModulationLevel_Default = -1 }
 
enum  { kVTQPModulationLevel_Disable = 0 }
 
enum  VTH264Entropy { VT_ENTROPY_NOT_SET , VT_CAVLC , VT_CABAC }
 

Functions

static void loadVTEncSymbols (void)
 
static void vtenc_free_buf_node (BufNode *info)
 
static int vt_dump_encoder (AVCodecContext *avctx)
 
static int vtenc_populate_extradata (AVCodecContext *avctx, CMVideoCodecType codec_type, CFStringRef profile_level, CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info)
 
static void vt_release_num (CFNumberRef *refPtr)
 NULL-safe release of *refPtr, and sets value to NULL.
 
static void set_async_error (VTEncContext *vtctx, int err)
 
static void clear_frame_queue (VTEncContext *vtctx)
 
static void vtenc_reset (VTEncContext *vtctx)
 
static int vtenc_q_pop (VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI *sei)
 
static void vtenc_q_push (VTEncContext *vtctx, BufNode *info)
 
static int count_nalus (size_t length_code_size, CMSampleBufferRef sample_buffer, int *count)
 
static CMVideoCodecType get_cm_codec_type (AVCodecContext *avctx, int profile, double alpha_quality)
 
static int get_params_size (AVCodecContext *avctx, CMVideoFormatDescriptionRef vid_fmt, size_t *size)
 Get the parameter sets from a CMSampleBufferRef.
 
static int copy_param_sets (AVCodecContext *avctx, CMVideoFormatDescriptionRef vid_fmt, uint8_t *dst, size_t dst_size)
 
static int set_extradata (AVCodecContext *avctx, CMSampleBufferRef sample_buffer)
 
static void vtenc_output_callback (void *ctx, void *sourceFrameCtx, OSStatus status, VTEncodeInfoFlags flags, CMSampleBufferRef sample_buffer)
 
static int get_length_code_size (AVCodecContext *avctx, CMSampleBufferRef sample_buffer, size_t *size)
 
static bool get_vt_h264_profile_level (AVCodecContext *avctx, CFStringRef *profile_level_val)
 
static bool get_vt_hevc_profile_level (AVCodecContext *avctx, CFStringRef *profile_level_val)
 
static int get_cv_pixel_format (AVCodecContext *avctx, enum AVPixelFormat fmt, enum AVColorRange range, int *av_pixel_format, int *range_guessed)
 
static void add_color_attr (AVCodecContext *avctx, CFMutableDictionaryRef dict)
 
static int create_cv_pixel_buffer_info (AVCodecContext *avctx, CFMutableDictionaryRef *dict)
 
static int get_cv_gamma (AVCodecContext *avctx, CFNumberRef *gamma_level)
 
static bool vtenc_qscale_enabled (void)
 
static void set_encoder_property_or_log (AVCodecContext *avctx, CFStringRef key, const char *print_option_name, CFTypeRef value)
 
static int set_encoder_int_property_or_log (AVCodecContext *avctx, CFStringRef key, const char *print_option_name, int value)
 
static int vtenc_create_encoder (AVCodecContext *avctx, CMVideoCodecType codec_type, CFStringRef profile_level, CFNumberRef gamma_level, CFDictionaryRef enc_info, CFDictionaryRef pixel_buffer_info, bool constant_bit_rate, VTCompressionSessionRef *session)
 
static int vtenc_configure_encoder (AVCodecContext *avctx)
 
static av_cold int vtenc_init (AVCodecContext *avctx)
 
static void vtenc_get_frame_info (CMSampleBufferRef buffer, bool *is_key_frame)
 
static int is_post_sei_nal_type (int nal_type)
 
static int find_sei_end (AVCodecContext *avctx, uint8_t *nal_data, size_t nal_size, uint8_t **sei_end)
 
static int copy_emulation_prev (const uint8_t *src, size_t src_size, uint8_t *dst, ssize_t dst_offset, size_t dst_size)
 Copies the data inserting emulation prevention bytes as needed.
 
static int write_sei (const ExtraSEI *sei, int sei_type, uint8_t *dst, size_t dst_size)
 
static int copy_replace_length_codes (AVCodecContext *avctx, size_t length_code_size, CMSampleBufferRef sample_buffer, ExtraSEI *sei, uint8_t *dst_data, size_t dst_size)
 Copies NAL units and replaces length codes with H.264 Annex B start codes.
 
static int get_sei_msg_bytes (const ExtraSEI *sei, int type)
 Returns a sufficient number of bytes to contain the sei data.
 
static int vtenc_cm_to_avpacket (AVCodecContext *avctx, CMSampleBufferRef sample_buffer, AVPacket *pkt, ExtraSEI *sei)
 
static int copy_avframe_to_pixel_buffer (AVCodecContext *avctx, const AVFrame *frame, CVPixelBufferRef cv_img)
 
static int create_cv_pixel_buffer (AVCodecContext *avctx, const AVFrame *frame, CVPixelBufferRef *cv_img, BufNode *node)
 
static int create_encoder_dict (const AVFrame *frame, CFDictionaryRef *dict_out)
 
static int vtenc_send_frame (AVCodecContext *avctx, VTEncContext *vtctx, const AVFrame *frame)
 
static av_cold int vtenc_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int vtenc_close (AVCodecContext *avctx)
 

Variables

struct { 
 
   CFStringRef   kCVImageBufferColorPrimaries_ITU_R_2020 
 
   CFStringRef   kCVImageBufferTransferFunction_ITU_R_2020 
 
   CFStringRef   kCVImageBufferYCbCrMatrix_ITU_R_2020 
 
   CFStringRef   kVTCompressionPropertyKey_H264EntropyMode 
 
   CFStringRef   kVTH264EntropyMode_CAVLC 
 
   CFStringRef   kVTH264EntropyMode_CABAC 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_4_0 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_4_2 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_0 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_1 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_5_2 
 
   CFStringRef   kVTProfileLevel_H264_Baseline_AutoLevel 
 
   CFStringRef   kVTProfileLevel_H264_Main_4_2 
 
   CFStringRef   kVTProfileLevel_H264_Main_5_1 
 
   CFStringRef   kVTProfileLevel_H264_Main_5_2 
 
   CFStringRef   kVTProfileLevel_H264_Main_AutoLevel 
 
   CFStringRef   kVTProfileLevel_H264_High_3_0 
 
   CFStringRef   kVTProfileLevel_H264_High_3_1 
 
   CFStringRef   kVTProfileLevel_H264_High_3_2 
 
   CFStringRef   kVTProfileLevel_H264_High_4_0 
 
   CFStringRef   kVTProfileLevel_H264_High_4_1 
 
   CFStringRef   kVTProfileLevel_H264_High_4_2 
 
   CFStringRef   kVTProfileLevel_H264_High_5_1 
 
   CFStringRef   kVTProfileLevel_H264_High_5_2 
 
   CFStringRef   kVTProfileLevel_H264_High_AutoLevel 
 
   CFStringRef   kVTProfileLevel_H264_Extended_5_0 
 
   CFStringRef   kVTProfileLevel_H264_Extended_AutoLevel 
 
   CFStringRef   kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel 
 
   CFStringRef   kVTProfileLevel_H264_ConstrainedHigh_AutoLevel 
 
   CFStringRef   kVTProfileLevel_HEVC_Main_AutoLevel 
 
   CFStringRef   kVTProfileLevel_HEVC_Main10_AutoLevel 
 
   CFStringRef   kVTProfileLevel_HEVC_Main42210_AutoLevel 
 
   CFStringRef   kVTCompressionPropertyKey_RealTime 
 
   CFStringRef   kVTCompressionPropertyKey_TargetQualityForAlpha 
 
   CFStringRef   kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality 
 
   CFStringRef   kVTCompressionPropertyKey_ConstantBitRate 
 
   CFStringRef   kVTCompressionPropertyKey_EncoderID 
 
   CFStringRef   kVTCompressionPropertyKey_SpatialAdaptiveQPLevel 
 
   CFStringRef   kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder 
 
   CFStringRef   kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder 
 
   CFStringRef   kVTVideoEncoderSpecification_EnableLowLatencyRateControl 
 
   CFStringRef   kVTCompressionPropertyKey_AllowOpenGOP 
 
   CFStringRef   kVTCompressionPropertyKey_MaximizePowerEfficiency 
 
   CFStringRef   kVTCompressionPropertyKey_ReferenceBufferCount 
 
   CFStringRef   kVTCompressionPropertyKey_MaxAllowedFrameQP 
 
   CFStringRef   kVTCompressionPropertyKey_MinAllowedFrameQP 
 
   getParameterSetAtIndex   CMVideoFormatDescriptionGetHEVCParameterSetAtIndex 
 
} compat_keys 
 
static pthread_once_t once_ctrl = PTHREAD_ONCE_INIT
 
static const uint8_t start_code [] = { 0, 0, 0, 1 }
 
static enum AVPixelFormat avc_pix_fmts []
 
static enum AVPixelFormat hevc_pix_fmts []
 
static enum AVPixelFormat prores_pix_fmts []
 
static const AVCodecHWConfigInternal *const vt_encode_hw_configs []
 
static const AVOption h264_options []
 
static const FFCodecDefault vt_defaults []
 
static const AVClass h264_videotoolbox_class
 
const FFCodec ff_h264_videotoolbox_encoder
 
static const AVOption hevc_options []
 
static const AVClass hevc_videotoolbox_class
 
const FFCodec ff_hevc_videotoolbox_encoder
 
static const AVOption prores_options []
 
static const AVClass prores_videotoolbox_class
 
const FFCodec ff_prores_videotoolbox_encoder
 

Macro Definition Documentation

◆ TARGET_CPU_ARM64

#define TARGET_CPU_ARM64   0

Definition at line 64 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder(), and vtenc_qscale_enabled().

◆ REORDER_DELAY

#define REORDER_DELAY   2

Definition at line 82 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder(), and vtenc_init().

◆ GET_SYM

#define GET_SYM ( symbol,
defaultVal )
Value:
do{ \
CFStringRef* handle = (CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!handle) \
compat_keys.symbol = CFSTR(defaultVal); \
else \
compat_keys.symbol = *handle; \
}while(0)
static struct @270163022166130316376344224307060235304065252011 compat_keys

Definition at line 162 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ H264_PROFILE_CONSTRAINED_HIGH

#define H264_PROFILE_CONSTRAINED_HIGH   (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED)

Definition at line 240 of file videotoolboxenc.c.

Referenced by get_vt_h264_profile_level().

◆ VE

Definition at line 2794 of file videotoolboxenc.c.

◆ COMMON_OPTIONS

#define COMMON_OPTIONS
Value:
{ "allow_sw", "Allow software encoding", OFFSET(allow_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "require_sw", "Require software encoding", OFFSET(require_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE }, \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
OFFSET(frames_before), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "frames_after", "Other frames will come after the frames in this session. This helps smooth concatenation issues.", \
OFFSET(frames_after), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "prio_speed", "prioritize encoding speed", OFFSET(prio_speed), AV_OPT_TYPE_BOOL, \
{ .i64 = -1 }, -1, 1, VE }, \
{ "power_efficient", "Set to 1 to enable more power-efficient encoding if supported.", \
OFFSET(power_efficient), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "spatial_aq", "Set to 1 to enable spatial AQ if supported.", \
OFFSET(spatialaq), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
{ "max_ref_frames", \
"Sets the maximum number of reference frames. This only has an effect when the value is less than the maximum allowed by the profile/level.", \
OFFSET(max_ref_frames), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
#define VE
Definition amfenc_av1.c:30
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 2795 of file videotoolboxenc.c.

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 2821 of file videotoolboxenc.c.

Typedef Documentation

◆ getParameterSetAtIndex

typedef OSStatus(* getParameterSetAtIndex) (CMFormatDescriptionRef videoDesc, size_t parameterSetIndex, const uint8_t **parameterSetPointerOut, size_t *parameterSetSizeOut, size_t *parameterSetCountOut, int *NALUnitHeaderLengthOut)

Definition at line 84 of file videotoolboxenc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kCMVideoCodecType_HEVC 

Definition at line 46 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCMVideoCodecType_HEVCWithAlpha 

Definition at line 50 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCVPixelFormatType_420YpCbCr10BiPlanarFullRange 

Definition at line 54 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange 

Definition at line 55 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kVTQPModulationLevel_Default 

Definition at line 59 of file videotoolboxenc.c.

◆ anonymous enum

anonymous enum
Enumerator
kVTQPModulationLevel_Disable 

Definition at line 60 of file videotoolboxenc.c.

◆ VTH264Entropy

Enumerator
VT_ENTROPY_NOT_SET 
VT_CAVLC 
VT_CABAC 

Definition at line 242 of file videotoolboxenc.c.

Function Documentation

◆ loadVTEncSymbols()

static void loadVTEncSymbols ( void )
static

Definition at line 173 of file videotoolboxenc.c.

Referenced by vtenc_init().

◆ vtenc_free_buf_node()

static void vtenc_free_buf_node ( BufNode * info)
static

◆ vt_dump_encoder()

static int vt_dump_encoder ( AVCodecContext * avctx)
static

Definition at line 324 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ vtenc_populate_extradata()

static int vtenc_populate_extradata ( AVCodecContext * avctx,
CMVideoCodecType codec_type,
CFStringRef profile_level,
CFNumberRef gamma_level,
CFDictionaryRef enc_info,
CFDictionaryRef pixel_buffer_info )
static

Definition at line 2614 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ vt_release_num()

static void vt_release_num ( CFNumberRef * refPtr)
static

NULL-safe release of *refPtr, and sets value to NULL.

Definition at line 369 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer_info().

◆ set_async_error()

static void set_async_error ( VTEncContext * vtctx,
int err )
static

Definition at line 378 of file videotoolboxenc.c.

Referenced by clear_frame_queue(), and vtenc_output_callback().

◆ clear_frame_queue()

static void clear_frame_queue ( VTEncContext * vtctx)
static

Definition at line 398 of file videotoolboxenc.c.

Referenced by vtenc_close().

◆ vtenc_reset()

static void vtenc_reset ( VTEncContext * vtctx)
static

◆ vtenc_q_pop()

static int vtenc_q_pop ( VTEncContext * vtctx,
bool wait,
CMSampleBufferRef * buf,
ExtraSEI * sei )
static

Definition at line 425 of file videotoolboxenc.c.

Referenced by vtenc_frame(), and vtenc_populate_extradata().

◆ vtenc_q_push()

static void vtenc_q_push ( VTEncContext * vtctx,
BufNode * info )
static

Definition at line 473 of file videotoolboxenc.c.

Referenced by vtenc_output_callback().

◆ count_nalus()

static int count_nalus ( size_t length_code_size,
CMSampleBufferRef sample_buffer,
int * count )
static

Definition at line 489 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_cm_codec_type()

static CMVideoCodecType get_cm_codec_type ( AVCodecContext * avctx,
int profile,
double alpha_quality )
static

Definition at line 532 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_params_size()

static int get_params_size ( AVCodecContext * avctx,
CMVideoFormatDescriptionRef vid_fmt,
size_t * size )
static

Get the parameter sets from a CMSampleBufferRef.

Parameters
dstIf *dst isn't NULL, the parameters are copied into existing memory. *dst_size must be set accordingly when *dst != NULL. If *dst is NULL, it will be allocated. In all cases, *dst_size is set to the number of bytes used starting at *dst.

Definition at line 584 of file videotoolboxenc.c.

Referenced by set_extradata(), and vtenc_cm_to_avpacket().

◆ copy_param_sets()

static int copy_param_sets ( AVCodecContext * avctx,
CMVideoFormatDescriptionRef vid_fmt,
uint8_t * dst,
size_t dst_size )
static

Definition at line 638 of file videotoolboxenc.c.

Referenced by set_extradata(), and vtenc_cm_to_avpacket().

◆ set_extradata()

static int set_extradata ( AVCodecContext * avctx,
CMSampleBufferRef sample_buffer )
static

Definition at line 702 of file videotoolboxenc.c.

Referenced by vtenc_output_callback().

◆ vtenc_output_callback()

static void vtenc_output_callback ( void * ctx,
void * sourceFrameCtx,
OSStatus status,
VTEncodeInfoFlags flags,
CMSampleBufferRef sample_buffer )
static

Definition at line 751 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ get_length_code_size()

static int get_length_code_size ( AVCodecContext * avctx,
CMSampleBufferRef sample_buffer,
size_t * size )
static

Definition at line 795 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_vt_h264_profile_level()

static bool get_vt_h264_profile_level ( AVCodecContext * avctx,
CFStringRef * profile_level_val )
static

Definition at line 832 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_vt_hevc_profile_level()

static bool get_vt_hevc_profile_level ( AVCodecContext * avctx,
CFStringRef * profile_level_val )
static

Definition at line 961 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_pixel_format()

static int get_cv_pixel_format ( AVCodecContext * avctx,
enum AVPixelFormat fmt,
enum AVColorRange range,
int * av_pixel_format,
int * range_guessed )
static

Definition at line 1013 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer(), and create_cv_pixel_buffer_info().

◆ add_color_attr()

static void add_color_attr ( AVCodecContext * avctx,
CFMutableDictionaryRef dict )
static

Definition at line 1037 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer_info().

◆ create_cv_pixel_buffer_info()

static int create_cv_pixel_buffer_info ( AVCodecContext * avctx,
CFMutableDictionaryRef * dict )
static

Definition at line 1059 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ get_cv_gamma()

static int get_cv_gamma ( AVCodecContext * avctx,
CFNumberRef * gamma_level )
static

Definition at line 1126 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder().

◆ vtenc_qscale_enabled()

static bool vtenc_qscale_enabled ( void )
static

Definition at line 1144 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ set_encoder_property_or_log()

static void set_encoder_property_or_log ( AVCodecContext * avctx,
CFStringRef key,
const char * print_option_name,
CFTypeRef value )
static

Definition at line 1149 of file videotoolboxenc.c.

Referenced by set_encoder_int_property_or_log(), and vtenc_create_encoder().

◆ set_encoder_int_property_or_log()

static int set_encoder_int_property_or_log ( AVCodecContext * avctx,
CFStringRef key,
const char * print_option_name,
int value )
static

Definition at line 1171 of file videotoolboxenc.c.

Referenced by vtenc_create_encoder().

◆ vtenc_create_encoder()

static int vtenc_create_encoder ( AVCodecContext * avctx,
CMVideoCodecType codec_type,
CFStringRef profile_level,
CFNumberRef gamma_level,
CFDictionaryRef enc_info,
CFDictionaryRef pixel_buffer_info,
bool constant_bit_rate,
VTCompressionSessionRef * session )
static

Definition at line 1190 of file videotoolboxenc.c.

Referenced by vtenc_configure_encoder(), and vtenc_populate_extradata().

◆ vtenc_configure_encoder()

static int vtenc_configure_encoder ( AVCodecContext * avctx)
static

Definition at line 1650 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer(), and vtenc_init().

◆ vtenc_init()

static av_cold int vtenc_init ( AVCodecContext * avctx)
static

Definition at line 1785 of file videotoolboxenc.c.

◆ vtenc_get_frame_info()

static void vtenc_get_frame_info ( CMSampleBufferRef buffer,
bool * is_key_frame )
static

Definition at line 1820 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ is_post_sei_nal_type()

static int is_post_sei_nal_type ( int nal_type)
static

Definition at line 1847 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ find_sei_end()

static int find_sei_end ( AVCodecContext * avctx,
uint8_t * nal_data,
size_t nal_size,
uint8_t ** sei_end )
static

Definition at line 1858 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ copy_emulation_prev()

static int copy_emulation_prev ( const uint8_t * src,
size_t src_size,
uint8_t * dst,
ssize_t dst_offset,
size_t dst_size )
static

Copies the data inserting emulation prevention bytes as needed.

Existing data in the destination can be taken into account by providing dst with a dst_offset > 0.

Returns
The number of bytes copied on success. On failure, the negative of the number of bytes needed to copy src is returned.

Definition at line 1920 of file videotoolboxenc.c.

Referenced by get_sei_msg_bytes(), and write_sei().

◆ write_sei()

static int write_sei ( const ExtraSEI * sei,
int sei_type,
uint8_t * dst,
size_t dst_size )
static

Definition at line 1971 of file videotoolboxenc.c.

Referenced by copy_replace_length_codes().

◆ copy_replace_length_codes()

static int copy_replace_length_codes ( AVCodecContext * avctx,
size_t length_code_size,
CMSampleBufferRef sample_buffer,
ExtraSEI * sei,
uint8_t * dst_data,
size_t dst_size )
static

Copies NAL units and replaces length codes with H.264 Annex B start codes.

On failure, the contents of dst_data may have been modified.

Parameters
length_code_sizeByte length of each length code
sample_bufferNAL units prefixed with length codes.
seiOptional A53 closed captions SEI data.
dst_dataMust be zeroed before calling this function. Contains the copied NAL units prefixed with start codes when the function returns successfully.
dst_sizeLength of dst_data
Returns
0 on success AVERROR_INVALIDDATA if length_code_size is invalid AVERROR_BUFFER_TOO_SMALL if dst_data is too small or if a length_code in src_data specifies data beyond the end of its buffer.

Definition at line 2044 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ get_sei_msg_bytes()

static int get_sei_msg_bytes ( const ExtraSEI * sei,
int type )
static

Returns a sufficient number of bytes to contain the sei data.

It may be greater than the minimum required.

Definition at line 2201 of file videotoolboxenc.c.

Referenced by vtenc_cm_to_avpacket().

◆ vtenc_cm_to_avpacket()

static int vtenc_cm_to_avpacket ( AVCodecContext * avctx,
CMSampleBufferRef sample_buffer,
AVPacket * pkt,
ExtraSEI * sei )
static

Definition at line 2218 of file videotoolboxenc.c.

Referenced by vtenc_frame().

◆ copy_avframe_to_pixel_buffer()

static int copy_avframe_to_pixel_buffer ( AVCodecContext * avctx,
const AVFrame * frame,
CVPixelBufferRef cv_img )
static

Definition at line 2348 of file videotoolboxenc.c.

Referenced by create_cv_pixel_buffer().

◆ create_cv_pixel_buffer()

static int create_cv_pixel_buffer ( AVCodecContext * avctx,
const AVFrame * frame,
CVPixelBufferRef * cv_img,
BufNode * node )
static

Definition at line 2387 of file videotoolboxenc.c.

Referenced by vtenc_send_frame().

◆ create_encoder_dict()

static int create_encoder_dict ( const AVFrame * frame,
CFDictionaryRef * dict_out )
static

Definition at line 2473 of file videotoolboxenc.c.

Referenced by vtenc_send_frame().

◆ vtenc_send_frame()

static int vtenc_send_frame ( AVCodecContext * avctx,
VTEncContext * vtctx,
const AVFrame * frame )
static

Definition at line 2489 of file videotoolboxenc.c.

Referenced by vtenc_frame().

◆ vtenc_frame()

static av_cold int vtenc_frame ( AVCodecContext * avctx,
AVPacket * pkt,
const AVFrame * frame,
int * got_packet )
static

Definition at line 2550 of file videotoolboxenc.c.

◆ vtenc_close()

static av_cold int vtenc_close ( AVCodecContext * avctx)
static

Definition at line 2722 of file videotoolboxenc.c.

Variable Documentation

◆ kCVImageBufferColorPrimaries_ITU_R_2020

CFStringRef kCVImageBufferColorPrimaries_ITU_R_2020

◆ kCVImageBufferTransferFunction_ITU_R_2020

CFStringRef kCVImageBufferTransferFunction_ITU_R_2020

Definition at line 108 of file videotoolboxenc.c.

Referenced by av_map_videotoolbox_color_trc_from_av(), and loadVTEncSymbols().

◆ kCVImageBufferYCbCrMatrix_ITU_R_2020

CFStringRef kCVImageBufferYCbCrMatrix_ITU_R_2020

◆ kVTCompressionPropertyKey_H264EntropyMode

CFStringRef kVTCompressionPropertyKey_H264EntropyMode

Definition at line 111 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTH264EntropyMode_CAVLC

CFStringRef kVTH264EntropyMode_CAVLC

Definition at line 112 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTH264EntropyMode_CABAC

CFStringRef kVTH264EntropyMode_CABAC

Definition at line 113 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_4_0

CFStringRef kVTProfileLevel_H264_Baseline_4_0

Definition at line 115 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_4_2

CFStringRef kVTProfileLevel_H264_Baseline_4_2

Definition at line 116 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_0

CFStringRef kVTProfileLevel_H264_Baseline_5_0

Definition at line 117 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_1

CFStringRef kVTProfileLevel_H264_Baseline_5_1

Definition at line 118 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_5_2

CFStringRef kVTProfileLevel_H264_Baseline_5_2

Definition at line 119 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Baseline_AutoLevel

CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel

Definition at line 120 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_4_2

CFStringRef kVTProfileLevel_H264_Main_4_2

Definition at line 121 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_5_1

CFStringRef kVTProfileLevel_H264_Main_5_1

Definition at line 122 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_5_2

CFStringRef kVTProfileLevel_H264_Main_5_2

Definition at line 123 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Main_AutoLevel

CFStringRef kVTProfileLevel_H264_Main_AutoLevel

Definition at line 124 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_0

CFStringRef kVTProfileLevel_H264_High_3_0

Definition at line 125 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_1

CFStringRef kVTProfileLevel_H264_High_3_1

Definition at line 126 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_3_2

CFStringRef kVTProfileLevel_H264_High_3_2

Definition at line 127 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_0

CFStringRef kVTProfileLevel_H264_High_4_0

Definition at line 128 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_1

CFStringRef kVTProfileLevel_H264_High_4_1

Definition at line 129 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_4_2

CFStringRef kVTProfileLevel_H264_High_4_2

Definition at line 130 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_5_1

CFStringRef kVTProfileLevel_H264_High_5_1

Definition at line 131 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_5_2

CFStringRef kVTProfileLevel_H264_High_5_2

Definition at line 132 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_High_AutoLevel

CFStringRef kVTProfileLevel_H264_High_AutoLevel

Definition at line 133 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Extended_5_0

CFStringRef kVTProfileLevel_H264_Extended_5_0

Definition at line 134 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_Extended_AutoLevel

CFStringRef kVTProfileLevel_H264_Extended_AutoLevel

Definition at line 135 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel

CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel

Definition at line 136 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_H264_ConstrainedHigh_AutoLevel

CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel

Definition at line 137 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_HEVC_Main_AutoLevel

CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel

Definition at line 139 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_HEVC_Main10_AutoLevel

CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel

Definition at line 140 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTProfileLevel_HEVC_Main42210_AutoLevel

CFStringRef kVTProfileLevel_HEVC_Main42210_AutoLevel

Definition at line 141 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_RealTime

CFStringRef kVTCompressionPropertyKey_RealTime

Definition at line 143 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_TargetQualityForAlpha

CFStringRef kVTCompressionPropertyKey_TargetQualityForAlpha

Definition at line 144 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality

CFStringRef kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality

Definition at line 145 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_ConstantBitRate

CFStringRef kVTCompressionPropertyKey_ConstantBitRate

Definition at line 146 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_EncoderID

CFStringRef kVTCompressionPropertyKey_EncoderID

Definition at line 147 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_SpatialAdaptiveQPLevel

CFStringRef kVTCompressionPropertyKey_SpatialAdaptiveQPLevel

Definition at line 148 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder

CFStringRef kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder

Definition at line 150 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder

CFStringRef kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder

Definition at line 151 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTVideoEncoderSpecification_EnableLowLatencyRateControl

CFStringRef kVTVideoEncoderSpecification_EnableLowLatencyRateControl

Definition at line 152 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_AllowOpenGOP

CFStringRef kVTCompressionPropertyKey_AllowOpenGOP

Definition at line 153 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_MaximizePowerEfficiency

CFStringRef kVTCompressionPropertyKey_MaximizePowerEfficiency

Definition at line 154 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_ReferenceBufferCount

CFStringRef kVTCompressionPropertyKey_ReferenceBufferCount

Definition at line 155 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_MaxAllowedFrameQP

CFStringRef kVTCompressionPropertyKey_MaxAllowedFrameQP

Definition at line 156 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ kVTCompressionPropertyKey_MinAllowedFrameQP

CFStringRef kVTCompressionPropertyKey_MinAllowedFrameQP

Definition at line 157 of file videotoolboxenc.c.

Referenced by loadVTEncSymbols().

◆ CMVideoFormatDescriptionGetHEVCParameterSetAtIndex

getParameterSetAtIndex CMVideoFormatDescriptionGetHEVCParameterSetAtIndex

Definition at line 159 of file videotoolboxenc.c.

◆ [struct]

◆ once_ctrl

pthread_once_t once_ctrl = PTHREAD_ONCE_INIT
static

Definition at line 171 of file videotoolboxenc.c.

Referenced by vtenc_init().

◆ start_code

◆ avc_pix_fmts

enum AVPixelFormat avc_pix_fmts[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:96
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition pixfmt.h:305
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73

Definition at line 2743 of file videotoolboxenc.c.

◆ hevc_pix_fmts

enum AVPixelFormat hevc_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_P210
Definition pixfmt.h:627
@ AV_PIX_FMT_P010LE
like NV12, with 10bpp per component, data in the high bits, zeros in the low bits,...
Definition pixfmt.h:307
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_AYUV
packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
Definition pixfmt.h:442

Definition at line 2750 of file videotoolboxenc.c.

◆ prores_pix_fmts

enum AVPixelFormat prores_pix_fmts[]
static

Definition at line 2761 of file videotoolboxenc.c.

◆ vt_encode_hw_configs

const AVCodecHWConfigInternal* const vt_encode_hw_configs[]
static
Initial value:
= {
HW_CONFIG_ENCODER_FRAMES(VIDEOTOOLBOX, VIDEOTOOLBOX),
}
#define NULL
Definition coverity.c:32
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_)
Definition hwconfig.h:100

Definition at line 2816 of file videotoolboxenc.c.

◆ h264_options

const AVOption h264_options[]
static

Definition at line 2822 of file videotoolboxenc.c.

◆ vt_defaults

const FFCodecDefault vt_defaults[]
static
Initial value:
= {
{"b", "0"},
{"qmin", "-1"},
{"qmax", "-1"},
{NULL},
}

Definition at line 2857 of file videotoolboxenc.c.

◆ h264_videotoolbox_class

const AVClass h264_videotoolbox_class
static
Initial value:
= {
.class_name = "h264_videotoolbox",
.item_name = av_default_item_name,
.option = h264_options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption h264_options[]
Definition h264dec.c:1145

Definition at line 2864 of file videotoolboxenc.c.

◆ ff_h264_videotoolbox_encoder

const FFCodec ff_h264_videotoolbox_encoder
Initial value:
= {
.p.name = "h264_videotoolbox",
CODEC_LONG_NAME("VideoToolbox H.264 Encoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
.priv_data_size = sizeof(VTEncContext),
.defaults = vt_defaults,
.init = vtenc_init,
.close = vtenc_close,
.p.priv_class = &h264_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.wrapper_name = "videotoolbox",
.hw_configs = vt_encode_hw_configs,
}
#define CODEC_PIXFMTS_ARRAY(array)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition codec.h:79
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_HYBRID
Codec is potentially backed by a hardware implementation, but not necessarily.
Definition codec.h:140
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static enum AVPixelFormat avc_pix_fmts[]
static const AVClass h264_videotoolbox_class
static av_cold int vtenc_init(AVCodecContext *avctx)
static av_cold int vtenc_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
static const FFCodecDefault vt_defaults[]
static av_cold int vtenc_close(AVCodecContext *avctx)
static const AVCodecHWConfigInternal *const vt_encode_hw_configs[]

Definition at line 2871 of file videotoolboxenc.c.

◆ hevc_options

const AVOption hevc_options[]
static
Initial value:
= {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, .unit = "profile" },
{ "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "main42210","Main 4:2:2 10 Profile",0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_REXT }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "rext", "Main 4:2:2 10 Profile",0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_REXT }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE },
{ "constant_bit_rate", "Require constant bit rate (macOS 13 or newer)", OFFSET(constant_bit_rate), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ NULL },
}
#define AV_PROFILE_UNKNOWN
Definition defs.h:65
#define AV_PROFILE_HEVC_REXT
Definition defs.h:176
#define AV_PROFILE_HEVC_MAIN
Definition defs.h:173
#define AV_PROFILE_HEVC_MAIN_10
Definition defs.h:174
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
#define COMMON_OPTIONS
Definition libvpxenc.c:1986
int profile
Definition mxfenc.c:2299

Definition at line 2890 of file videotoolboxenc.c.

◆ hevc_videotoolbox_class

const AVClass hevc_videotoolbox_class
static
Initial value:
= {
.class_name = "hevc_videotoolbox",
.item_name = av_default_item_name,
.option = hevc_options,
}
static const AVOption hevc_options[]

Definition at line 2905 of file videotoolboxenc.c.

◆ ff_hevc_videotoolbox_encoder

const FFCodec ff_hevc_videotoolbox_encoder
Initial value:
= {
.p.name = "hevc_videotoolbox",
CODEC_LONG_NAME("VideoToolbox H.265 Encoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
.priv_data_size = sizeof(VTEncContext),
.defaults = vt_defaults,
.init = vtenc_init,
.close = vtenc_close,
.p.priv_class = &hevc_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.wrapper_name = "videotoolbox",
.hw_configs = vt_encode_hw_configs,
}
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:771
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:788
static enum AVPixelFormat hevc_pix_fmts[]
static const AVClass hevc_videotoolbox_class

Definition at line 2912 of file videotoolboxenc.c.

◆ prores_options

const AVOption prores_options[]
static
Initial value:
= {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, .unit = "profile" },
{ "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, .unit = "profile" },
{ NULL },
}
#define AV_PROFILE_PRORES_STANDARD
Definition defs.h:197
#define AV_PROFILE_PRORES_4444
Definition defs.h:199
#define AV_PROFILE_PRORES_LT
Definition defs.h:196
#define AV_PROFILE_PRORES_PROXY
Definition defs.h:195
#define AV_PROFILE_PRORES_XQ
Definition defs.h:200
#define AV_PROFILE_PRORES_HQ
Definition defs.h:198

Definition at line 2932 of file videotoolboxenc.c.

◆ prores_videotoolbox_class

const AVClass prores_videotoolbox_class
static
Initial value:
= {
.class_name = "prores_videotoolbox",
.item_name = av_default_item_name,
.option = prores_options,
}
static const AVOption prores_options[]

Definition at line 2946 of file videotoolboxenc.c.

◆ ff_prores_videotoolbox_encoder

const FFCodec ff_prores_videotoolbox_encoder
Initial value:
= {
.p.name = "prores_videotoolbox",
CODEC_LONG_NAME("VideoToolbox ProRes Encoder"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
.priv_data_size = sizeof(VTEncContext),
.defaults = vt_defaults,
.init = vtenc_init,
.close = vtenc_close,
.p.priv_class = &prores_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.wrapper_name = "videotoolbox",
.hw_configs = vt_encode_hw_configs,
}
@ AV_CODEC_ID_PRORES
Definition codec_id.h:198
static const AVClass prores_videotoolbox_class
static enum AVPixelFormat prores_pix_fmts[]

Definition at line 2953 of file videotoolboxenc.c.