Which Video Library for Playing Video From RPI

I only need to play a video file loaded on Pi–it’s not coming from another source. I noticed there is a regular video library for Processing, but then there is another one for RPI that talks about hardware.

1 Like

Have you looked at this Wiki, toward the bottom of the page , regarding the Raspberry Pi video Hardware? - https://github.com/processing/processing/wiki/Raspberry-Pi

I would also look at this example - https://github.com/gohai/processing-glvideo/tree/master/examples/SingleVideo hope this helps :slight_smile:

Thanks for replying :). Unfortunately been all over the wiki and examples. Also just gave regular Video Processing library a try (which failed as predicted). I do have a lead from an old forum post talking about Pulse Audio. Going to try to install that next.

GLVideo library works for me, the reason is that RaspberryPI and a number of linux distributions use GStreamer-1.x.x whereas original video library use GStreamer-0.1.x, however I believe a fix is in the works.

Good to know. So far GL Video looks great–I just can’t get the audio. I’ve done a bunch of updates, so hopefully tomorrow I’ll try a different monitor, as the one I have at home is HDMI but with separate speakers for audio. I fear that could be the issue since many have complained with similar problems with how HDMI is seen. I’ve tried forcing local audio and other workarounds, but so far nothing. Are your speakers built into your monitor?

Try https://github.com/processing/processing-video/releases/tag/r3-v2.0-beta1 which uses GStreamer 1.x

It is (was) GStreamer 0.10.x, not 0.1.x.

GL Video is still likely to work better on the Pi in the short term, if with less features - OpenGL support still needs to be added to the GStreamer Java bindings - I’ll be working on that over the next couple of months.

I am using domestic TV as a monitor sounds fine from HDMI. There is some stuff you could try
omxplayer video.mp4 rather than always using processing, and amixer cset numid=3 2 or at the death edit /boot/config.txt and setting hdmi_drive=2 requires reboot.

Honestly GL Video looks great–just need to get the audio working–very perplexing despite setting HDMI in config file.

Hey Monkstone, thanks for the detail. I want to use Processing because I will be triggering the video with a sensor and I happen to only be literate in Arduino-speak. Today on the monitor at the art center I was able to get audio using OMX Player, but still not GL Video. Ack!

It would be nice to know whether the SingleVideo example in Processing allows for audio. Maybe there is another statement that needs to be made in the code?

Tagging @gohai as he might be able to help.


1 Like

@Zengirl2 What’s the problem exactly? There is no sound playing at all, or is it just not coming through HDMI? (i.e. what happens if you plug in headphones to the Pi’s audio jack?)

Hi, Gohai! Cool to meet you and sorry for the delay, but I wanted to test one more thing before responding. So, if I try to use the Rasp Pi with OMX Video Player it works fine with HDMI for video and audio. However, if I use GL Video on Processing with the Single Video example (using my video), I get the video, but not the audio using HDMI (nothing on headphones). I have tried forcing HDMI for audio as well as analog in Raspi-Config. I did not try the hotplug setting because my Pi config is in a menu and I don’t see that option. Am I missing anything or is there any special code that needs to be in the example to play audio? I have done all updates/upgrades on my PiB and have enabled 128k memory.

@Zengirl2 Could you upload perhaps a snippet of your video file for me to have a look? Guessing that perhaps the GStreamer that is part of the library can’t decide the codec of your audio track… you could also try downloading the infamous Big Bucks Bunny h264 test file, and test if you hear audio with this one (you should!). Best

1 Like

Ah, Big Bucks Bunny, everyone’s favourite test file :smile:

You could also try using gst-play-1.0 FILE from a terminal which should tell you whether this is a GStreamer or library issue.

Neil, can you clarify the FILE part–should that be my video file name or is FILE part of the command. If so, I’m getting a command not found error.

@gohai and crew–Well, I spent the time to download Big Buck and guess what??? I’ve got audio people!!! This is strange since I had an MP4 test file, but I will be sure that I do the correct H264 codec when creating my own video. Anyway, this is all great because it means I can move onto GPIO for the light sensor. I suspect with the lag using my PiB that I may have to upgrade to a more recent Pi, but this is a great start. Thanks to everyone for their help on this forum.

Yes, that’s right. You can try typing gst<TAB> and see if any of the GStreamer command line tools are installed. Could be just named gst-play. Still, if you’ve got good old Big Buck working it looks like it’s an issue with your file. The command line tools can be good for debugging GStreamer things so are useful to have handy if you haven’t got them installed.

@Zengirl2 Glad it works - sorry for all the hoops to jump trough! If you find out what audio codec your file had, do let us know (so that we can look into making this one work as well in a future build).