Search code examples
javaprocessingbackground-subtraction

Processing 3 : using background subtraction, video not playing


I am trying to run simple processing program in eclipse to play video. this is the code:

import processing.core.*; import processing.video.*;

public class BackgroundSubtraction extends PApplet {

Movie video;

public void setup(){
size(720,480);
 video = new Movie(this,"/home/gurinderbeer/Desktop/new/Gurbinder/data/mv2_002.avi");  
video.loop();
video.play();
}

public void draw() {
image(video, 0, 0); 
}

   public void movieEvent(Movie m) {
  m.read();
}
}

when I run the program, it gives no error. Applet pops-up but video is not playing in applet. I can hear the audio when i run the program, but no visuals on applet. Can anyone please help...! Thanks


Solution

  • I had a similar issue while running on Ubuntu 14.04 64 bit. The error seems to be due to missing FFmeg plugin for GStreamer 0.10. This plugin is not available in the official Ubuntu 14.04 repositories.

    Look at this issue. Assuming it's 14.04 64 bit, try installing the FFmeg plugin as try the code again.

    sudo apt-add-repository ppa:mc3man/trusty-media
    
    sudo apt-get update
    
    sudo apt-get install ffmpeg gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-gnonlin gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly totem-plugins-extra gstreamer-tools ubuntu-restricted-extras libxine1-ffmpeg gxine mencoder mpeg2dec vorbis-tools id3v2 mpg321 mpg123 libflac++6 totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 libjpeg-progs flac faac faad sox ffmpeg2theora libmpeg2-4 uudeview flac libmpeg3-1 mpeg3-utils mpegdemux liba52-0.7.4-dev libquicktime2