bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.51k stars 1.58k forks source link

Using FFmpegFrameFilter with zscale and tonemapping #1389

Open GoPenguins opened 4 years ago

GoPenguins commented 4 years ago

When I attempt to create the following filter:

"zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=mobius:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:1080"

the filter throws an exception when attempting to start:

org.bytedeco.javacv.FrameFilter$Exception: avfilter_graph_parse_ptr() error -22

The filter in question works fine from ffmpeg command line, but I'm using this filter with frame grabber. Any suggestions?

saudet commented 4 years ago

What are the error messages from the log?

GoPenguins commented 4 years ago

Sorry, I forgot to attach... Pretty sure this is what you are looking for

No such filter: 'zscale'

saudet commented 4 years ago

Ok, so we would need to enable it in the build. Contributions are welcome, so please do send a pull request if you get it working! Let me know if you have any questions though. Thanks

b005t3r commented 3 years ago

I guess this still hasn't been changed? The lack of zscale filter makes converting HDR videos impossible.

Enabling this shouldn't be that difficult:

To enable compilation of this filter, you need to configure FFmpeg with --enable-libzimg

http://underpop.online.fr/f/ffmpeg/help/zscale.htm.gz

callisto-jovy commented 11 months ago

As converting HDR videos would be very handy and there has not been an update yet, would it be possible to include the flag in the next release?

saudet commented 11 months ago

Contributions are welcome! Please open a pull request with the change

callisto-jovy commented 11 months ago

Contributions are welcome! Please open a pull request with the change

Will do!

b005t3r commented 9 months ago

So what's the status of this? I guess it still hasn't been resolved?

b005t3r commented 9 months ago

I created a pull request for this, should fix the issue:

https://github.com/bytedeco/javacpp-presets/pull/1448

callisto-jovy commented 9 months ago

So what's the status of this? I guess it still hasn't been resolved?

Sorry, I haven't been able to get to the issue for some time now. I'll try to fix the remaining cases next week.

b005t3r commented 8 months ago

@callisto-jovy were you able to make any progress on this?