|
avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
|
One stream inside a container. More...
#include <stream.h>
Public Member Functions | |
| bool | isValid () const |
| Whether the view refers to a stream. | |
| int | index () const |
| Position of the stream in its container. | |
| int | id () const |
| Stream identifier from the container. | |
| Rational | frameRate () const |
| Frame rate declared by the stream. | |
| Rational | timeBase () const |
| Time base of the timestamps in this stream. | |
| Rational | sampleAspectRatio () const |
| Pixel aspect ratio declared by the stream. | |
| Rational | averageFrameRate () const |
| Average frame rate of the stream. | |
| Timestamp | startTime () const |
| Timestamp of the first frame in this stream. | |
| Timestamp | duration () const |
| Duration of the stream. | |
| Timestamp | currentDts () const |
| Decoding timestamp of the packet currently being processed by this stream. | |
| AVMediaType | mediaType () const |
| Kind of media the stream carries. | |
| bool | isAudio () const |
| Whether this is an audio stream. | |
| bool | isVideo () const |
| Whether this is a video stream. | |
| bool | isData () const |
| Whether this is a data stream. | |
| bool | isSubtitle () const |
| Whether this is a subtitle stream. | |
| bool | isAttachment () const |
| Whether this is an attachment stream, such as an embedded font. | |
| Direction | direction () const |
| Direction the stream is used in. | |
| void | setTimeBase (const Rational &timeBase) |
| Set the time base of the stream. | |
| void | setFrameRate (const Rational &frameRate) |
| Set the declared frame rate. | |
| void | setSampleAspectRatio (const Rational &aspectRatio) |
| Set the pixel aspect ratio. | |
| void | setAverageFrameRate (const Rational &frameRate) |
| Set the average frame rate. | |
| CodecParametersView | codecParameters () const |
| Codec parameters of the stream. | |
| void | setCodecParameters (CodecParametersView codecpar, OptionalErrorCode ec=throws()) |
| Copy codec parameters into the stream. | |
| int | eventFlags () const noexcept |
| Flags to the user to detect events happening on the stream. | |
| bool | eventFlags (int flags) const noexcept |
| Whether any of the given events happened. | |
| void | eventFlagsClear (int flags) noexcept |
| Acknowledge events. | |
| void | setupEncodingParameters (const class VideoEncoderContext &ctx, OptionalErrorCode ec=throws()) |
| Configure an output stream from a video encoder. | |
| Public Member Functions inherited from FFWrapperPtr< AVStream > | |
| FFWrapperPtr ()=default | |
| Create an empty wrapper; isNull() is true. | |
| const AVStream * | raw () const |
| Read access to the wrapped object. | |
| void | reset (AVStream *raw=nullptr) |
| Replace the stored pointer. | |
| bool | isNull () const |
| Whether the wrapper is empty. | |
| void | _log (int level, const char *fmt) const |
| Log through the FFmpeg log system, using this wrapper as the context. | |
Friends | |
| class | FormatContext |
Additional Inherited Members | |
| Protected Attributes inherited from FFWrapperPtr< AVStream > | |
| AVStream * | m_raw |
| The wrapped pointer; owned by the derived class, not by this template. | |
A stream is a view: it points into the AVFormatContext that owns the AVStream, so it must not outlive that context. Copying a Stream is cheap and does not copy any stream data.
Every value here has meaning only after FormatContext::findStreamInfo(): a container read only far enough to list its streams reports incomplete codec parameters and zeroed timings.
| Rational av::Stream::averageFrameRate | ( | ) | const |
Encoders and muxers prefer the average over the nominal rate for variable frame rate content.
| CodecParametersView av::Stream::codecParameters | ( | ) | const |
| Timestamp av::Stream::currentDts | ( | ) | const |
|
inline |
| Timestamp av::Stream::duration | ( | ) | const |
|
noexcept |
A combination of AVSTREAM_EVENT_FLAG_*. Must be cleared by the user.
|
noexcept |
| flags | the AVSTREAM_EVENT_FLAG_* bits to test |
|
noexcept |
| flags | the bits to clear |
| Rational av::Stream::frameRate | ( | ) | const |
| int av::Stream::id | ( | ) | const |
Unlike index(), the id is stable across containers and is what muxers store, but FFmpeg does not require it to be unique.
| int av::Stream::index | ( | ) | const |
| bool av::Stream::isAttachment | ( | ) | const |
| bool av::Stream::isAudio | ( | ) | const |
| bool av::Stream::isData | ( | ) | const |
| bool av::Stream::isSubtitle | ( | ) | const |
| bool av::Stream::isValid | ( | ) | const |
| bool av::Stream::isVideo | ( | ) | const |
| AVMediaType av::Stream::mediaType | ( | ) | const |
| Rational av::Stream::sampleAspectRatio | ( | ) | const |
| void av::Stream::setAverageFrameRate | ( | const Rational & | frameRate | ) |
| frameRate | frames per second |
| void av::Stream::setCodecParameters | ( | CodecParametersView | codecpar, |
| OptionalErrorCode | ec = throws() ) |
This is how a muxer learns what the packets will contain during remuxing, without opening any codec.
| codecpar | the parameters to copy |
| ec | holder for the error code |
| void av::Stream::setFrameRate | ( | const Rational & | frameRate | ) |
| frameRate | frames per second |
| void av::Stream::setSampleAspectRatio | ( | const Rational & | aspectRatio | ) |
| aspectRatio | width divided by height of one pixel |
| void av::Stream::setTimeBase | ( | const Rational & | timeBase | ) |
| timeBase | timestamp units per second; must be set before the header of an output container is written |
| void av::Stream::setupEncodingParameters | ( | const class VideoEncoderContext & | ctx, |
| OptionalErrorCode | ec = throws() ) |
Copies the encoder parameters into the stream: size, pixel format, frame rate, aspect ratio and time base.
| ctx | an opened encoder |
| ec | holder for the error code |
| Timestamp av::Stream::startTime | ( | ) | const |
| Rational av::Stream::timeBase | ( | ) | const |