You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functional change in data stream returned data.
I am using PYAV to separate KLV data from mpegts stream.
PYAV 12.0.0 returns different start bytes then PYAV 11.0.0
Expected behavior
Consistent parsing behavior between PYAV versions unless indicated in change log.
Actual behavior
Change in data stream parsing behavior resulting in different start bytes in data stream.
Investigation
Uninstall the latest version of PYAV 12.0.0 and install PYAV 11.0.0
Running code that prints the starting 20 bytes and end 20 bytes of data stream for each packet.
Reproduction
Compare the start bytes of an mpegts stream that contains data streams.
import av
from pathlib import Path
def main(video: Path):
with av.open(str(video)) as container:
stream = container.demux()
for packet in stream:
if packet.stream.type == "data":
print(f"packet pts: {packet.pts}")
print(f"start bytes: {bytes(packet)[:20]}") # different start bytes
print(f"end bytes: {bytes(packet)[-20:]}") # same end bytes
if packet.stream.type == "video":
pass
if __name__ == "__main__":
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("-i", "--input", type=str)
args = parser.parse_args()
main(Path(args.input))
Example output:
pyav-11.0.0:
packet pts: 42811911
start bytes: b'\xfa\xab\x941\xbb\x11J\xaa\xbd\xc6\xfa\x9e\xb1\xb6$Z\x82\x01s\x82'
end bytes: b'\x82P2\x02\x0c\xfd\x82P6\x01\x01\x82P7\x01\x01\x01\x02\x8f:'
pyav-12.0.0:
packet pts: 42811911
start bytes: b'\x11J\xaa\xbd\xc6\xfa\x9e\xb1\xb6$Z\x82\x01s\x82P&\x08\x00\x05'
end bytes: b'\x82P2\x02\x0c\xfd\x82P6\x01\x01\x82P7\x01\x01\x01\x02\x8f:'
Assuming this issue is from 12.0.0, there is no current info on the change in behavior.
The datastreams used to be directly parsable when passed to klvparser: https://github.com/paretech/klvdata
Now a varaible number of start bytes needs to be removed to properly parse data stream.
The text was updated successfully, but these errors were encountered:
RaubCamaioni
changed the title
Functional Difference between AV 11.0.0 and AV 12.0.0
Functional Difference In Data Stream between AV 11.0.0 and AV 12.0.0
Apr 11, 2024
Overview
Functional change in data stream returned data.
I am using PYAV to separate KLV data from mpegts stream.
PYAV 12.0.0 returns different start bytes then PYAV 11.0.0
Expected behavior
Consistent parsing behavior between PYAV versions unless indicated in change log.
Actual behavior
Change in data stream parsing behavior resulting in different start bytes in data stream.
Investigation
Uninstall the latest version of PYAV 12.0.0 and install PYAV 11.0.0
Running code that prints the starting 20 bytes and end 20 bytes of data stream for each packet.
Reproduction
Compare the start bytes of an mpegts stream that contains data streams.
Example output:
Versions
Research
Assuming this issue is from 12.0.0, there is no current info on the change in behavior.
The datastreams used to be directly parsable when passed to klvparser: https://github.com/paretech/klvdata
Now a varaible number of start bytes needs to be removed to properly parse data stream.
The text was updated successfully, but these errors were encountered: