processing-video icon indicating copy to clipboard operation
processing-video copied to clipboard

can not read any video or make it visible

Open fdiba opened this issue 10 years ago • 28 comments

I can not anymore play video files using processing 2.2.1 on Windows 7 and 8.

I have tried this example with different video files :

https://processing.org/reference/libraries/video/Movie.html

I can't see anything : no video nor error and the movieEvent() doesn't seems to be called.

fdiba avatar Feb 24 '15 16:02 fdiba

I will take a look, but haven't experienced any issues playing videos on windows.

codeanticode avatar May 17 '15 14:05 codeanticode

Ok thank you. I didn't find any solutions for the moment and my QuickTime is up to date. No issue on Mac with the same sketch and video file.

fdiba avatar May 24 '15 18:05 fdiba

I'm having trouble with Capture and Movie in my current computer. They used to work in Ubuntu, I'm not sure if it's related to using ArchLinux now. I'm teaching Processing in two schools and this makes things a bit more difficult.

If I try the example sketches for Movie and Capture they don't work.

Capture complains on Capture.list() with IllegalArgumentException: No such Gstreamer factory: v4l2src. gstreamer seems to be installed.

If I run fswebcam on the command line (a webcam capture command line program) it works fine:

--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...

The Movie loop example does nothing. No error, just black screen. I also tried with .mp4 instead of .mov, which didn't help. I can play video fine on web pages (html5) and in VLC.

I'm on 64bit ArchLinux. Other Processing features work fine (2D and 3D graphics for instance).

Is there something I can do to debug this?

hamoid avatar Jun 16 '15 12:06 hamoid

My issue on ArchLinux was fixed by installing these packages:

extra/gstreamer0.10 0.10.36-4 [installed]
    GStreamer Multimedia Framework
extra/gstreamer0.10-bad 0.10.23-10 [installed]
    GStreamer Multimedia Framework Bad Plugin libraries (gst-plugins-bad)
extra/gstreamer0.10-bad-plugins 0.10.23-10 (gstreamer0.10-plugins) [installed]
    GStreamer Multimedia Framework Bad Plugins (gst-plugins-bad)
extra/gstreamer0.10-base 0.10.36-3 [installed]
    GStreamer Multimedia Framework Base plugin libraries
extra/gstreamer0.10-base-plugins 0.10.36-3 (gstreamer0.10-plugins) [installed]
    GStreamer Multimedia Framework Base Plugins (gst-plugins-base)
extra/gstreamer0.10-ffmpeg 0.10.13-2 (gstreamer0.10-plugins) [installed]
    Gstreamer FFMpeg Plugin
extra/gstreamer0.10-good 0.10.31-8 [installed]
    GStreamer Multimedia Framework Good plugin libraries
extra/gstreamer0.10-good-plugins 0.10.31-8 (gstreamer0.10-plugins) [installed]
    GStreamer Multimedia Framework Good Plugins (gst-plugins-good)
extra/gstreamer0.10-ugly 0.10.19-15 [installed]
    GStreamer Multimedia Framework Ugly plugin libraries
extra/gstreamer0.10-ugly-plugins 0.10.19-15 (gstreamer0.10-plugins) [installed]
    GStreamer Multimedia Framework Ugly Plugins (gst-plugins-ugly)

I'm not sure which ones are required.

hamoid avatar Jul 19 '15 11:07 hamoid

same problem here - UbuntuStudio 14.4.1, Processing 2.2.1 gstreamer plugins installed except for the ffmpeg plugin.

when i run any of the examples for playing the movie, there's no error, just blank window.

novadeviator avatar Jul 23 '15 16:07 novadeviator

The ffmpeg plugin was required in my case.

hamoid avatar Jul 23 '15 16:07 hamoid

Today a student had the same issue on Ubuntu 14.04. The software center on Ubuntu 14.04 does not provide a gstreamer0.10 ffmpeg plugin. We found it on a ppa, installed it, and video worked. Probably not so easy to fix for most users.

hamoid avatar Jul 25 '15 00:07 hamoid

can you provide a link to ppa?

novadeviator avatar Jul 25 '15 12:07 novadeviator

i installed the one from https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media and this made the problem go away. thanks.

novadeviator avatar Jul 25 '15 12:07 novadeviator

@novadeviator Does it work with different size() values? In the Ubuntu 14.04 I mention above, it seems to work with size(200, 200); but not with size(640, 360); which makes no sense at all. Just by changing the size, libgstffmpeg.so crashes, and there's nothing on the sketch depending on width and height! The decoding of the video should not be influenced by the sketch size...

hamoid avatar Jul 26 '15 08:07 hamoid

@hamoid here any size works. on two machines both running UbuntuStudio 14.04.1

novadeviator avatar Jul 27 '15 10:07 novadeviator

I'm running into a similar issue:

No such Gstreamer factory: v4l2src

I don't see gstreamer seems to be installed. though.

I've posted the issue on processing forum but it seems to only gather dust.

My attempt is on a Raspberry PI2 (running Raspian Jessie) with Processing 3 preinstalled on top of which I installed the video library (via the Contribution Manager)

As I mentioned in the post, I can launch the webcam just fine via:

gst-launch-1.0 v4l2src ! videoconvert ! ximagesink

but no joy using Processing.

Could this part be causing problems ?

sourceElementName = "v4l2src";
      // The "device" property in v4l2src expects the device location
      // (/dev/video0, etc). v4l2src has "device-name", which requires the
      // human-readable name... but how to query in linux?.
      devicePropertyName = "device";
      indexPropertyName = "device-fd";

