Vuo  2.1.1
Functions | Variables
VuoFfmpegUtility Namespace Reference

Description

Helper methods for working with ffmpeg.

Functions

static double AvTimeToSecond (AVStream *stream, int64_t pts)
 Converts AVStream presentation timestamp to fractional seconds. More...
 
static int64_t AvTimeToMicrosecond (AVStream *stream, int64_t pts)
 Converts AVStream presentation timestamp to integer microseconds. More...
 
static int64_t SecondToAvTime (AVStream *stream, double second)
 Converts seconds to microseconds. More...
 
static int FirstStreamIndexWithMediaType (AVFormatContext *context, AVMediaType type)
 Return the index of the first stream matching the media type. More...
 
static void FlipImageBytesVertical (uint8_t *buffer, uint width, uint height)
 Flip an image vertically. More...
 
static bool ConvertAVFrameToRGB (AVFrame *dst, AVPixelFormat dst_pix_fmt, AVFrame *src, AVPixelFormat pix_fmt, int width, int height)
 Convert an AVFrame from whatever format it was originally in to RGB. More...
 
static VuoImage VuoImageWithAVFrame (AVCodecContext *videoCodecCtx, AVFrame *frame)
 Convert an AVFrame to a VuoImage. More...
 

Variables

const double USEC_TO_SECOND = .000001
 Multiply by this to convert microsecond to seconds. More...
 
const double SEC_TO_USEC = 1000000
 Multiply a second by this value to convert to microsecond. More...
 
bool warnedAboutSlowFlip = false
 Whether we've already shown a warning about using the slow flipper code path. More...
 

Function Documentation

◆ AvTimeToMicrosecond()

static int64_t VuoFfmpegUtility::AvTimeToMicrosecond ( AVStream *  stream,
int64_t  pts 
)
static

Converts AVStream presentation timestamp to integer microseconds.

Definition at line 56 of file VuoFfmpegUtility.h.

◆ AvTimeToSecond()

static double VuoFfmpegUtility::AvTimeToSecond ( AVStream *  stream,
int64_t  pts 
)
static

Converts AVStream presentation timestamp to fractional seconds.

Definition at line 48 of file VuoFfmpegUtility.h.

◆ ConvertAVFrameToRGB()

static bool VuoFfmpegUtility::ConvertAVFrameToRGB ( AVFrame *  dst,
AVPixelFormat  dst_pix_fmt,
AVFrame *  src,
AVPixelFormat  pix_fmt,
int  width,
int  height 
)
static

Convert an AVFrame from whatever format it was originally in to RGB.

Definition at line 107 of file VuoFfmpegUtility.h.

◆ FirstStreamIndexWithMediaType()

static int VuoFfmpegUtility::FirstStreamIndexWithMediaType ( AVFormatContext *  context,
AVMediaType  type 
)
static

Return the index of the first stream matching the media type.

Definition at line 76 of file VuoFfmpegUtility.h.

◆ FlipImageBytesVertical()

static void VuoFfmpegUtility::FlipImageBytesVertical ( uint8_t *  buffer,
uint  width,
uint  height 
)
static

Flip an image vertically.

Definition at line 87 of file VuoFfmpegUtility.h.

◆ SecondToAvTime()

static int64_t VuoFfmpegUtility::SecondToAvTime ( AVStream *  stream,
double  second 
)
static

Converts seconds to microseconds.

Definition at line 64 of file VuoFfmpegUtility.h.

◆ VuoImageWithAVFrame()

static VuoImage VuoFfmpegUtility::VuoImageWithAVFrame ( AVCodecContext *  videoCodecCtx,
AVFrame *  frame 
)
static

Convert an AVFrame to a VuoImage.

Definition at line 166 of file VuoFfmpegUtility.h.

Variable Documentation

◆ SEC_TO_USEC

const double VuoFfmpegUtility::SEC_TO_USEC = 1000000

Multiply a second by this value to convert to microsecond.

Definition at line 45 of file VuoFfmpegUtility.h.

◆ USEC_TO_SECOND

const double VuoFfmpegUtility::USEC_TO_SECOND = .000001

Multiply by this to convert microsecond to seconds.

Definition at line 42 of file VuoFfmpegUtility.h.

◆ warnedAboutSlowFlip

bool VuoFfmpegUtility::warnedAboutSlowFlip = false

Whether we've already shown a warning about using the slow flipper code path.

Definition at line 102 of file VuoFfmpegUtility.h.