bytedeco / javacv

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

FFmpeg hardware decoding support + JavaFX #1999

Closed streamingdv closed 1 year ago

streamingdv commented 1 year ago

Hi, first of all thanks for this amazing lib. I'm currently porting my Android/ iOS streaming app to Windows/ Linux and I'm looking for a way to integrate FFmpeg in my project, first I wanted to compile it by my own but then I found your project which seems to support all things I need. I just a a few questions and I'm sorry if they are already answered somewhere else. I receive the encoded video stream from a server via h264 or HEVC so "all I need to do" is to decode the frames and render them as fast al possible (usually 60fps)

As far as I have seen FFmpeg and the associated libs are compiled with hardware video decoding acceleration support and are compiled without GPL? Is that correct?

As frontend I want to use JavaFX, as I came with an Android/ iOS background there is usually some kind of surface to render the decoder frames but I don't think this feature exists in JavaFX. I saw that the frame is rendered via ImageView but is there a faster way, maybe via OpenGL?

Last question is more like asking if someone already has experience with that? If not then I will play around with that myself of course. Thanks.

saudet commented 1 year ago

There is some support for hardware acceleration, yes, and the non-gpl builds are compiled without GPL code, correct.

You can check https://github.com/rladstaetter/javacv-webcam for ways to render quickly with JavaFX

/cc @rladstaetter @johanvos

saudet commented 1 year ago

Duplicate of #1989

streamingdv commented 1 year ago

@saudet okay thanks for the clarification. Just have one minor question as I currently dig into the presets ffmpeg repo, are these all flags the ffmpeg build is build with:

https://github.com/bytedeco/javacpp-presets/blob/c62e06f84f4168361124cbfefe3ce89b23305eeb/ffmpeg/cppbuild.sh#L11

If yes then it means that for example hardware decoding for Nvidea (NVDEC) is not supported by the standard build? is that correct? If yes then I have to compile my own build for ffmpeg.

saudet commented 1 year ago

nvdec gets enabled, see the build results for that commit: https://github.com/bytedeco/javacpp-presets/actions/runs/4314418089