gmf
gmf copied to clipboard
How to create a Packet from memory
Hello!
I am looking to write a program that takes raw encoded video and then decodes it, and encodes it in another format. How would I go about creating packets from a []byte or similar?
@russelltg Hi. See avio.go and there is a test in format_test.go TestAVIOContext and custom reader implementation customReader. Probably it helps.
I noticed an issue with this test, you never actually get any packets. You can reproduce this by putting a panic in this loop
for p := range ictx.GetNewPackets() {
panic("")
_ = p
Release(p)
}
Weirdly this seems to work with raw h264 files, but not mp4 files.