An example URL would be: "http://host.me:9999/streams/snek.ts"
I'm writing my program in Java, using vlcj and so far, this is the code I have so far: https://pastebin.com/dnqQ6Yt9
The thing is, it pauses... alot.
Now, I know I can change my code to be something like this:
Code: Select all
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame frame = new JFrame("A GUI");
frame.setBounds(100, 100, 600, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
EmbeddedMediaPlayerComponent mediaPlayer = new EmbeddedMediaPlayerComponent();
frame.setContentPane(mediaPlayer);
frame.setVisible(true);
//play the StreamMedia object I've created
//Play the URL directly instead of creating my own Media class
mediaPlayer.getMediaPlayer().playMedia("MY URL");
}
});
However, I also want to record the stream itself and by going this route, I won't be able to customize how VLC reads from the stream.
What am I missing in my original code that's preventing from having the smooth playback as passing in the URL directly?
I've tried buffered inputstreams, but things are read to quickly and it's back to square one with the stuttering.
I'm pretty new to the vlc community and vlcj so apologies if I'm missing obvious things. I also don't have much experience with http.
Thanks.