2

I have a little project where there are 3 buttons and one display. A video clip (around 5 mins) will play all the time (looping) until one of 3 hard-wired buttons are pressed, when one of 3 video clips are played.

The clips should preferably be stored on a USB stick. There is no requirement for networking.

Should this be easy to achieve and can anyone out there help me set this up please?

Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
Peter
  • 21
  • 1
  • 2
    It sounds really interesting project and not to complicated to do. But unfortunately this is a Q&A and you must ask specific questions. We cannot write up a whole guide for you. Try and start the project your self and when you run into a problem ask a question. – Piotr Kula Aug 20 '13 at 12:58

2 Answers2

1

Please read my comment on your question. That still stands.

The only thing I can suggest as a possible answer to help you get started is to make some kind of plan.

  1. A flow chart of brainstorm of what you need it to do.
  2. You will most likely need to use X to play the videos but there are command line tools to play videos and photos too. Establish what works best for you.
  3. Then choose what programming language you are comfortable with.
  4. Wire up 1 button and see if you can get it triggered in your code.
  5. If you can get it triggered in your code figure out how to stop the current video and play the next one.

That is a basic plan and obviously I cannot go into any details. That is why it is important to ask a precise questions so the right person can give you the right info.

We need to know exactly what the problem is and in what environment.

Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
0

You could use Perl to read GPIO input (button presses) and drive VLC via it's telnet interface. The Perl modules you want are Device::BCM2835 and VideoLan::Client. To install these things from the command prompt do:

Install VLC:

sudo apt-get install vlc

Install C library:

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.26.tar.gz
tar zxvf bcm2835-1.xx.tar.gz
cd bcm2835-1.xx
./configure
make
sudo make check
sudo make install

Install perl modules and dependancies:

sudo cpan Device::BCM2835 VideoLan::Client

Both Perl modules provide example code, the former for reading values from GPIO, The latter for driving VLC. You need to enable the telnet interface for VLC which is documented here.

If you've never dealt building an interface to physical computing I suggest a tutorial like RPi Low-level peripherals (which provides example Perl code).

The basic flow of your program is something like:

if button1 is pressed
   Play video 1
if button2 is pressed
   Play video 2
if button3 is pressed
   Play video 3
else
   Play intoductory video

To achieve this you're going to have to learn some programming skills. http://learn.perl.org/ is a good place to start if you want to use the Perl modules I suggested for reading input and driving VLC. Note that the modules have existing code, you could base a solution upon.

Dr.Avalanche
  • 361
  • 1
  • 11