JVLC crashes

This forum is about all development around libVLC.
quorthon
Blank Cone
Blank Cone
Posts: 28
Joined: 22 Mar 2009 17:32

JVLC crashes

Postby quorthon » 03 Apr 2009 15:19

Hy

I've the following error in my jvlc-java player:
- when I get a video-stream and display it, all works fine until the end of the stream, then the player crashes:

Code: Select all

run: [00000001] main libvlc debug: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team [00000001] main libvlc debug: libvlc was configured with ./configure '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--with-binary-version=1ubuntu3.1' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--with-mozilla-pkg=libxul-plugin' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-atmo' '--enable-taglib' '--enable-libass' '--enable-libdca' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,--as-needed' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000001] main libvlc debug: translation test: code is "C" [00000376] main libvlc debug: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team [00000376] main libvlc debug: libvlc was configured with ./configure '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--with-binary-version=1ubuntu3.1' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--with-mozilla-pkg=libxul-plugin' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-atmo' '--enable-taglib' '--enable-libass' '--enable-libdca' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,--as-needed' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000376] main libvlc debug: translation test: code is "C" [00000389] main libvlc debug: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team [00000389] main libvlc debug: libvlc was configured with ./configure '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--with-binary-version=1ubuntu3.1' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--with-mozilla-pkg=libxul-plugin' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-atmo' '--enable-taglib' '--enable-libass' '--enable-libdca' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,--as-needed' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000389] main libvlc debug: translation test: code is "C" [00000402] main libvlc debug: VLC media player - version 0.9.4 Grishenko - (c) 1996-2008 the VideoLAN team [00000402] main libvlc debug: libvlc was configured with ./configure '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--with-binary-version=1ubuntu3.1' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--with-mozilla-pkg=libxul-plugin' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-atmo' '--enable-taglib' '--enable-libass' '--enable-libdca' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,--as-needed' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000402] main libvlc debug: translation test: code is "C" [b]*** LibVLC Exception not handled: No active input Set a breakpoint in 'libvlc_exception_not_handled' to debug. # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x90335b9b, pid=7698, tid=2114976656 # # Java VM: Java HotSpot(TM) Server VM (11.0-b15 mixed mode linux-x86) # Problematic frame: # C [libvlc.so.2.0.2+0x10b9b] # # An error report file with more information is saved as: # /home/peach/HTA/Diplomarbeit/videostreaming/streaming_test/hs_err_pid7698.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Java Result: 134 BUILD SUCCESSFUL (total time: 2 minutes 49 seconds)[/b]
This happens also when I click on Stop or when I pauses the stream at the streaming-server for about ten seconds...

Here the code of my player:

