- en: torio::io::StreamingMediaDecoder id: totrans-0 prefs: - PREF_H1 type: TYPE_NORMAL zh: torio::io::StreamingMediaDecoder - en: 原文:[https://pytorch.org/audio/stable/libtorio.stream_reader.html](https://pytorch.org/audio/stable/libtorio.stream_reader.html) id: totrans-1 prefs: - PREF_BQ type: TYPE_NORMAL zh: 原文:[https://pytorch.org/audio/stable/libtorio.stream_reader.html](https://pytorch.org/audio/stable/libtorio.stream_reader.html) - en: Warning id: totrans-2 prefs: [] type: TYPE_NORMAL zh: 警告 - en: TorchAudio’s C++ API is a prototype feature. API/ABI backward compatibility is not guaranteed. id: totrans-3 prefs: [] type: TYPE_NORMAL zh: TorchAudio 的 C++ API 是一个原型功能。API/ABI 的向后兼容性不能保证。 - en: Note id: totrans-4 prefs: [] type: TYPE_NORMAL zh: 注意 - en: The top-level namespace has been changed from `torchaudio` to `torio`. `StreamReader` has been renamed to `StreamingMediaDecoder`. id: totrans-5 prefs: [] type: TYPE_NORMAL zh: 顶层命名空间已从 `torchaudio` 更改为 `torio`。`StreamReader` 已重命名为 `StreamingMediaDecoder`。 - en: '`StreamingMediaDecoder` is the implementation used by Python equivalent and provides similar interface. When working with custom I/O, such as in-memory data, `StreamingMediaDecoderCustomIO` class can be used.' id: totrans-6 prefs: [] type: TYPE_NORMAL zh: '`StreamingMediaDecoder` 是 Python 等效的实现,提供类似的接口。在使用自定义 I/O(例如内存数据)时,可以使用 `StreamingMediaDecoderCustomIO` 类。' - en: Both classes have the same methods defined, so their usages are the same. id: totrans-7 prefs: [] type: TYPE_NORMAL zh: 这两个类定义了相同的方法,因此它们的用法相同。 - en: Constructors[](#constructors "Permalink to this heading") id: totrans-8 prefs: - PREF_H2 type: TYPE_NORMAL zh: 构造函数: - en: StreamingMediaDecoder[](#streamingmediadecoder "Permalink to this heading") id: totrans-9 prefs: - PREF_H3 type: TYPE_NORMAL zh: StreamingMediaDecoder - en: class StreamingMediaDecoder[](#_CPPv4N5torio2io21StreamingMediaDecoderE "Permalink to this definition") id: totrans-10 prefs: [] type: TYPE_NORMAL zh: 类 `StreamingMediaDecoder`: - en: Fetch and decode audio/video streams chunk by chunk. id: totrans-11 prefs: [] type: TYPE_NORMAL zh: 逐块获取和解码音频/视频流。 - en: Subclassed by [torio::io::StreamingMediaDecoderCustomIO](#classtorio_1_1io_1_1StreamingMediaDecoderCustomIO) id: totrans-12 prefs: [] type: TYPE_NORMAL zh: 由 [torio::io::StreamingMediaDecoderCustomIO](#classtorio_1_1io_1_1StreamingMediaDecoderCustomIO) 继承 - en: explicit torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::StreamingMediaDecoder(const std::string &src, const c10::optional &format = c10::nullopt, const c10::optional &option = c10::nullopt)[](#_CPPv4N5torio2io21StreamingMediaDecoder21StreamingMediaDecoderERKNSt6stringERKN3c108optionalINSt6stringEEERKN3c108optionalI10OptionDictEE "Permalink to this definition") id: totrans-13 prefs: [] type: TYPE_NORMAL zh: explicit torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::StreamingMediaDecoder(const std::string &src, const c10::optional &format = c10::nullopt, const c10::optional &option = c10::nullopt) - en: Construct media processor from soruce URI. id: totrans-14 prefs: [] type: TYPE_NORMAL zh: 从源 URI 构造媒体处理器。 - en: 'Parameters:' id: totrans-15 prefs: [] type: TYPE_NORMAL zh: 参数: - en: '**src** – URL of source media, in the format FFmpeg can understand.' id: totrans-16 prefs: - PREF_UL type: TYPE_NORMAL zh: '**src** – 源媒体的 URL,格式为 FFmpeg 可理解的格式。' - en: '**format** – Specifies format (such as mp4) or device (such as lavfi and avfoundation)' id: totrans-17 prefs: - PREF_UL type: TYPE_NORMAL zh: '**format** – 指定格式(如 mp4)或设备(如 lavfi 和 avfoundation)。' - en: '**option** – Custom option passed when initializing format context (opening source).' id: totrans-18 prefs: - PREF_UL type: TYPE_NORMAL zh: '**option** – 在初始化格式上下文(打开源)时传递的自定义选项。' - en: StreamingMediaDecoderCustomIO[](#streamingmediadecodercustomio "Permalink to this heading") id: totrans-19 prefs: - PREF_H3 type: TYPE_NORMAL zh: StreamingMediaDecoderCustomIO - en: 'class StreamingMediaDecoderCustomIO : private detail::CustomInput, public torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")[](#_CPPv4N5torio2io29StreamingMediaDecoderCustomIOE "Permalink to this definition")' id: totrans-20 prefs: [] type: TYPE_NORMAL zh: 类 `StreamingMediaDecoderCustomIO`:继承自 private detail::CustomInput,公开 torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder") - en: A subclass of [StreamingMediaDecoder](#classtorio_1_1io_1_1StreamingMediaDecoder) which works with custom read function. Can be used for decoding media from memory or custom object. id: totrans-21 prefs: [] type: TYPE_NORMAL zh: '[StreamingMediaDecoder](#classtorio_1_1io_1_1StreamingMediaDecoder) 的子类,与自定义读取函数一起工作。可用于从内存或自定义对象解码媒体。' - en: torio::io::[StreamingMediaDecoderCustomIO](#_CPPv4N5torio2io29StreamingMediaDecoderCustomIOE "torio::io::StreamingMediaDecoderCustomIO")::StreamingMediaDecoderCustomIO(void *opaque, const c10::optional &format, int buffer_size, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence) = nullptr, const c10::optional &option = c10::nullopt)[](#_CPPv4N5torio2io29StreamingMediaDecoderCustomIO29StreamingMediaDecoderCustomIOEPvRKN3c108optionalINSt6stringEEEiPFiPvP7uint8_tiEPF7int64_tPv7int64_tiERKN3c108optionalI10OptionDictEE "Permalink to this definition") id: totrans-22 prefs: [] type: TYPE_NORMAL zh: torio::io::[StreamingMediaDecoderCustomIO](#_CPPv4N5torio2io29StreamingMediaDecoderCustomIOE "torio::io::StreamingMediaDecoderCustomIO")::StreamingMediaDecoderCustomIO(void *opaque, const c10::optional &format, int buffer_size, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence) = nullptr, const c10::optional &option = c10::nullopt) - en: Construct [StreamingMediaDecoder](#classtorio_1_1io_1_1StreamingMediaDecoder) with custom read and seek functions. id: totrans-23 prefs: [] type: TYPE_NORMAL zh: 使用自定义读取和寻址函数构造 [StreamingMediaDecoder](#classtorio_1_1io_1_1StreamingMediaDecoder)。 - en: 'Parameters:' id: totrans-24 prefs: [] type: TYPE_NORMAL zh: 参数: - en: '**opaque** – Custom data used by `read_packet` and `seek` functions.' id: totrans-25 prefs: - PREF_UL type: TYPE_NORMAL zh: '**opaque** – `read_packet` 和 `seek` 函数使用的自定义数据。' - en: '**format** – Specify input format.' id: totrans-26 prefs: - PREF_UL type: TYPE_NORMAL zh: '**format** – 指定输入格式。' - en: '**buffer_size** – The size of the intermediate buffer, which FFmpeg uses to pass data to function read_packet.' id: totrans-27 prefs: - PREF_UL type: TYPE_NORMAL zh: '**buffer_size** – 中间缓冲区的大小,FFmpeg 用于将数据传递给 read_packet 函数。' - en: '**read_packet** – Custom read function that is called from FFmpeg to read data from the destination.' id: totrans-28 prefs: - PREF_UL type: TYPE_NORMAL zh: '**read_packet** – 自定义读取函数,由 FFmpeg 调用以从目标读取数据。' - en: '**seek** – Optional seek function that is used to seek the destination.' id: totrans-29 prefs: - PREF_UL type: TYPE_NORMAL zh: '**seek** – 可选的寻址函数,用于寻址目标。' - en: '**option** – Custom option passed when initializing format context.' id: totrans-30 prefs: - PREF_UL type: TYPE_NORMAL zh: '**option** – 在初始化格式上下文时传递的自定义选项。' - en: Query Methods[](#query-methods "Permalink to this heading") id: totrans-31 prefs: - PREF_H2 type: TYPE_NORMAL zh: 查询方法: - en: find_best_audio_stream[](#find-best-audio-stream "Permalink to this heading") id: totrans-32 prefs: - PREF_H3 type: TYPE_NORMAL zh: find_best_audio_stream - en: int64_t torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::find_best_audio_stream() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder22find_best_audio_streamEv "Permalink to this definition") id: totrans-33 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的find_best_audio_stream()方法 - en: Find a suitable audio stream using heuristics from ffmpeg. id: totrans-34 prefs: [] type: TYPE_NORMAL zh: 使用ffmpeg的启发式方法找到合适的音频流。 - en: If successful, the index of the best stream (>=0) is returned. Otherwise a negative value is returned. id: totrans-35 prefs: [] type: TYPE_NORMAL zh: 如果成功,返回最佳流的索引(大于等于0)。否则返回负值。 - en: find_best_video_stream[](#find-best-video-stream "Permalink to this heading") id: totrans-36 prefs: - PREF_H3 type: TYPE_NORMAL zh: find_best_video_stream - en: int64_t torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::find_best_video_stream() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder22find_best_video_streamEv "Permalink to this definition") id: totrans-37 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的find_best_video_stream()方法 - en: Find a suitable video stream using heuristics from ffmpeg. id: totrans-38 prefs: [] type: TYPE_NORMAL zh: 使用ffmpeg的启发式方法找到合适的视频流。 - en: If successful, the index of the best stream (0>=) is returned. otherwise a negative value is returned. id: totrans-39 prefs: [] type: TYPE_NORMAL zh: 如果成功,返回最佳流的索引(大于等于0)。否则返回负值。 - en: get_metadata[](#get-metadata "Permalink to this heading") id: totrans-40 prefs: - PREF_H3 type: TYPE_NORMAL zh: get_metadata - en: OptionDict torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::get_metadata() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder12get_metadataEv "Permalink to this definition") id: totrans-41 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的get_metadata()方法 - en: Fetch metadata of the source media. id: totrans-42 prefs: [] type: TYPE_NORMAL zh: 获取源媒体的元数据。 - en: num_src_streams[](#num-src-streams "Permalink to this heading") id: totrans-43 prefs: - PREF_H3 type: TYPE_NORMAL zh: num_src_streams - en: int64_t torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::num_src_streams() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder15num_src_streamsEv "Permalink to this definition") id: totrans-44 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的num_src_streams()方法 - en: Fetch the number of source streams found in the input media. id: totrans-45 prefs: [] type: TYPE_NORMAL zh: 获取输入媒体中找到的源流数量。 - en: The source streams include not only audio/video streams but also subtitle and others. id: totrans-46 prefs: [] type: TYPE_NORMAL zh: 源流不仅包括音频/视频流,还包括字幕等。 - en: get_src_stream_info[](#get-src-stream-info "Permalink to this heading") id: totrans-47 prefs: - PREF_H3 type: TYPE_NORMAL zh: get_src_stream_info - en: '[SrcStreamInfo](#_CPPv4N5torio2io13SrcStreamInfoE "torio::io::SrcStreamInfo") torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::get_src_stream_info(int i) const[](#_CPPv4NK5torio2io21StreamingMediaDecoder19get_src_stream_infoEi "Permalink to this definition")' id: totrans-48 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的get_src_stream_info()方法 - en: Fetch information about the specified source stream. id: totrans-49 prefs: [] type: TYPE_NORMAL zh: 获取指定源流的信息。 - en: The valid value range is `[0, [num_src_streams()](#classtorio_1_1io_1_1StreamingMediaDecoder_1a6b3e5fd480cc50ee5ec9b389641c4512))`. id: totrans-50 prefs: [] type: TYPE_NORMAL zh: 有效值范围为`[0, num_src_streams()]`。 - en: num_out_streams[](#num-out-streams "Permalink to this heading") id: totrans-51 prefs: - PREF_H3 type: TYPE_NORMAL zh: num_out_streams - en: int64_t torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::num_out_streams() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder15num_out_streamsEv "Permalink to this definition") id: totrans-52 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的num_out_streams()方法 - en: Fetch the number of output streams defined by client code. id: totrans-53 prefs: [] type: TYPE_NORMAL zh: 获取客户端代码定义的输出流数量。 - en: get_out_stream_info[](#get-out-stream-info "Permalink to this heading") id: totrans-54 prefs: - PREF_H3 type: TYPE_NORMAL zh: get_out_stream_info - en: '[OutputStreamInfo](#_CPPv4N5torio2io16OutputStreamInfoE "torio::io::OutputStreamInfo") torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::get_out_stream_info(int i) const[](#_CPPv4NK5torio2io21StreamingMediaDecoder19get_out_stream_infoEi "Permalink to this definition")' id: totrans-55 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的get_out_stream_info()方法 - en: Fetch information about the specified output stream. id: totrans-56 prefs: [] type: TYPE_NORMAL zh: 获取指定输出流的信息。 - en: The valid value range is `[0, [num_out_streams()](#classtorio_1_1io_1_1StreamingMediaDecoder_1a2675b80361ce5ac9da29bb63105f1135))`. id: totrans-57 prefs: [] type: TYPE_NORMAL zh: 有效值范围为`[0, num_out_streams()]`。 - en: is_buffer_ready[](#is-buffer-ready "Permalink to this heading") id: totrans-58 prefs: - PREF_H3 type: TYPE_NORMAL zh: is_buffer_ready - en: bool torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::is_buffer_ready() const[](#_CPPv4NK5torio2io21StreamingMediaDecoder15is_buffer_readyEv "Permalink to this definition") id: totrans-59 prefs: [] type: TYPE_NORMAL zh: StreamingMediaDecoder类中的is_buffer_ready()方法 - en: Check if all the buffers of the output streams have enough decoded frames. id: totrans-60 prefs: [] type: TYPE_NORMAL zh: 检查输出流的所有缓冲区是否有足够的解码帧。 - en: Configure Methods[](#configure-methods "Permalink to this heading") id: totrans-61 prefs: - PREF_H2 type: TYPE_NORMAL zh: 配置方法 - en: add_audio_stream[](#add-audio-stream "Permalink to this heading") id: totrans-62 prefs: - PREF_H3 type: TYPE_NORMAL zh: add_audio_stream - en: void torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::add_audio_stream(int64_t i, int64_t frames_per_chunk, int64_t num_chunks, const c10::optional &filter_desc = c10::nullopt, const c10::optional &decoder = c10::nullopt, const c10::optional &decoder_option = c10::nullopt)[](#_CPPv4N5torio2io21StreamingMediaDecoder16add_audio_streamE7int64_t7int64_t7int64_tRKN3c108optionalINSt6stringEEERKN3c108optionalINSt6stringEEERKN3c108optionalI10OptionDictEE "Permalink to this definition") id: totrans-63 prefs: [] type: TYPE_NORMAL zh: void torio::io::[StreamingMediaDecoder](#_CPPv4N5torio2io21StreamingMediaDecoderE "torio::io::StreamingMediaDecoder")::add_audio_stream(int64_t i, int64_t frames_per_chunk, int64_t num_chunks, const c10::optional &filter_desc = c10::nullopt, const c10::optional &decoder = c10::nullopt, const c10::optional &decoder_option = c10::nullopt)[](#_CPPv4N5torio2io21StreamingMediaDecoder16add_audio_streamE7int64_t7int64_t7int64_tRKN3c108optionalINSt6stringEEERKN3c108optionalINSt6stringEEERKN3c108optionalI10OptionDictEE "此定义的永久链接") - en: Define an output audio stream. id: totrans-64 prefs: [] type: TYPE_NORMAL zh: 定义一个输出音频流。 - en: 'Parameters:' id: totrans-65 prefs: [] type: TYPE_NORMAL zh: 参数: - en: '**i** – The index of the source stream.' id: totrans-66 prefs: - PREF_UL type: TYPE_NORMAL zh: '**i** – 源流的索引。' - en: '**frames_per_chunk** – Number of frames returned as one chunk.' id: totrans-67 prefs: - PREF_UL type: TYPE_NORMAL zh: '**每块帧数** – 作为一个块返回的帧数。' - en: If a source stream is exhausted before `frames_per_chunk` frames are buffered, the chunk is returned as-is. Thus the number of frames in the chunk may be smaller than [PRE0] id: totrans-68 prefs: - PREF_IND type: TYPE_NORMAL zh: 如果源流在缓冲`frames_per_chunk`帧之前耗尽,则该块将原样返回。因此,块中的帧数可能小于[PRE0] - en: '{' id: totrans-69 prefs: [] type: TYPE_NORMAL zh: '{' - en: '"title": "foo",' id: totrans-70 prefs: [] type: TYPE_NORMAL zh: '"title": "foo",' - en: '"artist": "bar",' id: totrans-71 prefs: [] type: TYPE_NORMAL zh: '"艺术家": "bar",' - en: '"date": "2017"' id: totrans-72 prefs: [] type: TYPE_NORMAL zh: '"日期": "2017"' - en: '}' id: totrans-73 prefs: [] type: TYPE_NORMAL zh: '}' - en: '```' id: totrans-74 prefs: [] type: TYPE_NORMAL zh: '```' - en: AUDIO-SPECIFIC MEMBERS id: totrans-75 prefs: [] type: TYPE_NORMAL zh: 音频特定成员 - en: double sample_rate = 0[](#_CPPv4N5torio2io13SrcStreamInfo11sample_rateE "Permalink to this definition") id: totrans-76 prefs: [] type: TYPE_NORMAL zh: double 采样率 = 0[](#_CPPv4N5torio2io13SrcStreamInfo11sample_rateE "此定义的永久链接") - en: Sample rate. id: totrans-77 prefs: [] type: TYPE_NORMAL zh: 采样率。 - en: int num_channels = 0[](#_CPPv4N5torio2io13SrcStreamInfo12num_channelsE "Permalink to this definition") id: totrans-78 prefs: [] type: TYPE_NORMAL zh: int 通道数 = 0[](#_CPPv4N5torio2io13SrcStreamInfo12num_channelsE "此定义的永久链接") - en: The number of channels. id: totrans-79 prefs: [] type: TYPE_NORMAL zh: 通道数。 - en: VIDEO-SPECIFIC MEMBERS id: totrans-80 prefs: [] type: TYPE_NORMAL zh: 视频特定成员 - en: int width = 0[](#_CPPv4N5torio2io13SrcStreamInfo5widthE "Permalink to this definition") id: totrans-81 prefs: [] type: TYPE_NORMAL zh: int 宽度 = 0[](#_CPPv4N5torio2io13SrcStreamInfo5widthE "此定义的永久链接") - en: Width. id: totrans-82 prefs: [] type: TYPE_NORMAL zh: 宽度。 - en: int height = 0[](#_CPPv4N5torio2io13SrcStreamInfo6heightE "Permalink to this definition") id: totrans-83 prefs: [] type: TYPE_NORMAL zh: int 高度 = 0[](#_CPPv4N5torio2io13SrcStreamInfo6heightE "此定义的永久链接") - en: Height. id: totrans-84 prefs: [] type: TYPE_NORMAL zh: 高度。 - en: double frame_rate = 0[](#_CPPv4N5torio2io13SrcStreamInfo10frame_rateE "Permalink to this definition") id: totrans-85 prefs: [] type: TYPE_NORMAL zh: double 帧率 = 0[](#_CPPv4N5torio2io13SrcStreamInfo10frame_rateE "此定义的永久链接") - en: Frame rate. id: totrans-86 prefs: [] type: TYPE_NORMAL zh: 帧率。 - en: OutputStreaminfo[](#outputstreaminfo "Permalink to this heading") id: totrans-87 prefs: - PREF_H3 type: TYPE_NORMAL zh: OutputStreaminfo[](#outputstreaminfo "此标题的永久链接") - en: struct OutputStreamInfo[](#_CPPv4N5torio2io16OutputStreamInfoE "Permalink to this definition") id: totrans-88 prefs: [] type: TYPE_NORMAL zh: 结构 OutputStreamInfo[](#_CPPv4N5torio2io16OutputStreamInfoE "此定义的永久链接") - en: Information about output stream configured by user code. id: totrans-89 prefs: [] type: TYPE_NORMAL zh: 用户代码配置的输出流信息。 - en: AUDIO-SPECIFIC MEMBERS id: totrans-90 prefs: [] type: TYPE_NORMAL zh: 音频特定成员 - en: double sample_rate = -1[](#_CPPv4N5torio2io16OutputStreamInfo11sample_rateE "Permalink to this definition") id: totrans-91 prefs: [] type: TYPE_NORMAL zh: double 采样率 = -1[](#_CPPv4N5torio2io16OutputStreamInfo11sample_rateE "此定义的永久链接") - en: Sample rate. id: totrans-92 prefs: [] type: TYPE_NORMAL zh: 采样率。 - en: int num_channels = -1[](#_CPPv4N5torio2io16OutputStreamInfo12num_channelsE "Permalink to this definition") id: totrans-93 prefs: [] type: TYPE_NORMAL zh: int 通道数 = -1[](#_CPPv4N5torio2io16OutputStreamInfo12num_channelsE "此定义的永久链接") - en: The number of channels. id: totrans-94 prefs: [] type: TYPE_NORMAL zh: 通道数。 - en: VIDEO-SPECIFIC MEMBERS id: totrans-95 prefs: [] type: TYPE_NORMAL zh: 视频特定成员 - en: int width = -1[](#_CPPv4N5torio2io16OutputStreamInfo5widthE "Permalink to this definition") id: totrans-96 prefs: [] type: TYPE_NORMAL zh: int 宽度 = -1[](#_CPPv4N5torio2io16OutputStreamInfo5widthE "此定义的永久链接") - en: Width. id: totrans-97 prefs: [] type: TYPE_NORMAL zh: 宽度。 - en: int height = -1[](#_CPPv4N5torio2io16OutputStreamInfo6heightE "Permalink to this definition") id: totrans-98 prefs: [] type: TYPE_NORMAL zh: int 高度 = -1[](#_CPPv4N5torio2io16OutputStreamInfo6heightE "此定义的永久链接") - en: Height. id: totrans-99 prefs: [] type: TYPE_NORMAL zh: 高度。 - en: AVRational frame_rate = {0, 1}[](#_CPPv4N5torio2io16OutputStreamInfo10frame_rateE "Permalink to this definition") id: totrans-100 prefs: [] type: TYPE_NORMAL zh: AVRational 帧率 = {0, 1}[](#_CPPv4N5torio2io16OutputStreamInfo10frame_rateE "此定义的永久链接") - en: Frame rate. id: totrans-101 prefs: [] type: TYPE_NORMAL zh: 帧率。 - en: Public Members id: totrans-102 prefs: [] type: TYPE_NORMAL zh: 公共成员 - en: int source_index[](#_CPPv4N5torio2io16OutputStreamInfo12source_indexE "Permalink to this definition") id: totrans-103 prefs: [] type: TYPE_NORMAL zh: int 源索引[](#_CPPv4N5torio2io16OutputStreamInfo12source_indexE "此定义的永久链接") - en: The index of the input source stream. id: totrans-104 prefs: [] type: TYPE_NORMAL zh: 输入源流的索引。 - en: AVMediaType media_type = AVMEDIA_TYPE_UNKNOWN[](#_CPPv4N5torio2io16OutputStreamInfo10media_typeE "Permalink to this definition") id: totrans-105 prefs: [] type: TYPE_NORMAL zh: AVMediaType 媒体类型 = AVMEDIA_TYPE_UNKNOWN[](#_CPPv4N5torio2io16OutputStreamInfo10media_typeE "此定义的永久链接") - en: The stream media type. id: totrans-106 prefs: [] type: TYPE_NORMAL zh: 流媒体类型。 - en: Please see refer to [the FFmpeg documentation](https://ffmpeg.org/doxygen/4.1/group__lavu__misc.html#ga9a84bba4713dfced21a1a56163be1f48) for the available values id: totrans-107 prefs: [] type: TYPE_NORMAL zh: 请参阅[FFmpeg文档](https://ffmpeg.org/doxygen/4.1/group__lavu__misc.html#ga9a84bba4713dfced21a1a56163be1f48)以获取可用值 - en: '*Todo:*' id: totrans-108 prefs: [] type: TYPE_NORMAL zh: '*待办事项:*' - en: Introduce own enum and get rid of FFmpeg dependency id: totrans-109 prefs: [] type: TYPE_NORMAL zh: 引入自己的枚举并摆脱FFmpeg依赖 - en: int format = -1[](#_CPPv4N5torio2io16OutputStreamInfo6formatE "Permalink to this definition") id: totrans-110 prefs: [] type: TYPE_NORMAL zh: int 格式 = -1[](#_CPPv4N5torio2io16OutputStreamInfo6formatE "此定义的永久链接") - en: Media format. AVSampleFormat for audio or AVPixelFormat for video. id: totrans-111 prefs: [] type: TYPE_NORMAL zh: 媒体格式。音频的AVSampleFormat或视频的AVPixelFormat。 - en: std::string filter_description = {}[](#_CPPv4N5torio2io16OutputStreamInfo18filter_descriptionE "Permalink to this definition") id: totrans-112 prefs: [] type: TYPE_NORMAL zh: std::string 滤波器描述 = {}[](#_CPPv4N5torio2io16OutputStreamInfo18filter_descriptionE "此定义的永久链接") - en: Filter graph definition, such as `"aresample=16000,aformat=sample_fmts=fltp"`. id: totrans-113 prefs: [] type: TYPE_NORMAL zh: 滤波器图定义,例如`"aresample=16000,aformat=sample_fmts=fltp"`。