簡體   English   中英

在解復用的數據包中找不到NAL開始

[英]No NAL start found in demuxed packet

我一直在使用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

有人知道這是怎么回事嗎?

MKV不使用annexb,而您使用的任何打包程序都可以使用。 您必須將尺寸轉換為起始代碼。

讀這個; H.264流的序列/圖片參數集的可能位置

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM