alubbock / rpi-vidlooper

Video player for Raspberry Pi, controlled by GPIO buttons
MIT License
19 stars 18 forks source link

GPIO wont trigger Video #7

Open DerPicknicker opened 3 years ago

DerPicknicker commented 3 years ago

Hey,

I try to install your Videoplayer...But sadly nothing happens if I press my button.. I also try your troubleShooting...But still nothing happens... The Splash-Screens appears but after that nothing happened... How can I fixed that..?

Thank you!

alubbock commented 3 years ago

Hi, either the button press isn't registering, or your videos won't play. Does the screen flicker or do anything when you press a button? If not, it's probably a physical button issue.

For debugging, let's start with one switch and video. The switch should be connected to pin 26 and to any of the ground pins labelled in black in the following diagram:

Raspberry pi pinout diagram

You could connect an LED between pins 21 and ground (with a series resistor), which would give you a visual readout if the button press had been registered.

For the video, when you start vidlooper, try specifying the absolute path (e.g. /home/pi/myvideo.mp4). The video needs to be in quite a specific format - h264 encoded, AAC audio, 1080p resolution, MP4 container. If your video ends in .mp4, it most commonly meets these specs, but be careful if the video is in a higher resolution as it'll need downscaling first.

DerPicknicker commented 3 years ago

Thank you for your fast reply…

I will try to play the file manually if this works the problem is caused by my switch.. But I used an simple cable for connecting GND and pin 26..

Could you send me the command to use the vidlooper.. ? The splash-screen starts, Then nothing happens, no flickering, no try to play just the splash screen. I can try to copy the Video to the sd-Card.. I try to play it from an usb drive.. Should I use the raspbian image with desktop or without..?

alubbock commented 3 years ago

The simplest way to run it is to run vidlooper with no arguments - this will load video files (with the correct extension, e.g. .mp4) in the current directory. You can get a full list of options by running vidlooper --help.

I would try it without a splash screen and with no looping first - the video should autoplay on start once (to check it works), then you can check the button. Try vidlooper --no-loop /opt/vc/src/hello_pi/hello_video/test.h264, which should play the Raspberry Pi test video.

The player is designed to run from the command line, so best to use the "Lite" version of Raspberry Pi OS.

DerPicknicker commented 3 years ago

I will try it... I will reply in 10 min... And I will also test if my GPIO-Pins are working...

EDIT1: I will reinstall Raspberry PI OS lite again...

DerPicknicker commented 3 years ago

So... I reinstalled everything but now I get an error which I didnt get before... Five hours ago I tried and then I got no errors...But now I get an Traceback error... See the picture which I attached.. Here is the Text version : rpi-vidlooper starting in 1 seconds (Ctrl-C to abort)...Exception ignored in: <function VidLooper.del at 0x765cfdf8> Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/rpi_vidlooper/vidlooper.py", line 195, in del if not self.debug: AttributeError: 'VidLooper' object has no attribute 'debug' Traceback (most recent call last): File "/usr/local/bin/vidlooper", line 10, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/rpi_vidlooper/vidlooper.py", line 278, in main VidLooper(**vars(args)).start() TypeError: init() got an unexpected keyword argument 'no_osd'

image

EDIT1: I saw you changed something in the Code... Is this the Problem why the vidlooper won’t start anymore?

alubbock commented 3 years ago

Yes, apologies, please update to fix pip3 install --upgrade rpi-vidlooper and try again.

DerPicknicker commented 3 years ago

I think the Code won’t update.. It said that rpi-vidlooper is already up2date.. But I found one old Version of the code which plays the test-Video: https://raw.githubusercontent.com/alubbock/rpi-vidlooper/846abe1fa8a22c9437bb58106026f32bfad6b3f3/rpi_vidlooper/vidlooper.py

EDIT1: Now the Code updates.... The Vidlooper plays the video... So how should I proceed..? How should the GPIO-Comment looks?

alubbock commented 3 years ago

I only just updated it, so it may take a few minutes for PyPI's mirrors to update in your location. Try the upgrade command again in a few minutes. You can check your current version with pip3 freeze | grep vidlooper. The new version is v0.5.1.

DerPicknicker commented 3 years ago

Thanks...Please have a look at my edit1 in my previous post.

alubbock commented 3 years ago

Try vidlooper --no-loop --no-autostart /opt/vc/src/hello_pi/hello_video/test.h264, then try starting the video by pressing the button. If it's not working, there's either an issue with your button, or I notice from your screenshot there's an undervoltage warning - you may need a more powerful power supply to get the GPIO pins working.

DerPicknicker commented 3 years ago

So... I try it again...

vidlooper --countdown=5 --no-loop --gpio-pins 26:21 --video-dir /home/pi/

This works... (And also with the buttons...) I copied the test Video into the pi folder...This Video works and also with my buttons... Thank you for your help... I will try to convert my Video ... After that I will reply to you... In the meantime I will test the Splash Image!

DerPicknicker commented 3 years ago

Update:

Bildschirmfoto 2021-05-30 um 20 16 59

EDIT1: I found the Issue.... It is caused by the copying process ... A file with an ._filename was created ... but after deleting this file it works fine.

DerPicknicker commented 3 years ago

So... the Videoplayback works... But the Splashscreen not :( :(

Before it works... Why is it so hard...?

alubbock commented 3 years ago

Is the splash screen image in .jpg format and resized to 1920x1080? Does it display if you run fbi -a yourfile.jpg?

DerPicknicker commented 3 years ago

So I downloaded this Image : https://unsplash.com/photos/tWWCqIMiUmg

I downloaded with the exact Resolution of 1920x1080... I try to use fbi and it can be displayed..

I used this command: sudo fbi -T 2 SPLASH.jpg

Do you have any ideas..?

DerPicknicker commented 3 years ago

So I got some news:

  1. I create an Backup of my system and installed the latest Raspberry Pi OS Lite
  2. I activated ssh and installed everything as described
  3. I mount the USB drive via fstab to /home/pi/USB
  4. rpi-vidlooper starts automatically as you wrote in your blog
  5. This is my current command to start vidlooper: vidlooper --no-autostart --splash /home/pi/USB/SPLASH/SPLASH.jpg --no-loop --countdown=5 --video-dir /home/pi/USB/VIDEO/ --gpio-pins 26:21

The result is that the splash-Screen won’t work anymore.....I try also the 0.4 Version but this also won’t work. Before I tried the 0.4 Version I uninstall the latest version via the command pip3 uninstall rpi-vidlooper...

Any suggestions..? Thank you for your time!

I think this issue is caused by your latest changes... Could you revert these changes..? The Screen is just black...If I pressed the button the video starts playing without any issues... And then a black-screen... Nothing more.

DerPicknicker commented 3 years ago

I found the Issue:

This Version of your Code works without any Problems: https://github.com/alubbock/rpi-vidlooper/tree/846abe1fa8a22c9437bb58106026f32bfad6b3f3

Please check it and you can fix it in the repo..;)

lumotroph commented 3 years ago

Hi there. I'm using this wonderful application in a similar sort of exhibition space - thanks for making your work available, @alubbock !

Having a similar problem to that of @DerPicknicker with the splash image not showing. Any tips there?

lumotroph commented 3 years ago

That said @alubbock I see you're busy on Python Systems Biology (!) that's super cool. I'm splitting my time between RNA-seq data interpretation with DESEQ2 on one computer and this on the other!

Hopefully you can find time for both :)

DerPicknicker commented 3 years ago

I found the Issue:

This Version of your Code works without any Problems: https://github.com/alubbock/rpi-vidlooper/tree/846abe1fa8a22c9437bb58106026f32bfad6b3f3

Please check it and you can fix it in the repo..;)

See my link download this code and replace all files in the installation folder or just clone it and run this version

lumotroph commented 3 years ago

I found the Issue: This Version of your Code works without any Problems: https://github.com/alubbock/rpi-vidlooper/tree/846abe1fa8a22c9437bb58106026f32bfad6b3f3 Please check it and you can fix it in the repo..;)

See my link download this code and replace all files in the installation folder or just clone it and run this version

That doesn't seem to be working for me - i'm also getting the black screen (though I'm using the vidlooper script as-is, not running it as a package)

ghost commented 1 year ago

Hi, i jabe a doubt. If i want to put 5 videos, in wich pins pf the gpio i need to conect? I only know that the video "1.mp4" it's activate with the pin 39 (GPIO26) and the consecutives pins? Thanks a lot! :)

WTGUser commented 6 months ago

I'm having issues getting the gpio pins to play the video. I can play the video if I specify it directly, and I have a splash screen but the 1.mp4 video will not play with a button or directly making contact with the gpio pins. Any help would be greatly appreciated!