YARP  2.3.70
Yet Another Robot Platform
FfmpegWriter.cpp File Reference
#include "FfmpegWriter.h"
#include <yarp/os/all.h>
#include <yarp/sig/all.h>
#include "ffmpeg_api.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
+ Include dependency graph for FfmpegWriter.cpp:

Go to the source code of this file.

Macros

#define DBG   if (0)
 
#define M_PI   3.1415926535897931
 
#define STREAM_FRAME_RATE   25 /* 25 images/s */
 
#define STREAM_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */
 
#define STREAM_PIX_WORK   AV_PIX_FMT_RGB24
 

Functions

static AVStream * add_audio_stream (AVFormatContext *oc, CodecID codec_id)
 
static void open_audio (AVFormatContext *oc, AVStream *st)
 
static void get_audio_frame (int16_t *samples, int frame_size, int nb_channels)
 
static void make_audio_frame (AVCodecContext *c, AVFrame *&frame, void *&samples)
 
static void write_audio_frame (AVFormatContext *oc, AVStream *st)
 
static void write_audio_frame (AVFormatContext *oc, AVStream *st, Sound &snd)
 
static void close_audio (AVFormatContext *oc, AVStream *st)
 
static AVStream * add_video_stream (AVFormatContext *oc, CodecID codec_id, int w, int h, int framerate)
 
static AVFrame * alloc_picture (int pix_fmt, int width, int height)
 
static void fill_rgb_image (AVFrame *pict, int frame_index, int width, int height, ImageOf< PixelRgb > &img)
 

Variables

float t
 
float tincr
 
float tincr2
 
int16_t * samples
 
int samples_size
 
int samples_at
 
int samples_channels
 
uint8_t * audio_outbuf
 
int audio_outbuf_size
 
int audio_input_frame_size
 

Macro Definition Documentation

◆ DBG

#define DBG   if (0)

Definition at line 50 of file FfmpegWriter.cpp.

◆ M_PI

#define M_PI   3.1415926535897931

Definition at line 60 of file FfmpegWriter.cpp.

◆ STREAM_FRAME_RATE

#define STREAM_FRAME_RATE   25 /* 25 images/s */

Definition at line 66 of file FfmpegWriter.cpp.

◆ STREAM_PIX_FMT

#define STREAM_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */

Definition at line 67 of file FfmpegWriter.cpp.

◆ STREAM_PIX_WORK

#define STREAM_PIX_WORK   AV_PIX_FMT_RGB24

Definition at line 68 of file FfmpegWriter.cpp.

Function Documentation

◆ add_audio_stream()

static AVStream* add_audio_stream ( AVFormatContext *  oc,
CodecID  codec_id 
)
static

Definition at line 87 of file FfmpegWriter.cpp.

◆ add_video_stream()

static AVStream* add_video_stream ( AVFormatContext *  oc,
CodecID  codec_id,
int  w,
int  h,
int  framerate 
)
static

Definition at line 363 of file FfmpegWriter.cpp.

◆ alloc_picture()

static AVFrame* alloc_picture ( int  pix_fmt,
int  width,
int  height 
)
static

Definition at line 412 of file FfmpegWriter.cpp.

◆ close_audio()

static void close_audio ( AVFormatContext *  oc,
AVStream *  st 
)
static

Definition at line 350 of file FfmpegWriter.cpp.

◆ fill_rgb_image()

static void fill_rgb_image ( AVFrame *  pict,
int  frame_index,
int  width,
int  height,
ImageOf< PixelRgb > &  img 
)
static

Definition at line 490 of file FfmpegWriter.cpp.

◆ get_audio_frame()

static void get_audio_frame ( int16_t *  samples,
int  frame_size,
int  nb_channels 
)
static

Definition at line 170 of file FfmpegWriter.cpp.

◆ make_audio_frame()

static void make_audio_frame ( AVCodecContext *  c,
AVFrame *&  frame,
void *&  samples 
)
static

Definition at line 186 of file FfmpegWriter.cpp.

◆ open_audio()

static void open_audio ( AVFormatContext *  oc,
AVStream *  st 
)
static

Definition at line 109 of file FfmpegWriter.cpp.

◆ write_audio_frame() [1/2]

static void write_audio_frame ( AVFormatContext *  oc,
AVStream *  st 
)
static

Definition at line 219 of file FfmpegWriter.cpp.

◆ write_audio_frame() [2/2]

static void write_audio_frame ( AVFormatContext *  oc,
AVStream *  st,
Sound snd 
)
static

Definition at line 266 of file FfmpegWriter.cpp.

Variable Documentation

◆ audio_input_frame_size

int audio_input_frame_size

Definition at line 82 of file FfmpegWriter.cpp.

◆ audio_outbuf

uint8_t* audio_outbuf

Definition at line 80 of file FfmpegWriter.cpp.

◆ audio_outbuf_size

int audio_outbuf_size

Definition at line 81 of file FfmpegWriter.cpp.

◆ samples

int16_t* samples

Definition at line 75 of file FfmpegWriter.cpp.

◆ samples_at

int samples_at

Definition at line 77 of file FfmpegWriter.cpp.

◆ samples_channels

int samples_channels

Definition at line 78 of file FfmpegWriter.cpp.

◆ samples_size

int samples_size

Definition at line 76 of file FfmpegWriter.cpp.

◆ t

◆ tincr

float tincr

Definition at line 73 of file FfmpegWriter.cpp.

◆ tincr2

float tincr2

Definition at line 73 of file FfmpegWriter.cpp.