Code: Select all

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * LectureScreen.java * * Created on Mar 26, 2009, 5:45:53 PM */ package ch.hslu.bda.wonderland.streaming; import java.awt.Canvas; import javax.swing.JOptionPane; import org.videolan.jvlc.JVLC; import org.videolan.jvlc.MediaDescriptor; import org.videolan.jvlc.MediaList; import org.videolan.jvlc.MediaListPlayer; import org.videolan.jvlc.MediaPlayer; /** * * @author peach */ public class LectureScreen extends javax.swing.JPanel { //JVLC private Canvas jvcanvas; private JVLC jvlc; private MediaListPlayer medialistPlayer; private MediaPlayer mediaPlayer; private MediaDescriptor mediaDescriptor; /** Creates new form LectureScreen */ public LectureScreen() { initComponents(); //JVLC jvlcSetup(); } private void jvlcSetup() { jvcanvas = new java.awt.Canvas(); jvcanvas.setSize(400, 200); jPanel_document.add(jvcanvas); String[] arg = new String[4]; arg[0] = "--intf=dummy"; arg[1] = "--ignore-config"; arg[2] = "--no-plugins-cache"; arg[3] = "--plugin-path=plugins"; jvlc = new JVLC(arg); medialistPlayer = new MediaListPlayer(jvlc); mediaDescriptor = new MediaDescriptor(jvlc, "http://192.168.1.38:8080"); //mediaDescriptor = new MediaDescriptor(jvlc, "rtsp://localhost:5554/testclip"); mediaPlayer = new MediaPlayer(mediaDescriptor); medialistPlayer.setMediaInstance(mediaPlayer); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jButton_play = new javax.swing.JButton(); jButton_pause = new javax.swing.JButton(); jButton_stop = new javax.swing.JButton(); jPanel_document = new javax.swing.JPanel(); btnDebug = new javax.swing.JButton(); txtPosition = new javax.swing.JTextField(); lblPosition = new javax.swing.JLabel(); btnApply = new javax.swing.JButton(); jButton_play.setText("Play"); jButton_play.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton_playActionPerformed(evt); } }); jButton_pause.setText("Pause"); jButton_pause.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton_pauseActionPerformed(evt); } }); jButton_stop.setText("Stop"); jButton_stop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton_stopActionPerformed(evt); } }); jPanel_document.setPreferredSize(new java.awt.Dimension(400, 200)); javax.swing.GroupLayout jPanel_documentLayout = new javax.swing.GroupLayout(jPanel_document); jPanel_document.setLayout(jPanel_documentLayout); jPanel_documentLayout.setHorizontalGroup( jPanel_documentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 493, Short.MAX_VALUE) ); jPanel_documentLayout.setVerticalGroup( jPanel_documentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 247, Short.MAX_VALUE) ); btnDebug.setLabel("debug"); btnDebug.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDebugActionPerformed(evt); } }); txtPosition.setText("0.0"); lblPosition.setText("position:"); btnApply.setText("apply"); btnApply.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnApplyActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel_document, javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addGroup(layout.createSequentialGroup() .addComponent(jButton_play) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton_pause) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton_stop) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 110, Short.MAX_VALUE) .addComponent(btnDebug) .addGap(18, 18, 18) .addComponent(lblPosition) .addGap(3, 3, 3) .addComponent(txtPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnApply) .addGap(25, 25, 25))) .addGap(18, 18, 18)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel_document, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblPosition) .addComponent(btnApply) .addComponent(jButton_play) .addComponent(jButton_pause) .addComponent(jButton_stop) .addComponent(btnDebug)) .addContainerGap()) ); }// </editor-fold> private void jButton_playActionPerformed(java.awt.event.ActionEvent evt) { //medialistPlayer.play(); jvlc.setVideoOutput(jvcanvas); mediaPlayer.play(); } private void jButton_pauseActionPerformed(java.awt.event.ActionEvent evt) { mediaPlayer.pause(); } private void jButton_stopActionPerformed(java.awt.event.ActionEvent evt) { mediaPlayer.stop(); } private void btnDebugActionPerformed(java.awt.event.ActionEvent evt) { //mediaPlayer.setPosition(0.3f); //mediaPlayer.setTime(5000000); String length, position, fps, rate, time, msg; length = String.valueOf(mediaPlayer.getLength()); position = String.valueOf(mediaPlayer.getPosition()); fps = String.valueOf(mediaPlayer.getFPS()); rate = String.valueOf(mediaPlayer.getRate()); time = String.valueOf(mediaPlayer.getTime()); msg = "length: " + length + "\nposition: " + position + "\nfps: " + fps + "\nrate: " + rate + "\ntime: " + time; JOptionPane.showMessageDialog(null, msg, "debug", JOptionPane.OK_CANCEL_OPTION); } private void btnApplyActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: mediaPlayer.setPosition(Float.parseFloat(txtPosition.getText())); } // Variables declaration - do not modify private javax.swing.JButton btnApply; private javax.swing.JButton btnDebug; private javax.swing.JButton jButton_pause; private javax.swing.JButton jButton_play; private javax.swing.JButton jButton_stop; private javax.swing.JPanel jPanel_document; private javax.swing.JLabel lblPosition; private javax.swing.JTextField txtPosition; // End of variables declaration }
What's the problem?

Thanks for your help.
Peter

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: JVLC crashes

Postby Rémi Denis-Courmont » 04 Apr 2009 12:45

VLC is generating an exception, and JVLC is not handling it.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

quorthon
Blank Cone
Blank Cone
Posts: 28
Joined: 22 Mar 2009 17:32

Re: JVLC crashes

Postby quorthon » 04 Apr 2009 13:55

VLC is generating an exception, and JVLC is not handling it.
thanks for your answer...hm and how can I handle it, that this exception isn't raised anymore? Or how can I handle this exception?

Why is VLC actually generating this exception? When I start the vlc-client directly (not via jvlc) and consumes the stream, at the end of the stream, when I stopping it or when I pause the stream for about 10 seconds on the streaming server, the vlc-client just switches to the starting state (no video loaded) and raises no exception...

Thanks for your help.
Peter

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC crashes

Postby sherington » 04 Apr 2009 14:56

I can't really help with your particular question, but there's a couple of things that helped me on the Java side when I was chasing down JVM failures caused by native library errors and it may help you in some small way...

First is I wrapped the Java libvlc object instance with a Java dynamic proxy (or an AOP library could be used if you know AOP) to log all of the method invocations (method names, parameters and return values) that went through the libvlc object. You basically wrap LibVlc.SYNC_INSTANCE with the dynamic proxy.

I then spotted in the log that I was passing a null rather than an object instance to one of the libvlc methods and that was causing a failure in libvlc which in turn killed my JVM. The null reference in the native library kills the process without the Java side ever seeing an Exception object.

Second is that I've had JVM exits due to deadlocks caused by threading and event callbacks - so I just had to make sure that all my libvlc interactions were called on a different thread to the event callback. Again, the process just gets killed and you never see a Java Exception.

But I've abandoned JVLC now and use my own simplified bindings. I don't see any JVM failures any more and I can play movie after movie with stops/starts/pauses/navigation and so on.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: JVLC crashes

Postby sherington » 02 Feb 2011 21:18

I don't use JVLC but it looks like the native media player is still trying to render video to the Java Canvas after the Canvas has been disposed. Make sure you stop the media player before you exit the application. If it's not that, I have no idea.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: JVLC crashes

Postby Rémi Denis-Courmont » 02 Feb 2011 22:44

VLC is trying to render to a window that does not exist (anymore). You have most probably destroyed the VLC video window before you stopped playback. This wouldn't work in the old and unsupported 1.0.x and earlier VLC versions based on Xlib. More recent VLC, based on XCB, will just detect an error and fail safe (stop rendering).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 33 guests