# H264 player with vlcj in a vision component

**URL:** <https://forum.inductiveautomation.com/t/h264-player-with-vlcj-in-a-vision-component/5150>\
**Category:** Module Development\
**Created:** [September 14, 2012, 3:28pm UTC](https://forum.inductiveautomation.com/t/h264-player-with-vlcj-in-a-vision-component/5150 "2012-09-14T15:28:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 14, 2012, 3:28pm UTC](https://forum.inductiveautomation.com/t/h264-player-with-vlcj-in-a-vision-component/5150/1 "2012-09-14T15:28:51Z")

</div>

Hello,  
I try to embed a video player (h264 compliant) based on vlcj in a vision component.  
I would like to modify the “ComponentExample\_Client” provided with the SDK.

My start point :  
Install VLC for windows : [url][http://www.videolan.org/vlc/index.html[url]](http://www.videolan.org/vlc/index.html%5Burl%5D)  
I use vlcj : [http://www.capricasoftware.co.uk/vlcj/](http://www.capricasoftware.co.uk/vlcj/)

I try to embed the following example which work very well in a java application,  
into the “ComponentExample\_Client” :

```auto
/*
* This file is part of VLCJ.
*
* VLCJ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VLCJ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VLCJ. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2009, 2010, 2011, 2012 Caprica Software Limited.
*/

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;

/**
* Minimal quick-start example.
*/
public class Example1 {

    private final JFrame frame;
    
    private final EmbeddedMediaPlayerComponent mediaPlayerComponent;
    
    public static void main(String[] args) {
        final String mrl = args[0];
        
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Example1().start(mrl);
            }
        });
    }
    
    public Example1() {
        mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
        
        frame = new JFrame("vlcj quickstart");
        frame.setLocation(50, 50);
        frame.setSize(1400, 800);
        frame.setContentPane(mediaPlayerComponent);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
    
    private void start(String mrl) {
        mediaPlayerComponent.getMediaPlayer().playMedia(mrl);
    }
}
```

To test this example directly in Eclipse, we need to specify the path to the VLC dll as follow :  
-Djna.library.path=“C:/Program Files/VideoLAN/VLC”  
and to add the followinf jar to the build path : jna-3.4.0.jar, vlcj-2.1.0.jar, platform-3.4.0.jar

![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:") Could you please help me to modify the HelloWorldComponent.java  
May i override the paintComponent method ?  
How to add the jna.library.path and external jar ?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 5, 2012, 6:36pm UTC](https://forum.inductiveautomation.com/t/h264-player-with-vlcj-in-a-vision-component/5150/2 "2012-10-05T18:36:53Z")

</div>

Any idea ?  
is there a way to add this component into an abstractVisionComponent ?

---

<div class="post-metadata">

**Author:** ![denis.palomanes](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@denis.palomanes](https://forum.inductiveautomation.com/u/denis.palomanes)\
**Post date:** [October 17, 2019, 1:03pm UTC](https://forum.inductiveautomation.com/t/h264-player-with-vlcj-in-a-vision-component/5150/3 "2019-10-17T13:03:25Z")

</div>

Hello,

Finally could you do this? how is the state of this tests?

We are in the same situation…

Thank you,
