|
The blo Library
|
Audio/Video file output using FFmpeg. More...
#include <AVFileOut.h>
Public Member Functions | |
| AVFileOut () | |
| Default constructor. | |
| AVFileOut (const char *filename) | |
| Constructs AV file output. | |
| AVFileOut (const AVOutputFormat *pOutputFormat, const char *formatName, const char *filename) | |
| Constructs AV file output. | |
| AVFileOut (const AVFileOut &rhs)=delete | |
| virtual | ~AVFileOut () |
| Destructor. | |
| AVFileOut & | operator= (const AVFileOut &rhs)=delete |
| void | open (const char *filename) |
| Opens output file. | |
| void | open (const AVOutputFormat *pOutputFormat, const char *formatName, const char *filename) |
| Opens output file. | |
| bool | isOpen () const |
| Tests if the file is open. | |
| void | close () |
| Closes file. | |
| int | addAudioStream (AVCodecID codecID, AVSampleFormat sampleFormat, uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance=-1) |
| Adds an audio stream to the file. | |
| int | addAudioStream (AVSampleFormat sampleFormat, uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance=-1) |
| Adds an audio stream to the file using the default audio codec of the file format. | |
| template<typename T > | |
| int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance=-1) |
| Adds an audio stream to the file using the default audio codec of the file format. | |
| template<typename T > | |
| int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance=-1) |
| Adds an audio stream to the file using the default audio codec of the file format, mono. | |
| template<typename T > | |
| int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance=-1) |
| Adds an audio stream to the file using the default audio codec of the file format, stereo. | |
| template<typename T > | |
| void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const T *pSrc, int len) |
| Writes an audio frame to the stream. | |
| template<typename T > | |
| void | writeAudioFrame_Mono (int streamNumber, const T *pSrc, int len) |
| Writes an audio frame to the stream, mono. | |
| template<typename T > | |
| void | writeAudioFrame_Stereo (int streamNumber, const T *pSrc, int len) |
| Writes an audio frame to the stream, stereo. | |
| int | addVideoStream (AVCodecID codecID, AVPixelFormat pixelFormat, int width, int height, double frameRate, int bitrate, int bitrateTolerance=-1, double pixelAspectRatio=1) |
| Adds a video stream to the file. | |
| int | addVideoStream (AVPixelFormat pixelFormat, int width, int height, double frameRate, int bitrate, int bitrateTolerance=-1, double pixelAspectRatio=1) |
| Adds a video stream to the file using the default video codec of the file format. | |
| int | addVideoStream_YUV420P (int width, int height, double frameRate, int bitrate, int bitrateTolerance=-1, double pixelAspectRatio=1) |
| Adds a video stream to the file using the default video codec of the file format, YUV420P. | |
| void | writeVideoFrame (int streamNumber, double pts, AVPixelFormat srcPixelFormat, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream. | |
| void | writeVideoFrame_Y_C1 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, Y. | |
| void | writeVideoFrame_RGB_C3 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, RGB. | |
| void | writeVideoFrame_BGR_C3 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, BGR. | |
| void | writeVideoFrame_RGBA_C4 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, RGBA. | |
| void | writeVideoFrame_BGRA_C4 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, BGRA. | |
| void | writeVideoFrame_ARGB_C4 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, ARGB. | |
| void | writeVideoFrame_ABGR_C4 (int streamNumber, double pts, const uint8_t *pSrc, int srcStep, int roiWidth, int roiHeight, InterlacedFrame interlacedFrame=InterlacedFrame::noninterlaced) |
| Writes a frame to the stream, ABGR. | |
Related Functions | |
(Note that these are not member functions.) | |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream (uint64_t channelLayout, int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Mono (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API int | addAudioStream_Stereo (int sampleRate, int bitrate, int &frameSize, int bitrateTolerance) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const uint8_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const int16_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const int32_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const float *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame (int streamNumber, uint64_t srcChannelLayout, const double *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Mono (int streamNumber, const uint8_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Mono (int streamNumber, const int16_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Mono (int streamNumber, const int32_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Mono (int streamNumber, const float *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Mono (int streamNumber, const double *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Stereo (int streamNumber, const uint8_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Stereo (int streamNumber, const int16_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Stereo (int streamNumber, const int32_t *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Stereo (int streamNumber, const float *pSrc, int len) |
| BLO_EXPIMP_TEMPLATE template BLO_API void | writeAudioFrame_Stereo (int streamNumber, const double *pSrc, int len) |
Audio/Video file output using FFmpeg.
| blo::AVFileOut::AVFileOut | ( | ) |
Default constructor.
|
explicit |
Constructs AV file output.
| filename | Filename string. |
| blo::AVFileOut::AVFileOut | ( | const AVOutputFormat * | pOutputFormat, |
| const char * | formatName, | ||
| const char * | filename | ||
| ) |
Constructs AV file output.
This function constructs the AV file output. If pOutputFormat is nullptr, then formatName is used. If formatName is nullptr, then filename is used.
| pOutputFormat | Pointer to output format to use (force). |
| formatName | Format name string. |
| filename | Filename string. |
|
delete |
|
virtual |
Destructor.
| int blo::AVFileOut::addAudioStream | ( | AVCodecID | codecID, |
| AVSampleFormat | sampleFormat, | ||
| uint64_t | channelLayout, | ||
| int | sampleRate, | ||
| int | bitrate, | ||
| int & | frameSize, | ||
| int | bitrateTolerance = -1 |
||
| ) |
Adds an audio stream to the file.
| codecID | The codec ID of the stream. |
| sampleFormat | The sample format of the stream. |
| channelLayout | The channel layout of the stream. |
| sampleRate | The sample rate of the stream. |
| bitrate | The bitrate of the stream. |
| frameSize | The frame size in samples/channel. |
| bitrateTolerance | The bitrate tolerance. |
| int blo::AVFileOut::addAudioStream | ( | AVSampleFormat | sampleFormat, |
| uint64_t | channelLayout, | ||
| int | sampleRate, | ||
| int | bitrate, | ||
| int & | frameSize, | ||
| int | bitrateTolerance = -1 |
||
| ) |
Adds an audio stream to the file using the default audio codec of the file format.
| sampleFormat | The sample format of the stream. |
| channelLayout | The channel layout of the stream. |
| sampleRate | The sample rate of the stream. |
| bitrate | The bitrate of the stream. |
| frameSize | The frame size in samples/channel. |
| bitrateTolerance | The bitrate tolerance. |
| int blo::AVFileOut::addAudioStream | ( | uint64_t | channelLayout, |
| int | sampleRate, | ||
| int | bitrate, | ||
| int & | frameSize, | ||
| int | bitrateTolerance = -1 |
||
| ) |
Adds an audio stream to the file using the default audio codec of the file format.
| T | Data type (sample format) of the stream. |
| channelLayout | The channel layout of the stream. |
| sampleRate | The sample rate of the stream. |
| bitrate | The bitrate of the stream. |
| frameSize | The frame size in samples/channel. |
| bitrateTolerance | The bitrate tolerance. |
| int blo::AVFileOut::addAudioStream_Mono | ( | int | sampleRate, |
| int | bitrate, | ||
| int & | frameSize, | ||
| int | bitrateTolerance = -1 |
||
| ) |
Adds an audio stream to the file using the default audio codec of the file format, mono.
| T | Data type (sample format) of the stream. |
| sampleRate | The sample rate of the stream. |
| bitrate | The bitrate of the stream. |
| frameSize | The frame size in samples. |
| bitrateTolerance | The bitrate tolerance. |
| int blo::AVFileOut::addAudioStream_Stereo | ( | int | sampleRate, |
| int | bitrate, | ||
| int & | frameSize, | ||
| int | bitrateTolerance = -1 |
||
| ) |
Adds an audio stream to the file using the default audio codec of the file format, stereo.
| T | Data type (sample format) of the stream. |
| sampleRate | The sample rate of the stream. |
| bitrate | The bitrate of the stream. |
| frameSize | The frame size in samples/channel. |
| bitrateTolerance | The bitrate tolerance. |
| int blo::AVFileOut::addVideoStream | ( | AVCodecID | codecID, |
| AVPixelFormat | pixelFormat, | ||
| int | width, | ||
| int | height, | ||
| double | frameRate, | ||
| int | bitrate, | ||
| int | bitrateTolerance = -1, |
||
| double | pixelAspectRatio = 1 |
||
| ) |
Adds a video stream to the file.
| codecID | The codec ID of the stream. |
| pixelFormat | The pixel format of the stream. |
| width | The width of the frames in the stream. |
| height | The height of the frames in the stream. |
| frameRate | The frame rate of the stream in frames/s. |
| bitrate | The bitrate of the stream. |
| bitrateTolerance | The bitrate tolerance. |
| pixelAspectRatio | The pixel aspect ratio. |
| int blo::AVFileOut::addVideoStream | ( | AVPixelFormat | pixelFormat, |
| int | width, | ||
| int | height, | ||
| double | frameRate, | ||
| int | bitrate, | ||
| int | bitrateTolerance = -1, |
||
| double | pixelAspectRatio = 1 |
||
| ) |
Adds a video stream to the file using the default video codec of the file format.
| pixelFormat | The pixel format of the stream. |
| width | The width of the frames in the stream. |
| height | The height of the frames in the stream. |
| frameRate | The frame rate of the stream in frames/s. |
| bitrate | The bitrate of the stream. |
| bitrateTolerance | The bitrate tolerance. |
| pixelAspectRatio | The pixel aspect ratio. |
| int blo::AVFileOut::addVideoStream_YUV420P | ( | int | width, |
| int | height, | ||
| double | frameRate, | ||
| int | bitrate, | ||
| int | bitrateTolerance = -1, |
||
| double | pixelAspectRatio = 1 |
||
| ) |
Adds a video stream to the file using the default video codec of the file format, YUV420P.
| width | The width of the frames in the stream. |
| height | The height of the frames in the stream. |
| frameRate | The frame rate of the stream in frames/s. |
| bitrate | The bitrate of the stream. |
| bitrateTolerance | The bitrate tolerance. |
| pixelAspectRatio | The pixel aspect ratio. |
| void blo::AVFileOut::close | ( | ) |
Closes file.
| bool blo::AVFileOut::isOpen | ( | ) | const |
Tests if the file is open.
| void blo::AVFileOut::open | ( | const AVOutputFormat * | pOutputFormat, |
| const char * | formatName, | ||
| const char * | filename | ||
| ) |
Opens output file.
This function opens the output file. If pOutputFormat is nullptr, then formatName is used. If formatName is nullptr, then filename is used.
| pOutputFormat | Pointer to output format to use (force). |
| formatName | Format name string. |
| filename | Filename string. |
| void blo::AVFileOut::open | ( | const char * | filename | ) |
Opens output file.
| filename | Filename string. |
| void blo::AVFileOut::writeAudioFrame | ( | int | streamNumber, |
| uint64_t | srcChannelLayout, | ||
| const T * | pSrc, | ||
| int | len | ||
| ) |
Writes an audio frame to the stream.
| T | Data type. |
| streamNumber | The stream number to write the frame to. |
| srcChannelLayout | The channel layout of the source audio frame. |
| pSrc | Pointer to the source audio frame. |
| len | Length of the source audio frame in samples (all channels). |
| void blo::AVFileOut::writeAudioFrame_Mono | ( | int | streamNumber, |
| const T * | pSrc, | ||
| int | len | ||
| ) |
Writes an audio frame to the stream, mono.
| T | Data type. |
| streamNumber | The stream number to write the frame to. |
| pSrc | Pointer to the source audio frame. |
| len | Length of the source audio frame in samples. |
| void blo::AVFileOut::writeAudioFrame_Stereo | ( | int | streamNumber, |
| const T * | pSrc, | ||
| int | len | ||
| ) |
Writes an audio frame to the stream, stereo.
| T | Data type. |
| streamNumber | The stream number to write the frame to. |
| pSrc | Pointer to the source audio frame. |
| len | Length of the source audio frame in samples (all channels). |
| void blo::AVFileOut::writeVideoFrame | ( | int | streamNumber, |
| double | pts, | ||
| AVPixelFormat | srcPixelFormat, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| srcPixelFormat | The pixel format of the source image. |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_ABGR_C4 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, ABGR.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_ARGB_C4 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, ARGB.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_BGR_C3 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, BGR.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_BGRA_C4 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, BGRA.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_RGB_C3 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, RGB.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_RGBA_C4 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, RGBA.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
| void blo::AVFileOut::writeVideoFrame_Y_C1 | ( | int | streamNumber, |
| double | pts, | ||
| const uint8_t * | pSrc, | ||
| int | srcStep, | ||
| int | roiWidth, | ||
| int | roiHeight, | ||
| InterlacedFrame | interlacedFrame = InterlacedFrame::noninterlaced |
||
| ) |
Writes a frame to the stream, Y.
| streamNumber | The stream number to write the frame to. |
| pts | The presentation time stamp (PTS). |
| pSrc | Pointer to the source image. |
| srcStep | Step in bytes between the rows in the source image. |
| roiWidth | Width of the source image ROI in pixels. |
| roiHeight | Height of the source image ROI in pixels. |
| interlacedFrame | Type of interlacing. |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |