CVB++ 15.0
Loading...
Searching...
No Matches

A container file for reading encoded videos from disk. More...

#include <cvb/codec_bridge/input_container.hpp>

Public Member Functions

std::unique_ptr< DecoderVideoDecoder (const Cvb::String &name, CodecBridge::PixelFormat pixelFormat=CodecBridge::PixelFormat::None)
 Get or create a video decoder for this container file.
 
std::unique_ptr< DecoderVideoDecoder (CodecBridge::PixelFormat pixelFormat=CodecBridge::PixelFormat::None)
 Get or create a video decoder for this container file.
 
std::unique_ptr< PacketNextPacket ()
 Get the next packet from the container.
 

Static Public Member Functions

static std::unique_ptr< InputContainerCreate (const Cvb::String &fileName)
 Creates an input container based on a file name.
 

Detailed Description

A container file for reading encoded videos from disk.

Member Function Documentation

◆ Create()

static std::unique_ptr< InputContainer > Create ( const Cvb::String & fileName)
inlinestatic

Creates an input container based on a file name.

Parameters
[in]fileNameThe file name for the container file.
Returns
A pointer to a container object.
Exceptions
Anyexception derived from std::exception including CvbException.

The file is closed after the container is released.

The format of the container is determined by the file extension. The format must be supported by FFmpeg. Use FFmpeg.exe -h formats to checkout valid formats.

◆ NextPacket()

std::unique_ptr< Packet > NextPacket ( )
inline

Get the next packet from the container.

Returns
A pointer to the packet object (may be empty).
Exceptions
Anyexception derived from std::exception including CvbException.

The returned packet may refer to any stream (e.g video, audio) in the container. If no data is left this method will return empty pointers.

◆ VideoDecoder() [1/2]

Get or create a video decoder for this container file.

Parameters
[in]pixelFormatTarget pixel format for decoding the frames (None means default).
Returns
A pointer to the decoder.
Exceptions
Anyexception derived from std::exception including CvbException.

This method will pick the first decoder that can handle the container and its content. If the decoder supports multiple formats a target pixel format may also be used. Both parameters are only requests and may be ignored.

◆ VideoDecoder() [2/2]

std::unique_ptr< Decoder > VideoDecoder ( const Cvb::String & name,
CodecBridge::PixelFormat pixelFormat = CodecBridge::PixelFormat::None )
inline

Get or create a video decoder for this container file.

Parameters
[in]nameThe name of the decoder, must match the container.
[in]pixelFormatTarget pixel format for decoding the frames (None means default).
Returns
A pointer to the decoder.
Exceptions
Anyexception derived from std::exception including CvbException.

This method will pick the first decoder that can handle the container and its content. The name may can be used pick a specific decoder. If the decoder supports multiple formats a target pixel format may also be used. Both parameters are only requests and may be ignored.