CVB++ 15.0
OutputContainer Class Referencefinal

A container file for writing encoded videos to disk. More...

#include <cvb/codec_bridge/output_container.hpp>

Public Member Functions

void WritePacket (std::unique_ptr< Packet > &&packet)
 Write a packet to the container. More...
 
void WriteHeader ()
 Write a header to the container. More...
 
void WriteTrailer ()
 Write a trailer to the container. More...
 

Static Public Member Functions

static std::unique_ptr< OutputContainerCreate (const Cvb::String &fileName, Encoder &encoder)
 Creates an output container based on a file name and an encoder. More...
 

Detailed Description

A container file for writing encoded videos to disk.

Member Function Documentation

◆ Create()

static std::unique_ptr< OutputContainer > Create ( const Cvb::String fileName,
Encoder encoder 
)
inlinestatic

Creates an output container based on a file name and an encoder.

Parameters
[in]fileNameThe file name for the container file.
[in]encoderThe encoder that will provide the encoded packets for the container.
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 support the encoder. Use FFmpeg.exe -h formats to checkout valid formats.

◆ WriteHeader()

void WriteHeader ( )
inline

Write a header to the container.

Exceptions
Anyexception derived from std::exception including CvbException.

The header must be written before any packets are written.

◆ WritePacket()

void WritePacket ( std::unique_ptr< Packet > &&  packet)
inline

Write a packet to the container.

Parameters
[in]packetThe packet to write.
Exceptions
Anyexception derived from std::exception including CvbException.

The packet will be consumed by the container. You must not use it again after writing.

◆ WriteTrailer()

void WriteTrailer ( )
inline

Write a trailer to the container.

Exceptions
Anyexception derived from std::exception including CvbException.

The trailer must be written after all packets are written.