flvlib icon indicating copy to clipboard operation
flvlib copied to clipboard

create_script_tag() is malfunctioning

Open phillijw opened this issue 2 years ago • 0 comments

I'm running into an issue with the following code. You can see that it's inserting an 0x02 and 0x08 where it shouldn't (see the right side of the diff). The left side is the correct output.

custom_payload = FLVObject()
custom_payload["audioBandwidth"] = struct.pack(">d", 64000.0)
custom_payload["audioChannels"] = struct.pack(">d", 1.0)
custom_payload["audioFrequency"] = struct.pack(">d", 48000.0)
custom_payload["channelId"] = struct.pack(">d", 0.0)
payload = create_script_tag('onMetaData', custom_payload, 0)

image

I think this is the code inserting it: https://github.com/wulczer/flvlib/blob/08967851f106158abe1115698c5cae285fed42d9/lib/flvlib/tags.py#L209

phillijw avatar Sep 06 '23 20:09 phillijw