【问题标题】:How to hardcode a MP4 stream file with iOS VideoToolbox and FFMPEG?如何使用 iOS VideoToolbox 和 FFMPEG 对 MP4 流文件进行硬编码?
【发布时间】:2016-05-20 13:00:05
【问题描述】:

伙计们!

我在 github 中找到了一个演示:-VideoToolboxDemo。而且我还在stackoverflowhow-to-use-videotoolbox-to-decompress-h-264-video-stream中发现了一个问题,有人在github中实现了这个问题:https://github.com/lileilei1119/VTDemo

但是他们在寻找 SPS 和 PPS 上是有区别的。

VideoToolboxDemo 是:

uint8_t *data = pCodecCtx -> extradata;
int size = pCodecCtx -> extradata_size;

它使用来自 FFMPEG 的 pCodecCtx 的额外数据来查找起始代码,例如 0x00 00 01(或 0x00 00 00 01)

但是stackoverflow中的介绍是:

[_h264Decoder decodeFrame:packet.data withSize:packet.size];

使用数据包的数据?

这两种方法我都试过了,还是找不到SPS和PPS的起始码。有谁知道为什么?我的文件有问题吗?

我的mp4文件是http://7u2m53.com1.z0.glb.clouddn.com/201601131107187320.mp4

【问题讨论】:

  • 欢迎来到 SO。您应该打印一些文件内容以查看这些代码是否存在。您需要在帖子中创建一个Minimal, Complete, and Verifiable example,除非有人已经在使用此库,否则大多数人不会同时下载库和未知文件来尝试回答您的问题...

标签: ios ffmpeg hardcode video-toolbox


【解决方案1】:

Videotoolbox 不使用附件 b,因此不产生起始码。在这里阅读更多。 Possible Locations for Sequence/Picture Parameter Set(s) for H.264 Stream

【讨论】:

    猜你喜欢
    • 2015-10-03
    • 2012-08-17
    • 2016-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-25
    • 2011-09-25
    • 1970-01-01
    相关资源
    最近更新 更多