Ffmpeg/AVPacket question #1024
-
I am trying to create my own AVPackets out of a Java ByteBuffer but I seem to be getting an “Exception_Access_Violation” error. I am using the ReadFewFrames as a starting example. The video that I am using contains both video and data packets. I would like to replace the data packets with my own packets. ByteBuffer bb = new ByteBuffer(); BytePointer bp = new BytePointer(bb); I am copying the following properties from the original data packets into my av packet: dts, duration, flags, pts, size and stream_index. I then am calling a format.av_interleaved_write_frame passing in my context and av. and then freeing the packet which I created. When I run my program it dies almost immediately (it looks to be having an issue inside of acutely.dll). When I comment out my code and write and free the original packet the program works fine. Does anybody have a example of doing a something similar that they could share I would greatly appreciate it, or any idea if I am missing a magic line of could. Thanks in advance J. Stoy |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think you may want to put your data in the packet by calling AVPacket.data(bp)? Calling AVPacket(bp) isn't going to do that. |
Beta Was this translation helpful? Give feedback.
-
Samuel,
I made that change. The program completes successfully. Thanks Samuel!
…On Mon, Mar 22, 2021 at 6:38 PM Samuel Audet ***@***.***> wrote:
I think you may want to put your data in the packet by calling
AVPacket.data(bp)? Calling AVPacket(bp) isn't going to do that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1024 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHLAWYWTRFAIS7WXDZJJSZTTE7WIHANCNFSM4ZUELA5Q>
.
|
Beta Was this translation helpful? Give feedback.
I think you may want to put your data in the packet by calling AVPacket.data(bp)? Calling AVPacket(bp) isn't going to do that.