Running v4l2-ctl --list-devices I see:

UVC Camera (046d:0825) (usb-3f980000.usb-1.2):
/dev/video0

Any hints on what packages I should install on Raspian Jessie ?

Thank you, George

orgicus avatar Nov 16 '15 19:11 orgicus

Hi guys, I think there are several different issues discussed here. For one, the reason for the video library to not to work on the RPi is that it does not yet support gstreamer 1.x. There is ongoing work to address this specific issue (see this and this). I believe that @gohai managed to make it work on the Pi, right?

codeanticode avatar Nov 16 '15 19:11 codeanticode

@codeanticode @orgicus So far I've only tested playback.. and the current one should at least in theory work with Raspbian Jessie. (I believe they removed the gstreamer-ffmpeg/libav package for gstreamer 0.10, which seems to be required for decoding many video files. And performance also isn't that great.) So I'd think that No such Gstreamer factory: v4l2src would point to some package no being installed/available, since we're not actually shipping any gstreamer libs with the plugin on Linux.

@codeanticode Would there be a chance of capture working in your gst1-java-core branch? If so, @orgicus, you could also perhaps try this version (uninstall the current library first): http://sukzessiv.net/~gohai/p5-arm/processing-video-gst1-java-core-36294f5.tar.bz2

gohai avatar Nov 16 '15 21:11 gohai

@gohai capture does indeed work, perhaps not in the latest revision of the new library because I started testing out some code that broke the Capture class. The problem is that I still need to implement device query using the new API in gstreamer-1.x.

codeanticode avatar Nov 16 '15 21:11 codeanticode

@orgicus Is there perhaps a v4l package for gstreamer-0.10 on Raspbian Jesse?

gohai avatar Nov 16 '15 21:11 gohai

@codeanticode Thanks, I'll try Gottfried's version of the library. It's the Capture class I was aiming to use mainly.

@gohai I don't think the v4l package for gstreamer-0.10 is installed. I'll check tomorrow when I get on that RPi again. Is it ok to have both gstreamer-1.0 and gstreamer-0.10 side by side or should I uninstall the gstreamer-1.0 packages first ?

Thank you both

orgicus avatar Nov 16 '15 22:11 orgicus

@orgicus They're made to be installed side-by-side. The current video library only makes use of gstreamer-0.10 plugins, so seeing if installing any additional ones helps your use case would be key. gstreamer-1.0 does hardware-accelerated playback on the Pi (using OMX), so that's why most video playback applications for the Pi use this - but Raspbian does come with gstreamer-0.10 and a few additional plugins that can be optionally installed. Let us know how you fare!

gohai avatar Nov 16 '15 22:11 gohai

Thanks @codeanticode, I've tried @gohai 's processing-video-gst1-java-core-36294f5 version of the video library and it worked without installing any additional gstreamer packages. Woo hoo!

There are a couple of things I'd like to change:

  • I've noticed the constructor only takes the PApplet as an argument now, so resolution can't be set ?
  • The colours look off, guessing it defaults to the YUV stream (instead of RGB) ?

Is there any way I can tinker with this version of the video library ? (I'm in the process of setting up eclipse on this RPi)

Thanks again!

orgicus avatar Nov 17 '15 15:11 orgicus

@orgicus right now capture resolution is hard coded at 640x480, but you should be able to change that easily, see the code here. Also, you can set a colorspace conversion filter in the bin specification here.

codeanticode avatar Nov 17 '15 15:11 codeanticode

@codeanticode Awesome, I'll have play. Thank you!

orgicus avatar Nov 17 '15 16:11 orgicus

@gohai I realised I can't tinker with the library if I don't have it setup in eclipse first. I can use this repository, but I will need some hints on how to compile it for RPi. (your processing-video-gst1-java-core-36294f5.tar.bz2 includes the compiled library and no source, so I can't tinker with the Capture dimensions and colour space). Thank you

orgicus avatar Dec 17 '15 11:12 orgicus

@orgicus You just need to compile/hack this: https://github.com/processing/processing-video/tree/gst1-java-core Doesn't need to be done on the Pi, since it's all just Java.

Aw, wrong account - above comment was by me.

gohai avatar Dec 17 '15 12:12 gohai

Just in case others get stuck with this on more recent versions of Ubuntu: the following ppa also supports Utopic, Vivid, Wily and Xenial:

https://launchpad.net/~mc3man/+archive/ubuntu/gstffmpeg-keep

JobLeonard avatar May 31 '16 13:05 JobLeonard

After a few hours I got Processing to work with the Raspberry Pi 3 Model B and a Pi Camera v1. Some quick advice if you're stuck in the same places I was:

-Use Gottfried's version of the Video library -Disable the experimental GL driver -Enable the camera as a video streamer by enabling the BCM2835-v4l2 module (add the line "bcm2835-v4l2" no quotes in the file /etc/modules and reboot)

Hope this helps

m516 avatar Feb 11 '18 05:02 m516

Not sure if this is longer relevant, as v2 of the video library uses GStreamer 1.x now. @hamoid have you tried the latest beta on Ubuntu?

codeanticode avatar Aug 25 '19 14:08 codeanticode

I just tried and wrote some comments: https://github.com/processing/processing-video/issues/113#issuecomment-524649833

hamoid avatar Aug 25 '19 17:08 hamoid