L4T Multimedia API Reference

27.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Video Read/Write

Detailed Description

Utility functions for reading video frames from a file to the buffer structure and for writing from the buffer structure to a file.

Functions

int read_video_frame (std::ifstream *stream, NvBuffer &buffer)
 Reads a video frame from a file to the buffer structure. More...
 
int write_video_frame (std::ofstream *stream, NvBuffer &buffer)
 Writes a video frame from the buffer structure to a file. More...
 

Function Documentation

int read_video_frame ( std::ifstream *  stream,
NvBuffer buffer 
)

Reads a video frame from a file to the buffer structure.

This function reads data from the file into the buffer plane-by-plane. While taking care of the stride of the plane, for each data plane it reads:

width * height * byteperpixel
Parameters
[in]streamA pointer to the input file stream.
[in]bufferA reference to the buffer object into which the data are read.
Returns
0 for success, -1 otherwise.
int write_video_frame ( std::ofstream *  stream,
NvBuffer buffer 
)

Writes a video frame from the buffer structure to a file.

This function writes data to the file from the buffer plane-by-plane. While taking care of the stride of the plane, for each data plane it reads:

width * height * byteperpixel
Parameters
[in]streamA pointer to the output file stream.
[in]bufferA reference to the buffer object from which the data are written.
Returns
0 for success, -1 otherwise.