开发者

Xuggler-Java- How to create packets from a byte array?

开发者 https://www.devze.com 2023-03-13 08:52 出处:网络
I am building an export application using Xuggler that exports a h264 encoded recording so that it can be played in an external player ( writing the video recording to .avi or .mp4 container).

I am building an export application using Xuggler that exports a h264 encoded recording so that it can be played in an external player ( writing the video recording to .avi or .mp4 container).

I am interest开发者_开发知识库ed to know how one could create a IPacket from a byte array representing a video frame. What parameters from the IPacket need to be set and what values should those contain? And again what parameters should be set and what should be their values for the container that gathers the packets?


packet = IPacket.make( IBuffer.make( null, data, 0, data.length ));
packet.setTimeStamp( time );
packet.setTimeBase( IRational.make(1,1000) ); 
int pksz = packet.getSize(); 
packet.setComplete(true, pksz);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号