Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4972

Graphics, sound and multimedia • Re: RPi to show pic until button pressed then show video

$
0
0
This should be simple, but I'm running into a constant loop.

I would like to do this on a RPi5:

On program start:

open a picture in fullscreen mode and keep it open until a button is pressed. at the button press, turn on an LED and play a video. When the video is over, turn off the LED and go back to the starting picture (start of the code) so that the process starts over again for the next user. It would be nice if the media player could do this seamlessly. The picture is a still of the first and last frame of the video.

Seems super easy, but I'm struggling because I'm new to this, but I need this for a project. Any help is VERY appreciated.

Tim
Is this related to your other project?

viewtopic.php?p=2279543#p2279543

If yes, you should continue the discussion there. If no you should make it clear here that it is not related.

Either way, it is easy, but the devil is in the details. Most beginners get overwhelmed by the whole thing, whereas it's much easier to break it down and focus on small parts. Get them working then put everything together.

In this case you have several pieces:
Detect button press
Control an LED
Play a video
Show a still image
Start the program automatically

One caveat is that you are using a Pi 5. GPIO handling has changed for Pi 5, so old tutorials and examples won't work.

Probably "show a still image" and "play a video" can be achieved with the same media program. That's one step solved immediately!

Here's an up to date tutorial on buttons and LEDs:
https://www.tomshardware.com/how-to/con ... h-python-3

I suggest you try the tutorial and get it working, then you're almost done. If you can't get it working there's no point in worrying about the rest.

Statistics: Posted by ame — Fri Jan 17, 2025 2:10 am



Viewing all articles
Browse latest Browse all 4972

Trending Articles