Using VLCJ to draw video onto a texture


#21

1.I have installed a VLC player.
2.Yes,I have setted path.
3.Yes,The video play in the VLC player.
4.mp4 format
5.Not any error.But hang and not work,

and I try to modify value of width and height to be both below 1000.(960*540)
Then,The video is work.


#22

If don’t compress the Video.
How can support Ultra Video(2560*1440)?


#23

I have no idea. It might be that it takes so long to render one frame that by time it has finished it has to render the next and so just consumes the entire loop constantly.

You could try looking at using a different rasterisation method maybe, or optimising the current way.


#25

I refer to rickard GitHub(https://github.com/neph1/jme3-vlcj),
Use JmeRenderCallbackAdapter.java and modify some Code.

    Image image = new Image();
    image.setWidth(width);
    image.setHeight(height);
    image.setFormat(Image.Format.BGRA8);
    image.setData(BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * 4));

    jmeTexture = new Texture2D(image);
    factory = new MediaPlayerFactory("--video-filter=transform", "--transform-type=vflip");
    mediaPlayer = factory.mediaPlayers().newEmbeddedMediaPlayer();

    mediaPlayer.videoSurface().set(factory.videoSurfaces().newVideoSurface(
            new TestBufferFormatCallback(),
            new JmeRenderCallbackAdapter(jmeTexture),
            true));

    mediaPlayer.media().play(media);

    Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    material.setTexture("ColorMap", jmeTexture);

The Ultra Video(2560*1440) is work!


#26

Thanks - I’ve updated the gist with your findings for everyone else :slight_smile: