JuliusCode / MP4MUSEUM

MP4MUSEUM.org Media Player
GNU General Public License v3.0
32 stars 8 forks source link

Needing video01 to continuously loop until a button pushed and video02 plays once and then video01 again loops #40

Closed MarkStutz closed 2 weeks ago

MarkStutz commented 8 months ago

I am a newbie here and I found your program while searching for a device. I have been working with a museum for many years and the video player that I always used is no longer (Akman Flash A/V) available and I found this program for a RaspberryPi. What I have is displays that when a button is pressed, it triggers a basic stamp to start a light show and at the same time trigger the video player. I have your program downloaded and like what I see, but I need it modified so that when the Pi is turned on "video01.mpg" starts and continues to loop. When the museum visitor presses the button by the display, I need the RaspberryPi to be triggered to start "video02.mpg" (if that nomenclature is correct) and play that video until completed. Once that video is completed "video01.mpg" video plays and loops until the button is pressed. Is that something that you could help me figure out how to make happen? Thanks so much.

JuliusCode commented 8 months ago

Hi Mark, this can be achieved by adding the loop instruction to the filename, in your case:

file1.loop.mp4 file2.mp4

pressing the button will end playback of the current file, and the player will open the next file.

if you like to control the raspberry from an external circuit, you could add an optocoupler in between. not only to prevent ground loop issues but it will also help if your other circuit is on 3.3v, for example.

best, Julius.

MarkStutz commented 8 months ago

Thanks. I like the way it plays and starts, however the file1.loop.mp4 file that needs to loop plays through the first time and then when it starts again, the video plays about 1 second, then freezes 4-8 seconds and it repeats this sequence until the button is pushed to play the file2.mp4 video. Is there anything in the code that needs adjusted to prevent it from freezing up and play thru each time? Also while the file2.mp4 is playing, if the button is pushed again, then the file2.mp4 stops and file1.loop.mp4 plays. Is there a way to have file2.mp4 play all the way through and ignore any button presses? Thanks so much for your time.

JuliusCode commented 8 months ago

Hi,

usually this means the hardware has trouble decoding your file. is the file very short? you could try to edit a clip that is a few minutes long. also, if it was encoded with adobe software, try „handbrake“ or another ffmpeg based encoder.

best, Julius.