【问题标题】:No NAL start found in demuxed packet在解复用的数据包中找不到 NAL 开始
【发布时间】:2019-08-02 22:21:08
【问题描述】:

我一直在使用 PyAV 和 aiortc 来使用 webrtc 设置视频流。 我想重新打包数据包并发送它们而不进行转码。我遇到的问题是 aiortc 是 av_read_frame 调用不会生成 NAL 开始序列,之后 aiortc 在尝试查找时失败。

我做了一个测试,打印每个打包器的第一个开头:

import av
container = av.open(file="jellyfish.mkv", format="matroska", mode="r")
video_stream = [x for x in container.streams if x.type == "video"]

for i in range(4):
    packet = next(container.demux(video_stream))
    s = bytes(packet)[0:8]
    print(s)

产生了:

b'\x00\x00\xb5\xbae\x88\x80@'
b'\x00\x00A:A\x9a\x02\r'
b'\x00\x00\x18\xe2\x01\x9e\x04\x05'
b'\x00\x00\x19E\x01\x9e\x04\t' 

所以似乎有某种起始码,但不是为 NAL 指定的起始码(0x000001 或 0x00000001):https://stackoverflow.com/a/23516925/3442097

有人知道这里出了什么问题吗?

【问题讨论】:

    标签: python video ffmpeg pyav aiortc


    【解决方案1】:

    MKV 不使用附件b,而您使用的任何打包程序都可以。您必须将尺寸转换为起始代码。

    阅读此文; Possible Locations for Sequence/Picture Parameter Set(s) for H.264 Stream

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 1970-01-01
      相关资源
      最近更新 更多