javacv icon indicating copy to clipboard operation
javacv copied to clipboard

How to grab H264 data instead of YUV?

Open sunplusApp opened this issue 7 months ago • 3 comments

I want to use FFmpegFrameGrabber to capture H264 streams. But I found that the Frame returned after calling the grab() is YUV data. How can I capture H264 instead of YUV?How to config FFmpegFrameGrabber?

sunplusApp avatar Jan 01 '24 05:01 sunplusApp

It sounds like you might want to call grabPacket() maybe?

saudet avatar Jan 01 '24 05:01 saudet

Thank you. I need to read H264 data from RTP to achieve two functions. The first function is to store H264 as an mp4 file, and the second function is to decode H264 into yuv for facial recognition. I should first call grabPacket to capture H264, and then call recordPacket to store it as mp4. Then how can I decode the AVPacket object into YUV?

sunplusApp avatar Jan 01 '24 06:01 sunplusApp

We'd have to update the code a bit for that, but contributions are welcome!

saudet avatar Jan 01 '24 06:01 saudet