gmf icon indicating copy to clipboard operation
gmf copied to clipboard

How to create a Packet from memory

Open russelltg opened this issue 8 years ago • 2 comments

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 avatar Jul 12 '17 17:07 russelltg

@russelltg Hi. See avio.go and there is a test in format_test.go TestAVIOContext and custom reader implementation customReader. Probably it helps.

3d0c avatar Jul 12 '17 18:07 3d0c

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.

maxwelldergosits avatar Aug 03 '17 21:08 maxwelldergosits