B4J Library [B4j] Jave2 FFMPeg Library

After using FFMpeg from the command line, I came across Jave2 (Java Audio Video Encoder) a java wrapper based on FFMpeg. Useful to integrate FFMpeg into your app without having to use jShell. The library jars are quite large, so if you only want to use it for the odd conversion it might be better to use the Shell option. With the library, users of your app won't have to install FFMpeg on their machines.

There are 2 b4xlibs attached and a test project for each (you will have to change at least the source and target filenames to use the test projects). if you want to get real-time messages (progress information) you need to use the Threaded version of the library.

There are some examples on the jave2 github page, but not many. If you don't know FFMpeg, you can search the internet for the examples you need. It should be easy enough to implement them with the library.

Setup
  • Download jave-core and whichever nativebin file(s) you wish to use from their Maven Repository into your B4j additional libraries folder.
  • Download slf4j-api-2.0.0.jar and slf4j-nop-2.0.0.jar from the slf4j Maven Repository into your B4j additional libraries folder if you don't already have them.

External Dependencies
  • Non Thread version - None
  • Threaded version - Threading
Comments
Use the threaded version if you are going to convert large files, otherwise the Gui will be blocked.​
The test apps use nativebin-win64. You will need to change that in the #AdditionalJar directive if you want to use something different.​

Update
FFMpeg-Threaded-b4xlib v 0.12 - 25 Aug 2022

  • Listener is created automatically if needed. Changed Initialization parameters
  • Added Complete event that can be used with Wait For to queue conversions for the threaded calls
  • Test app also updated.

I hope you find it useful.
 

Attachments

  • FFMpeg-b4xlib.b4xlib
    8.5 KB · Views: 280
  • FFMpeg-Test.zip
    2.5 KB · Views: 293
  • FFMpeg-Threaded-b4xlib.b4xlib
    9 KB · Views: 304
  • FFMpeg-Threaded-Test.zip
    2.7 KB · Views: 275
Last edited:

JackKirk

Well-Known Member
Licensed User
Longtime User
Steve, I just looked you up - Swindon is not far from Pucklechurch where I have been several times.
 
Top