Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not read any video or make it visible #23

Open
fdiba opened this issue Feb 24, 2015 · 28 comments
Open

can not read any video or make it visible #23

fdiba opened this issue Feb 24, 2015 · 28 comments
Assignees

Comments

@fdiba
Copy link

fdiba commented Feb 24, 2015

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.

@codeanticode codeanticode self-assigned this May 17, 2015
@codeanticode
Copy link
Member

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

@fdiba
Copy link
Author

fdiba commented May 24, 2015

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.

@hamoid
Copy link
Contributor

hamoid commented Jun 16, 2015

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
Copy link
Contributor

hamoid commented Jul 19, 2015

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.

@novadeviator
Copy link

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.

@hamoid
Copy link
Contributor

hamoid commented Jul 23, 2015

The ffmpeg plugin was required in my case.

@hamoid
Copy link
Contributor

hamoid commented Jul 25, 2015

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.

@novadeviator
Copy link

can you provide a link to ppa?

@novadeviator
Copy link

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

@hamoid
Copy link
Contributor

hamoid commented Jul 26, 2015

@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...

@novadeviator
Copy link

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

@orgicus
Copy link

orgicus commented Nov 16, 2015

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

@codeanticode
Copy link
Member

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?

@gohai
Copy link
Contributor

gohai commented Nov 16, 2015

@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

@codeanticode
Copy link
Member

@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.

@gohai
Copy link
Contributor

gohai commented Nov 16, 2015

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

@orgicus
Copy link

orgicus commented Nov 16, 2015

@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

@gohai
Copy link
Contributor

gohai commented Nov 16, 2015

@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!

@orgicus
Copy link

orgicus commented Nov 17, 2015

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!

@codeanticode
Copy link
Member

@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.

@orgicus
Copy link

orgicus commented Nov 17, 2015

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

@orgicus
Copy link

orgicus commented Dec 17, 2015

@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

@DigitalPublishingToolkit

@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.

@gohai
Copy link
Contributor

gohai commented Dec 17, 2015

Aw, wrong account - above comment was by me.

@JobLeonard
Copy link

JobLeonard commented May 31, 2016

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

@m516
Copy link

m516 commented Feb 11, 2018

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

@codeanticode codeanticode added this to the Version 2.0 stable milestone Aug 25, 2019
@codeanticode
Copy link
Member

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?

@hamoid
Copy link
Contributor

hamoid commented Aug 25, 2019

I just tried and wrote some comments: #113 (comment)

@codeanticode codeanticode removed this from the Version 2.2.2 milestone Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants