abcjake
Posts: 3
Joined: Sun Feb 22, 2015 10:48 pm

press 1 to 6 GPIO buttons to Play a Video

Sun Feb 22, 2015 10:53 pm

Hey,

I am new to raspberry pi, and python. For my High School science fair project, I was hoping to be able to play informational videos. The goal was to have 6 inputs, and 6 different videos. Once a button was pressed, a video would simply play.

I've tried looking for similar source code, but have been unable to find anything simple. Any help?

Thanks

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13379
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: press 1 to 8 GPIO buttons to Play a Video

Sun Feb 22, 2015 11:37 pm

rewrote subject line to something more informative.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Feb 23, 2015 9:14 am

Have you seen Pi Presents. It may do what you're after.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Feb 23, 2015 9:20 am

Agreed, check out PiPresents.

If you want to do it yourself it is simple to respond to GPIO signals in Python and play a video.

See RPi.GPIO

and

http://www.raspberrypi.org/forums/viewt ... 38&t=10599

abcjake
Posts: 3
Joined: Sun Feb 22, 2015 10:48 pm

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Feb 23, 2015 10:29 pm

elParaguayo wrote:Have you seen Pi Presents. It may do what you're after.
Thanks, I'll give it a shot!

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Feb 23, 2015 10:47 pm

Yup, use [pipresents-next] and the radiobuttonshow
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

abcjake
Posts: 3
Joined: Sun Feb 22, 2015 10:48 pm

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Mar 02, 2015 1:44 am

KenT wrote:Yup, use [pipresents-next] and the radiobuttonshow
Is there any way I can get multiple buttons to play different videos? For example; I press button 1 and it plays video 1, I press button 2 and it plays video 2. I've been reading through the manual- but I haven't found anything. Do you have any advice?

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: press 1 to 6 GPIO buttons to Play a Video

Mon Mar 02, 2015 3:55 pm

Its one of the more complicated shows to set up. Best to look at and modify a copy of the example.

Have a look at the pp_radiobuttonshow_1p2 example. Run it and see what it does. Then open a copy of the profile in the editor.

By editing the radiobuttonshow you will see a Links tab. This associates symbolic names to track-references of tracks in the medialist. Change the tracks in the medialist to videos making sure the replacements have a track reference that is in the Links.

You may also need to edit gpio.cfg using Leafpad as this associates the physical buttons with symbolic names.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Return to “Python”