Vuo  0.5.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Functions
VuoMovie.cc File Reference

Description

VuoMovie implementation.

Classes

class  VuoMovieDecoder
 Instance class used to control the playback of video. More...
 
struct  VuoMovieDecoder::AVContainer
 Internal struct which contains context and current playback status of VuoMovieDecoder. More...
 

Macros

#define SEC_PER_USEC   .000001
 Seconds per microsecond. Vuo nodes want information in seconds, where ffmpeg operates in microseconds.
 
#define REWIND   .1
 How many seconds behind the requested frame to seek.
 
#define REWIND_INCREMENT   .2
 If the REWIND value does not seek far enough, increment by this value.
 

Functions

void VuoMovie_free (void *movie)
 Releases ffmpeg resources created during this object's lifecycle.
 
VuoMovie VuoMovie_make (const char *path)
 VuoMovie_make: Creates a new VuoMovieDecoder object and returns itself.
 
bool VuoMovie_getNextFrame (VuoMovie movie, VuoImage *image, double *nextFrame)
 VuoMovie_getNextFrame gets the next full frame's image and presentation timestamp (in seconds).
 
bool VuoMovie_getPreviousFrame (VuoMovie movie, VuoImage *image, double *previousFrame)
 Returns the frame prior to the internal currently queued frame, and the presentation timestamp associated.
 
bool VuoMovie_seekToSecond (VuoMovie movie, double second)
 Seeks the video to the specified second.
 
double VuoMovie_getCurrentSecond (VuoMovie movie)
 Returns the last successfully decoded timestamp.
 
double VuoMovie_getDuration (VuoMovie movie)
 Returns the duration of the movie in seconds.
 
bool VuoMovie_getInfo (const char *path, double *duration)
 Given a path, this will open and close a video stream and return the duration.
 

Class Documentation

struct VuoMovieDecoder::AVContainer
Class Members
double duration
int64_t firstFrame
int64_t lastFrame
int64_t lastPts
int64_t lastTimestamp
int packetDuration
AVCodecContext * pCodecCtx
AVFormatContext * pFormatCtx
int64_t startPts
AVStream * video_st
int videoStreamIndex

Macro Definition Documentation

#define REWIND   .1

How many seconds behind the requested frame to seek.

#define REWIND_INCREMENT   .2

If the REWIND value does not seek far enough, increment by this value.

#define SEC_PER_USEC   .000001

Seconds per microsecond. Vuo nodes want information in seconds, where ffmpeg operates in microseconds.

Function Documentation

void VuoMovie_free ( void *  movie)

Releases ffmpeg resources created during this object's lifecycle.

Todo:
Close movie file and free memory. (https://b33p.net/kosada/node/6595)
double VuoMovie_getCurrentSecond ( VuoMovie  movie)

Returns the last successfully decoded timestamp.

double VuoMovie_getDuration ( VuoMovie  movie)

Returns the duration of the movie in seconds.

bool VuoMovie_getInfo ( const char *  path,
double *  duration 
)

Given a path, this will open and close a video stream and return the duration.

bool VuoMovie_getNextFrame ( VuoMovie  movie,
VuoImage image,
double *  nextFrame 
)

VuoMovie_getNextFrame gets the next full frame's image and presentation timestamp (in seconds).

Will return true if next frame is found and false if not.

bool VuoMovie_getPreviousFrame ( VuoMovie  movie,
VuoImage image,
double *  previousFrame 
)

Returns the frame prior to the internal currently queued frame, and the presentation timestamp associated.

VuoMovie VuoMovie_make ( const char *  path)

VuoMovie_make: Creates a new VuoMovieDecoder object and returns itself.

Parameters
pathAn absolute path to the video file to open.
Returns
A new VuoMovie object, which may be used to control playback of the film. If the video file fails to open for any reason, this returns NULL.
bool VuoMovie_seekToSecond ( VuoMovie  movie,
double  second 
)

Seeks the video to the specified second.