FFmpeg
Data Structures | Functions
ffmpeg_enc.c File Reference
#include <math.h>
#include <stdint.h>
#include "ffmpeg.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/avutil.h"
#include "libavutil/dict.h"
#include "libavutil/display.h"
#include "libavutil/eval.h"
#include "libavutil/frame.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/timestamp.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"

Go to the source code of this file.

Data Structures

struct  Encoder
 

Functions

void enc_free (Encoder **penc)
 
int enc_alloc (Encoder **penc, const AVCodec *codec)
 
static int hw_device_setup_for_encode (OutputStream *ost, AVBufferRef *frames_ref)
 
static int set_encoder_id (OutputFile *of, OutputStream *ost)
 
int enc_open (OutputStream *ost, const AVFrame *frame)
 
static int check_recording_time (OutputStream *ost, int64_t ts, AVRational tb)
 
int enc_subtitle (OutputFile *of, OutputStream *ost, const AVSubtitle *sub)
 
void enc_stats_write (OutputStream *ost, EncStats *es, const AVFrame *frame, const AVPacket *pkt, uint64_t frame_num)
 
static double psnr (double d)
 
static int update_video_stats (OutputStream *ost, const AVPacket *pkt, int write_vstats)
 
static int encode_frame (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static int submit_encode_frame (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static int do_audio_out (OutputFile *of, OutputStream *ost, AVFrame *frame)
 
static enum AVPictureType forced_kf_apply (void *logctx, KeyframeForceCtx *kf, AVRational tb, const AVFrame *in_picture)
 
static int do_video_out (OutputFile *of, OutputStream *ost, AVFrame *in_picture)
 
int enc_frame (OutputStream *ost, AVFrame *frame)
 
int enc_flush (void)
 

Function Documentation

◆ enc_free()

void enc_free ( Encoder **  penc)

Definition at line 56 of file ffmpeg_enc.c.

Referenced by enc_alloc(), and ost_free().

◆ enc_alloc()

int enc_alloc ( Encoder **  penc,
const AVCodec codec 
)

Definition at line 70 of file ffmpeg_enc.c.

Referenced by ost_add().

◆ hw_device_setup_for_encode()

static int hw_device_setup_for_encode ( OutputStream ost,
AVBufferRef frames_ref 
)
static

Definition at line 92 of file ffmpeg_enc.c.

Referenced by enc_open().

◆ set_encoder_id()

static int set_encoder_id ( OutputFile of,
OutputStream ost 
)
static

Definition at line 143 of file ffmpeg_enc.c.

Referenced by enc_open().

◆ enc_open()

int enc_open ( OutputStream ost,
const AVFrame frame 
)

Definition at line 168 of file ffmpeg_enc.c.

Referenced by enc_frame(), fg_transcode_step(), and init_output_stream_nofilter().

◆ check_recording_time()

static int check_recording_time ( OutputStream ost,
int64_t  ts,
AVRational  tb 
)
static

Definition at line 383 of file ffmpeg_enc.c.

Referenced by do_audio_out(), do_video_out(), and enc_subtitle().

◆ enc_subtitle()

int enc_subtitle ( OutputFile of,
OutputStream ost,
const AVSubtitle sub 
)

Definition at line 395 of file ffmpeg_enc.c.

Referenced by process_subtitle().

◆ enc_stats_write()

void enc_stats_write ( OutputStream ost,
EncStats es,
const AVFrame frame,
const AVPacket pkt,
uint64_t  frame_num 
)

Definition at line 481 of file ffmpeg_enc.c.

Referenced by encode_frame(), and write_packet().

◆ psnr()

static double psnr ( double  d)
inlinestatic

Definition at line 548 of file ffmpeg_enc.c.

Referenced by main(), run_psnr(), uninit(), and update_video_stats().

◆ update_video_stats()

static int update_video_stats ( OutputStream ost,
const AVPacket pkt,
int  write_vstats 
)
static

Definition at line 553 of file ffmpeg_enc.c.

Referenced by encode_frame().

◆ encode_frame()

static int encode_frame ( OutputFile of,
OutputStream ost,
AVFrame frame 
)
static

Definition at line 613 of file ffmpeg_enc.c.

Referenced by submit_encode_frame().

◆ submit_encode_frame()

static int submit_encode_frame ( OutputFile of,
OutputStream ost,
AVFrame frame 
)
static

Definition at line 714 of file ffmpeg_enc.c.

Referenced by do_audio_out(), do_video_out(), and enc_flush().

◆ do_audio_out()

static int do_audio_out ( OutputFile of,
OutputStream ost,
AVFrame frame 
)
static

Definition at line 761 of file ffmpeg_enc.c.

Referenced by enc_frame().

◆ forced_kf_apply()

static enum AVPictureType forced_kf_apply ( void *  logctx,
KeyframeForceCtx kf,
AVRational  tb,
const AVFrame in_picture 
)
static

Definition at line 781 of file ffmpeg_enc.c.

Referenced by do_video_out().

◆ do_video_out()

static int do_video_out ( OutputFile of,
OutputStream ost,
AVFrame in_picture 
)
static

Definition at line 828 of file ffmpeg_enc.c.

Referenced by enc_frame().

◆ enc_frame()

int enc_frame ( OutputStream ost,
AVFrame frame 
)

Definition at line 850 of file ffmpeg_enc.c.

Referenced by fg_output_frame(), and submit_encode_frame().

◆ enc_flush()

int enc_flush ( void  )

Definition at line 863 of file ffmpeg_enc.c.

Referenced by transcode().