MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_writer() [2/2]

std::shared_ptr< VideoFileWriter > MayaFlux::IO::IOManager::create_writer ( const std::string &  filepath,
uint32_t  width,
uint32_t  height,
double  frame_rate,
AVPixelFormat  src_pixel_format,
AVCodecID  codec_id = AV_CODEC_ID_NONE 
)

Construct an open VideoFileWriter the caller drives manually.

Allocates and opens the writer. IOManager does not track this writer; the caller is responsible for calling close() or stop_recording() when done.

Parameters
filepathOutput file path. Extension determines container.
widthFrame width in pixels.
heightFrame height in pixels.
frame_rateAverage frame rate in frames per second.
src_pixel_formatAVPixelFormat of submitted pixel data.
codec_idEncoder override; AV_CODEC_ID_NONE = container default.
Returns
Open VideoFileWriter, or nullptr if open() failed.

Definition at line 464 of file IOManager.cpp.

470{
471 auto writer = std::make_shared<VideoFileWriter>();
472 if (!writer->open(filepath, width, height, frame_rate, src_pixel_format, codec_id)) {
474 "create_writer: open failed for '{}': {}", filepath, writer->last_error());
475 return nullptr;
476 }
477 return writer;
478}
#define MF_ERROR(comp, ctx,...)
uint32_t width
Definition Decoder.cpp:59
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.

References MayaFlux::Journal::FileIO, MayaFlux::Journal::IO, MF_ERROR, and width.