YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FfmpegWriter.cpp File Reference
#include "FfmpegWriter.h"
#include "ffmpeg_api.h"
#include <yarp/os/all.h>
#include <yarp/sig/all.h>
#include <yarp/os/Log.h>
#include <yarp/os/LogComponent.h>
#include <cstdlib>
#include <cstring>
#include <cmath>
+ Include dependency graph for FfmpegWriter.cpp:

Go to the source code of this file.

Macros

#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 AVStreamadd_audio_stream (AVFormatContext *oc, AVCodecID 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 AVStreamadd_video_stream (AVFormatContext *oc, AVCodecID codec_id, int w, int h, int framerate)
 
static AVFramealloc_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_tsamples
 
int samples_size
 
int samples_at
 
int samples_channels
 
uint8_taudio_outbuf
 
int audio_outbuf_size
 
int audio_input_frame_size
 

Macro Definition Documentation

◆ M_PI

#define M_PI   3.1415926535897931

Definition at line 51 of file FfmpegWriter.cpp.

◆ STREAM_FRAME_RATE

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

Definition at line 54 of file FfmpegWriter.cpp.

◆ STREAM_PIX_FMT

#define STREAM_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */

Definition at line 55 of file FfmpegWriter.cpp.

◆ STREAM_PIX_WORK

#define STREAM_PIX_WORK   AV_PIX_FMT_RGB24

Definition at line 56 of file FfmpegWriter.cpp.

Function Documentation

◆ add_audio_stream()

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

Definition at line 85 of file FfmpegWriter.cpp.

◆ add_video_stream()

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

Definition at line 337 of file FfmpegWriter.cpp.

◆ alloc_picture()

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

Definition at line 384 of file FfmpegWriter.cpp.

◆ close_audio()

static void close_audio ( AVFormatContext oc,
AVStream st 
)
static

Definition at line 324 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 452 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 165 of file FfmpegWriter.cpp.

◆ make_audio_frame()

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

Definition at line 181 of file FfmpegWriter.cpp.

◆ open_audio()

static void open_audio ( AVFormatContext oc,
AVStream st 
)
static

Definition at line 106 of file FfmpegWriter.cpp.

◆ write_audio_frame() [1/2]

static void write_audio_frame ( AVFormatContext oc,
AVStream st 
)
static

Definition at line 210 of file FfmpegWriter.cpp.

◆ write_audio_frame() [2/2]

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

Definition at line 252 of file FfmpegWriter.cpp.

Variable Documentation

◆ audio_input_frame_size

int audio_input_frame_size

Definition at line 80 of file FfmpegWriter.cpp.

◆ audio_outbuf

uint8_t* audio_outbuf

Definition at line 78 of file FfmpegWriter.cpp.

◆ audio_outbuf_size

int audio_outbuf_size

Definition at line 79 of file FfmpegWriter.cpp.

◆ samples

int16_t* samples

Definition at line 73 of file FfmpegWriter.cpp.

◆ samples_at

int samples_at

Definition at line 75 of file FfmpegWriter.cpp.

◆ samples_channels

int samples_channels

Definition at line 76 of file FfmpegWriter.cpp.

◆ samples_size

int samples_size

Definition at line 74 of file FfmpegWriter.cpp.

◆ t

◆ tincr

float tincr

Definition at line 71 of file FfmpegWriter.cpp.

◆ tincr2

float tincr2

Definition at line 71 of file FfmpegWriter.cpp.