bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.41k stars 1.57k forks source link

javacv 1.5 how to get pkt_pos #2122

Closed asd6390708 closed 8 months ago

asd6390708 commented 8 months ago

I can get pkt_pos value in javaCV 1.4.4, the code like below:

Frame videoFrame = grabber.grabImage(); AVFrame o = (AVFrame) videoFrame.opaque; long position = o.pkt_pos();

but when i upgrade to 1.5 version, o.pkt_pos() return -1 so how can i get pkt_pos, thanks~

asd6390708 commented 8 months ago

I solved this question by myself you need set FFmpegFrameGrabber imageMode as RAW,and upgrade javaCV version to 1.5.5+ due to https://github.com/bytedeco/javacv/issues/1568