【问题标题】:How to get format of video stream in ffmpeg (c++)如何在ffmpeg(c ++)中获取视频流的格式
【发布时间】:2020-11-12 02:22:38
【问题描述】:

我有一个从流中读取帧的函数。我想知道流的格式是什么(我正在用H264测试):

StreamingResult MediaWriter::Open(const AVFormatContext *const inputFormatContext,
                                  const fs::path &destination)
{
  // Save input stream data
  AVStream *videoStream = inputFormatContext->streams[FindVideoStreamIndex(inputFormatContext)];
  //....
}

如何从视频流中获取格式/编解码器类型?我预计会收到 H264,但将来会收到其他格式。

P.S.:一些好的 FFMPEG 文档将不胜感激,因为我迷失在 Doxygen 生成的文档中。

【问题讨论】:

  • 您可能想查看来自this post 的答案/cmets。

标签: c++ ffmpeg


【解决方案1】:

Some good FFMPEG documentation would be appreciated, because I am getting lost in Doxygen generated documentation.

Doxygen 是最好的 ffmpeg 文档。它只是 ffmpeg 是一个非常大的项目,需要时间来学习。

你要找的是videoStream->codecpar->codec_id

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-04
    • 2015-02-23
    • 2013-03-02
    • 2015-01-26
    • 1970-01-01
    • 2021-03-29
    • 2015-08-25
    相关资源
    最近更新 更多