VideoParser 0.2.0
C++ Video Bitstream Parsing Library
Loading...
Searching...
No Matches
videoparser::VideoParser Class Reference

A Video Parser implementation. More...

Public Member Functions

 VideoParser (const char *filename)
 Construct a new Video Parser object.
SequenceInfo get_sequence_info ()
 Get information about the video sequence.
bool parse_frame (FrameInfo &frame_info)
 Parse the next frame in the video.
void close ()
 Close the video file and free resources.

Detailed Description

A Video Parser implementation.

This class is used to parse video files and extract information about the video sequence and individual frames. Call get_sequence_info() to get the general information about the video sequence, either before or after parsing the frames. Call parse_frame() to parse the next frame and get its information, in a loop. After parsing all frames, call close() to close the file and free all resources.

Constructor & Destructor Documentation

◆ VideoParser()

videoparser::VideoParser::VideoParser ( const char * filename)

Construct a new Video Parser object.

Opens the specified video file and initializes the parser. This constructor will throw exceptions if the file cannot be opened or if no video stream is found.

Parameters
filenameC-style string path to the video file to parse
Exceptions
std::runtime_errorIf the file cannot be opened or no video stream is found

Member Function Documentation

◆ close()

void videoparser::VideoParser::close ( )

Close the video file and free resources.

This method should be called after parsing is complete to properly close the video file and free all allocated resources.

◆ get_sequence_info()

SequenceInfo videoparser::VideoParser::get_sequence_info ( )

Get information about the video sequence.

This method can be called either before or after parsing frames.

Returns
SequenceInfo Struct containing general information about the video sequence

◆ parse_frame()

bool videoparser::VideoParser::parse_frame ( FrameInfo & frame_info)

Parse the next frame in the video.

This method should be called in a loop to parse all frames in the video. It will fill the provided frame_info struct with information about the parsed frame.

Parameters
frame_infoReference to a FrameInfo struct to be filled with frame information
Returns
true If a frame was successfully parsed
false If no more frames are available or an error occurred