javacv icon indicating copy to clipboard operation
javacv copied to clipboard

FFmpegFrameGrabber Hardware accelerated decoding does not take effect

Open sulv9999 opened this issue 9 months ago • 1 comments

Hello developer, I am making FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(rtsp); When, GPU accelerated decoding does not take effect

String rtsp = "rtsp://admin:[email protected]:554/smart265/ch1/main/video"; FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(rtsp); grabber.setVideoCodec(avcodec.AV_CODEC_ID_H265); try { grabber.start(); } catch (FFmpegFrameGrabber.Exception e) { throw new RuntimeException(e); } Frame frame; try { while ((frame = grabber.grabImage()) != null) { System.out.println(frame.imageWidth); } } catch (FFmpegFrameGrabber.Exception e) { throw new RuntimeException(e); }

sulv9999 avatar Oct 29 '23 08:10 sulv9999

You'll need to call setVideoCodeName() with the name of the hardware accelerated codec you want to use: https://trac.ffmpeg.org/wiki/HWAccelIntro

saudet avatar Oct 29 '23 11:10 saudet

"Thank you very much. I have resolved the issue."

sulv9999 avatar Feb 27 '24 09:02 sulv9999