Video Looper

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
khannon
 
Posts: 2
Joined: Thu Aug 11, 2011 9:56 pm

Video Looper

Post by khannon »

Hello,

I made a looping media player with my Raspberry Pi 2 using this guide- https://learn.adafruit.com/raspberry-pi-video-looper.

However, I will have it installed in a gallery without network access and would like a way to stop the player and return to the OS with a simple keyboard shortcut. How simple would it be to add this modification?

Thanks.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

If you have access to the command line, you can enter:

Code: Select all

sudo supervisorctl stop video_looper
to shut it down.

If you want something faster, the program that makes the command line work (called 'bash') runs a script located in your home directory named '.profile' every time you log in. You can enter a couple of custom shortcuts by editing ~/.profile and adding:

Code: Select all

alias bye="sudo supervisorctl stop video_looper"
alias go="sudo shutdown -r now"
Then you only have to enter 'bye' to make the RasPi stop looping video, and 'go' to make it reboot.

User avatar
khannon
 
Posts: 2
Joined: Thu Aug 11, 2011 9:56 pm

Re: Video Looper

Post by khannon »

The problem is that I don't have access to the command line, because I can't ssh in without a network or ethernet access. I need to be able to control it only with a wireless keyboard.

I was hoping I could alter one of the python scripts that run the looper or have a simple daemon that checks for a keystroke while the looper runs, then execute the stop command.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

Running a script that watches for input isn't a problem, but making one watch for keyboard input without access to the command line in general is kind of hard.

You could connect an EZ-Link to the RasPi's UART pins and get a Bluetooth connection to the command line. You could also add a wifi dongle and configure the RasPi to act as a hub, which would create a network you could use.

It would probably be easiest to use one of our wireless keyfobs and receivers to control GPIO pins:

https://www.adafruit.com/product/1095
https://www.adafruit.com/products/1096

It's easy to watch and control GPIO pins from a headless process.

One important note there: the receiver's outputs go to 5v and a RasPi's GPIO pins only go up to 3.3v. You'd need to limit the receiver's signals to 3.3v to make them play nicely together. You can do that with a voltage divider, but could also use Zener diodes or blue LEDs.

User avatar
TylerGo
 
Posts: 4
Joined: Thu Sep 08, 2016 3:18 pm

Re: Video Looper

Post by TylerGo »

Hoping that this is the right place to ask for some help. I have a Raspberry Pi Zero W that I am running Video Looper on. I have it connected through a HDMI to VGA adapter to a computer monitor. I have the video files playing and working but have an issue with black bars on either side of the video (top and bottom). I have tried changing the main config.txt for the resolution that I want for the monitor and still have black bars on the top and bottom.

Can I change the video looper config to stretch the video to full screen? (if so where?) or What resolution of video do I need to use to default it?

I have tried playing the video using VLC from windows to the same monitor and it does not show the black bars.

Thanks!

Tyler

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

That would be letterboxing, which is normal when the HDMI screen has different dimensions than the VGA monitor it's been translated to.

The easiest way to change the screen resolution is through `raspi-config`. The Advanced Options -> Resolution screen will let you change the settings.

User avatar
zafirex
 
Posts: 1
Joined: Wed Aug 15, 2018 11:28 am

Re: Video Looper

Post by zafirex »

Hi,

We have two pi with Visio monitors running the pi_video_looper. Recently, one stops playback in the middle of the second video file. I can still use "sudo supervisorctl stop video_looper" and then "sudo supervisorctl start video_looper" to restart playback, but it still seems to hang in the middle of playback about 5 minutes after restarting

Any suggestions? The video files are located on a network share folder.

Thanks for your help.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

It sounds like the data transfer from the networked storage is hanging, or the connection is failing. Try using local copies of the files and see if that helps.

User avatar
etc29
 
Posts: 3
Joined: Sat Jul 13, 2019 1:26 pm

Re: Video Looper

Post by etc29 »

Hi,
I am running a Video Looper project with pi 3B+ / Raspbain 4.19 / Hyperpixel 4" display non-touch, updated and installed the driver of the display. My issue is that the Looper always shows the black bands on the top and the bottom when it's running the video.

I've tried different resolution settings and they all went the same. I do this art project with some different displays and only the Hyperpixel has this issue - although it is a great display.

Can anyone help me with that?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

You'll probably need to re-encode your videos to the same aspect ratio as the display.

User avatar
etc29
 
Posts: 3
Joined: Sat Jul 13, 2019 1:26 pm

Re: Video Looper

Post by etc29 »

Hi,
Thanks for the reply. I've outputted the video into 800*480 to fit the display. I also tried "Scale to Fill" or "Stretch to Fill" two options in Premiere's output setting, which I usually do when I see the black bands on other display, and it works. But seems no difference on the HyperPixel 4".(Photo 1)
DSC_0404.JPG
DSC_0404.JPG (106.55 KiB) Viewed 782 times
I just found that: when I end the Looper, and play the video with VLC player, it only can shows the left half of the picture (photo 2).
DSC_0401.JPG
DSC_0401.JPG (80.85 KiB) Viewed 782 times
But in the full screen mode it is exactly what I want to (photo 3).
DSC_0402.JPG
DSC_0402.JPG (92.71 KiB) Viewed 782 times
How can I make the Video Looper plays the file like VLC's fill screen mode?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Video Looper

Post by adafruit_support_mike »

omxplayer should default to fullscreen mode when playing movies.

Check your /boot/config.txt file to make sure you have the right screen resolution there. If so, you can edit the configuration file to set the window size like so:

Code: Select all

extra_args = --no-osd --audio_fifo 0.01 --video_fifo 0.01 --win '0 0 800 480'

User avatar
etc29
 
Posts: 3
Joined: Sat Jul 13, 2019 1:26 pm

Re: Video Looper

Post by etc29 »

Hi,

I checked the /boot/config.txt , and saw:

Code: Select all

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=912
#framebuffer_height=492
So I changed the number to 800 & 480, and rebooted, nothing changed.
I checked again the config.txt, on the bottom, there are:

Code: Select all

[all]
#dtoverlay=vc4-fkms-v3d
#scaling_kernel=8

dtoverlay=hyperpixel4
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
#framebuffer_width=800
#framebuffer_height=480
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x7f216
display_rotate=3
hdmi_timings=480 0 10 16 59 800 0 15 113 15 0 0 0 60 0 32000000 6
I'm not sure what to change, so I added the " extra_args = --no-osd --audio_fifo 0.01 --video_fifo 0.01 --win '0 0 800 480' " in the end of the config.txt.
After the reboot, nothing happened, so I erased it.

Then I checked the /boot/video_looper , under the # omxplayer configuration follows, there are:

Code: Select all

# Any extra command line arguments to pass to omxplayer.  It is not recommended
# that you change this unless you have a specific need to do so!  The audio and
# video FIFO buffers are kept low to reduce clipping ends of movie at loop.
extra_args = --no-osd --audio_fifo 0.01 --video_fifo 0.01
So I replaced the last line with: extra_args = --no-osd --audio_fifo 0.01 --video_fifo 0.01 --win '0 0 800 480'
Then rebooted, after the countdown, it only shows black screen, so I changed it back.

I'm not sure if I did it correctly because I'm a very beginner in this field with zero experience of coding.
Please let me know if there are other ways I could try, and truly thanks for your patience to help me up.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”