Template Class BSF¶
Defined in File bsf.h
Class Documentation¶
-
template<MediaType media>
class BSF¶ Bitstream filter for packet manipulation.
BSF (Bitstream Filter) applies transformations to compressed packets without decoding/encoding. Common uses include format conversions, extracting parameters, or packet manipulation.
See https://ffmpeg.org/ffmpeg-bitstream-filters.html for available filters.
- Template Parameters:
media – The media type (Audio, Video, or Image).
Public Functions
-
BSF(const Codec<media> &codec, const std::string &bsf)¶
Construct a bitstream filter.
- Parameters:
codec – Codec information for the filter.
bsf – Bitstream filter name or specification.
-
~BSF()¶
Destructor.
-
Codec<media> get_codec() const¶
Get the codec information after filtering.
- Returns:
Codec information that may be modified by the filter.
-
std::optional<PacketsPtr<media>> filter(PacketsPtr<media> packets, bool flush = false)¶
Apply the bitstream filter to packets.
- Parameters:
packets – Packets to filter.
flush – Whether to flush the filter.
- Returns:
Filtered packets, or std::nullopt if no packets are available yet.
-
std::optional<PacketsPtr<media>> flush()¶
Flush the filter to retrieve any remaining packets.
- Returns:
Remaining filtered packets, or std::nullopt if no packets are available.