GStreamer and JAVA

Nicolas Castillejos djos06 at gmail.com
Tue May 17 08:46:41 UTC 2016


Hi,

I'm trying to make a java application that reads a ".m4v" file in a 
JFrame using the SimpleVideoComponent class from the gstreamer examples.
But my problem is that I can only watch the first picture of the video, 
however the sound is working great.

look at my code :

EventQueue.invokeLater(new Runnable() {

             @Override
             public void run() {
                 vc = new SimpleVideoComponent();
                 bin = new PlayBin("VideoPlayer");

                 bin.setInputFile(new File("./test.m4v"));

                 f.add(vc);
                 vc.setPreferredSize(new Dimension(320, 240));

                 bin.setVideoSink(vc.getElement());
                 bin.play();

                 f.pack();
                 f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 f.setVisible(true);

             }
         });

When i comment this line : bin.setVideoSink(vc.getElement());
the video is playing great in an other frame called "internal frame"
but when I want to play in my own frame inside the SimpleVideoComponent 
it shows only the first picture.

The method newBuffer() in the AppSinkListener of the 
SimpleVideoComponent class is called only once.
And I don't know why...

Do you have an idea to help me resolve this ?

Thank you,

Nicolas


More information about the gstreamer-devel mailing list