• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Java
  • Created almost 12 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample application showing vlcj rendering video in a JavaFX scene.

vlcj

For a brand-new bleeding edge demo application using the currently in development vlcj-5.0.0 and LibVLC 4.0.0, switch to the 5.x development branch.

vlcj-javafx-demo

Demo showing how vlcj can be used to render video to a JavaFX Canvas.

The new JavaFX PixelBuffer is used to avoid a full-frame buffer copy, this is the strongly recommended approach.

See:

With the PixelBuffer the native video buffer is directly shared with JavaFX thereby avoiding full-frame copies for each video frame.

Performance is really good with PixelBuffer. This solution is likely to outperform the Swing/Java2D implementation and likely may be the best approach for a cross-platform media player (even on OSX, which has not supported the optimal embedded solution for a long time now.)

GPU Support

GPU support even for modern video cards is pretty poor in JavaFX under Java7.

nVidia cards seem to be better supported at the moment.

If your video card is not supported then JavaFX will fall back to a software renderer. This will hobble your video playback performance.

Java8 seems much better - i.e. some modern mainstream AMD graphic cards seem better supported. Under Java8 this sample application is working fine with a Radeon HD 7700 series video card on Linux. It of course works a lot better with an nVidia GeForce GTX 1050 Ti, also tested on Linux.

Java/JavaFX Versions

This example project now requires JDK 11 and at least JavaFX 13 (for the new PixelBuffer).

Note that it is still possible in your own projects to use some of the other examples in this project on JDK 1.7 or earlier versions of JavaFX if you need to support that.

Notes

Contemporary versions of JavaFX provide a SwingNode so that it is possible to embed Swing components inside a JavaFX scene - so why not use this for vlcj?

Well, vlcj still would require a heavyweight AWT Canvas, and heavyweight components do not work with the SwingNode component.

So whichever way you look at it, you're stuck with direct rendering, as per the test cases provided by this project.

What might be an option for you is to go the otherway, using Swing/AWT for your vlcj video window and embedding a JavaFX scene inside your Swing application.

Memory Profile

Using the standard JVM settings (default garbage collector):

Standard JVM Settings Memory Profile

This test case plays a DVD ISO.

I can't really explain the behaviour of the garbage collector, it seems erratic and to change behaviour over time.

Nevertheless, there is clearly no memory leak, and it can run consistently in under 100Mb of heap memory.

More Repositories

1

vlcj

Java framework for the vlc media player
Java
1,130
star
2

jquery-orgchart

JQuery Organisation Chart Plugin
JavaScript
248
star
3

vlcj-player

Feature-rich example vlcj media player
Java
178
star
4

picam

Unofficial Java API library for the Raspberry Pi camera.
Java
49
star
5

vlcj-javafx

JavaFX support classes for vlcj.
Java
40
star
6

vlcj-examples

Examples for the vlcj project
Java
27
star
7

choonio

An audio player implemented using vlcj, VLC, Spring Boot and React
TypeScript
23
star
8

vlcj-info

Small library to extract media information from local files.
Java
17
star
9

vlcj-natives

Native bindings to LibVLC used by the vlcj project
Java
14
star
10

vlcj-lwjgl-demo

Demo application embedding a vlcj media player in a LWJGL application
Java
14
star
11

ezcap-linux

Some notes on how to get an EZCap USB capture device working under Linux for VLC et al
14
star
12

bootlace

A complete AngularJS, Spring MVC, Spring Security and MongoDB reference web application
JavaScript
13
star
13

spa-javalin-react

Basic Javalin web application configured for a ReactJS single page client application
JavaScript
8
star
14

vlcsharp

Port of vlcj to platform-independent C#
C#
6
star
15

spa-vertx-vue

Basic Vert.x web application configured for a VueJS single page client application
Java
5
star
16

spa-vertx-angular

Basic Vert.x web application configured for an AngularJS single page client application
Java
5
star
17

react-org-chart

Simple hierarchical organisation chart component for ReactJS
JavaScript
5
star
18

picam-native

JNI native library for the picam project
C
4
star
19

spa-spring-vue

Basic SpringMVC web application configured for a VueJS single page client application
Java
4
star
20

youtube-comments

Download a YouTube comment thread as a spreadsheet
Java
3
star
21

lircj

Java wrapper for LIRC
Java
3
star
22

spa-vertx-react

Basic Vert.x web application configured for a ReactJS single page client application
JavaScript
3
star
23

media-scanner

Scan directories recursively for media, with pluggable title and meta-data parsing.
Java
3
star
24

micro-frontend

Complete example of a micro-frontend application built using ReactJS
JavaScript
2
star
25

spa-boot-react

Basic Spring Boot web application configured for a ReactJS single page client application
Java
2
star
26

react-template-app

Template application for React, with Typescript, Jest, ESLint, Prettier, Husky and maybe more
JavaScript
2
star
27

sfa

Fully working single page reference application with React, SpringBoot, Spring Security and MongoDB
Java
2
star
28

spa-spring-react

Basic SpringMVC web application configured for a ReactJS single page client application
Java
2
star
29

vlcj-subs

Optional vlcj library for integrating subtitle/sub-picture functionality
Java
2
star
30

generator-prospa

Create fully working Single Page Applications using various technology combinations with Yeoman
JavaScript
2
star
31

vlcj-hue-concept

Proof of concept application showing how vlcj could be used to provide ambient light cues
Java
2
star
32

vlcj-swt-swing

Example showing how to use vlcj and SWT embedded in a Swing application
Java
1
star
33

vlcj-radio-demo

A demo application that uses vlcj to play internet radio streams
Java
1
star
34

rotten-tomatoes-service

Simple service to access the Rotten Tomatoes public web services.
Java
1
star
35

inhibit

Small library to inhibit the desktop screensaver on Linux
C
1
star
36

image-utils

Simple image processing utilities.
Java
1
star
37

nodejs-typescript-example

Example project showing how to create a NodeJS application with Typescript in Visual Studio Code
TypeScript
1
star
38

bloodmatch

MeteorJS reference application, a real-time multiplayer matchmaking web application for Bloodborne
JavaScript
1
star
39

tmdb-service

Simple service to access themoviedatabase.org public web services.
Java
1
star
40

vlcj-osx-stubs

Various stubs for OSX-specific classes used to cross-compile vlcj on Linux or Windows
Java
1
star
41

next-starter

Starter project for NextJS with ESLint, Prettier and Husky
JavaScript
1
star
42

segment-amplitude-testing

TypeScript
1
star
43

vlcj-swt

Support library to use an EmbeddedMediaPlayer with an SWT video surface
Java
1
star
44

reactive-gridfs

Example showing how to use Spring Boot, Spring Web Flux and GridFS to create a reactive simple file upload/download service.
Java
1
star
45

font-face-test

TypeScript
1
star
46

vlcj-file-filters

User interface FileFilter implementations for file types supported by vlcj
Java
1
star
47

arty

Various components used to deal with art resources
Java
1
star
48

brue

Java framework for the Philips Hue bridge web-service API
Java
1
star
49

vlcj-legacy

Legacy components used by FFI version of vlcj.
Java
1
star
50

native-streams

A small library that enables the redirection of native process in/out/err streams to any file
Java
1
star
51

expo-starter

Starter project for React Native with Expo, Typescript, and modern tooling
TypeScript
1
star
52

brue-okhttp

OkHttp implementation for the Brue project
Java
1
star
53

image-service

Java
1
star
54

caprica

1
star
55

spa-boot-vue

Basic Spring Boot web application configured for a VueJS single page client application
Java
1
star