bytedeco / javacv

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

JavaCV with FFmpeg, OpenCV, etc only modules #1071

Open guy-keller opened 5 years ago

guy-keller commented 5 years ago

Hi @saudet

How do I go about creating a "javacv-ffmpeg-dist.jar"?

I understand that the javacv-platform includes several other image and video processing tools but in my particular case (there may be others out there wanting the same too) I am only interested on ffmpeg.

Thank you very much in advance for your help.

Gui

saudet commented 5 years ago

We can easily exclude whatever we want with Maven: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html

saudet commented 5 years ago

There's also the compiler and jar plugins: https://maven.apache.org/plugins/maven-jar-plugin/examples/include-exclude.html https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html

saudet commented 5 years ago

And we could use a build profile for that so let's mark this as an RFE: https://maven.apache.org/guides/introduction/introduction-to-profiles.html

guy-keller commented 5 years ago

Hi @saudet,

Thanks for the prompt reply! It turns out that I can produce a fat-jar and remove "unwanted packages" using the maven shade plugin.

Here is a StackOverflow link with examples: https://stackoverflow.com/questions/30023509/i-wish-to-exclude-some-class-files-from-my-jar-i-am-using-maven-assembly-plugin

Nevertheless, I still think that specialist jars such as JavaCV-ffmpeg, JavaCV-OpenCV, etc.. could be made available as well as the "JavaCV-all-platforms". [ suggestion ]

For the time being, I am making platform specific releases of my app (not ideal but oh well). To reduce its size I use the maven shade plugin to remove the .so and .dylib from a windows package for example.

Cheers, Gui :+1:

saudet commented 5 years ago

Let's keep it open! Thanks

saudet commented 4 years ago

If/when we decide to split JavaCV into modules, I think I would like to go with the following, in addition to javacv-platform:

javacv-core
javacv-android
javacv-java2d
javacv-javafx
javacv-opencv
javacv-ffmpeg
javacv-tesseract
javacv-dc1394
javacv-flycapture
javacv-openkinect
javacv-ps3eye
javacv-realsense
javacv-videoinput
javacv-algorithms

Along with the corresponding JPMS modules and Java packages org.bytedeco.javacv.core, org.bytedeco.javacv.ffmpeg, etc, which would break backward compatibility. What do you guys think?

/cc @denismakogon

denismakogon commented 4 years ago

Personally, I'm on both sides of this problem. I hate seeing something that breaks from release to release, however, I'm the one who brought this topic to a wider audience. So, I feel like I'm not the one who should vote here.