FFmpeg  4.0
Functions | Variables
vaapi_transcode.c File Reference

Intel VAAPI-accelerated transcoding example. More...

#include <stdio.h>
#include <errno.h>
#include <libavutil/hwcontext.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

Go to the source code of this file.

Functions

static enum AVPixelFormat get_vaapi_format (AVCodecContext *ctx, const enum AVPixelFormat *pix_fmts)
 
static int open_input_file (const char *filename)
 
static int encode_write (AVFrame *frame)
 
static int dec_enc (AVPacket *pkt, AVCodec *enc_codec)
 
int main (int argc, char **argv)
 

Variables

static AVFormatContextifmt_ctx = NULL
 
static AVFormatContextofmt_ctx = NULL
 
static AVBufferRefhw_device_ctx = NULL
 
static AVCodecContextdecoder_ctx = NULL
 
static AVCodecContextencoder_ctx = NULL
 
static int video_stream = -1
 
static AVStreamost
 
static int initialized = 0
 

Detailed Description

Intel VAAPI-accelerated transcoding example.

Definition in file vaapi_transcode.c.

Function Documentation

◆ get_vaapi_format()

static enum AVPixelFormat get_vaapi_format ( AVCodecContext ctx,
const enum AVPixelFormat pix_fmts 
)
static
Examples:
vaapi_transcode.c.

Definition at line 46 of file vaapi_transcode.c.

Referenced by open_input_file().

◆ open_input_file()

static int open_input_file ( const char *  filename)
static
Examples:
vaapi_transcode.c.

Definition at line 60 of file vaapi_transcode.c.

Referenced by main().

◆ encode_write()

static int encode_write ( AVFrame frame)
static
Examples:
vaapi_transcode.c.

Definition at line 110 of file vaapi_transcode.c.

Referenced by dec_enc(), and main().

◆ dec_enc()

static int dec_enc ( AVPacket pkt,
AVCodec enc_codec 
)
static
Examples:
vaapi_transcode.c.

Definition at line 146 of file vaapi_transcode.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)
Examples:
vaapi_transcode.c.

Definition at line 228 of file vaapi_transcode.c.

Variable Documentation

◆ ifmt_ctx

AVFormatContext* ifmt_ctx = NULL
static
Examples:
vaapi_transcode.c.

Definition at line 39 of file vaapi_transcode.c.

◆ ofmt_ctx

AVFormatContext * ofmt_ctx = NULL
static
Examples:
vaapi_transcode.c.

Definition at line 39 of file vaapi_transcode.c.

Referenced by dec_enc(), encode_write(), and main().

◆ hw_device_ctx

AVBufferRef* hw_device_ctx = NULL
static
Examples:
vaapi_transcode.c.

Definition at line 40 of file vaapi_transcode.c.

◆ decoder_ctx

AVCodecContext* decoder_ctx = NULL
static
Examples:
hw_decode.c, qsvdec.c, and vaapi_transcode.c.

Definition at line 41 of file vaapi_transcode.c.

Referenced by main().

◆ encoder_ctx

AVCodecContext * encoder_ctx = NULL
static
Examples:
vaapi_transcode.c.

Definition at line 41 of file vaapi_transcode.c.

Referenced by dec_enc(), encode_write(), and main().

◆ video_stream

int video_stream = -1
static
Examples:
vaapi_transcode.c.

Definition at line 42 of file vaapi_transcode.c.

Referenced by encode_write(), main(), and open_input_file().

◆ ost

AVStream* ost
static

◆ initialized

int initialized = 0
static
Examples:
vaapi_transcode.c.

Definition at line 44 of file vaapi_transcode.c.

Referenced by dec_enc(), ff_ccitt_unpack_init(), init_tables(), and writer_register_all().