1

Does someone have some example code to play a simple video file with the current javaCPP/javaCV version and the FFmpegFrameGrabber?

I tried this solution, but its apparently too old and does not work with the current javacv version because of an incompatible FrameGrabber interface (returns a "Frame"-Object instead of an "IplImage"-Object). If I change the code manually (using Frame instead of IplImage), it returns the error message:

java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/bytedeco/javacv/FFmpegFrameGrabber.startUnsafe()V @1291: invokespecial
  Reason:
    Type 'org/bytedeco/javacpp/avutil$AVFrame' (current frame, stack[2]) is not assignable to 'org/bytedeco/javacpp/Pointer'
  Current Frame:
    bci: @1291
    flags: { }
    locals: { 'org/bytedeco/javacv/FFmpegFrameGrabber', integer, 'org/bytedeco/javacpp/avformat$AVInputFormat', 'org/bytedeco/javacpp/avutil$AVDictionary', integer, 'org/bytedeco/javacpp/avcodec$AVCodec', integer, integer, integer, integer }
    stack: { uninitialized 1283, uninitialized 1283, 'org/bytedeco/javacpp/avutil$AVFrame' }
  Bytecode:
    0x0000000: 2a01 b500 332a bb00 8659 01b7 0087 b500............

FYI: I'm comparing different java libraries for playing video files and extract their pixel data (xuggler, vlcj, ...) and search for the best one. I really like to include javacv in my tests but it's not working :(

Community
  • 1
  • 1
Floesmaan
  • 13
  • 3

0 Answers0