Raspberry Pi Video Looper Display Installation | Overshare Video Festival

Updated 01 March 2024

Introduction

A suspended ceiling display of forty repurposed screens and displays, each screening crowd-sourced content captured on mobile devices, installed in the entry to Testing Grounds in Melbourne Victoria as part of Overshare Video Festival in October 2023.

Video content for each screen supplied by a dedicated media players installed on a Raspberry Pi 3 Model A+ on permanent loop, using MP4 Museum. The project goal was to create an overhead visual montage of looping content to welcome viewers into the space as an entry display feature.

Video Festival Overview

Overshare was supported through the Melbourne City Revitalization Fund – a $200 million partnership of the Victorian Government and the City of Melbourne. Content for the festival curated by Garden Reflex and Recess with support from 2023 Fringe Festival Park and Testing Grounds at Queen Victoria Market

The festival featured over 30+ hours of content, showcasing shorts, short films, feature films, animations, and experimental content from over 70 creators. A massive festival program of screening events, talks, workshops premiere screenings installations of over 50+ screens, developed and presented with direct support from Testing Grounds in Melbourne, Australia.

Media Playback

As an installation, this was a unique and rather large setup that had to run standalone without easy access for maintenance and startup. A small and stable solution was required for video playback that was cost-effective, compact, and could serve legacy screens with no media playback function. Playback for each screen was driven by Raspberry Pi 3 Model A+ running open source player; MP4 Museum v6.0 by Julius Schmiedel. This is a fantastic looping player with a back-end based on OMXPlayer. OMXPlayer is a command line player which is part of XBMC. It is a video player specifically made for the Raspberry PI's GPU. This proved to be simple to set up and ran on its own with minimal steps.

This player supports auto-start looping so it was perfect for our application. All media was formatted and scaled from various supplied mobile content for display at 1080p as MP4 using H.264. These units were also used for festival content display across a range of displays, screens, projectors, digital signage, and even an external large-format LED wall.

An important side note is that the settings of MP4 Museum require an adjustment of the hardware audio output, otherwise, the audio will pass through HDMI. A guide can be found here on the software website. We did not require sound for the entry installation, however, some projectors did need separate PA systems to connect to which was a simple fix.

Another feature that we didn't use for this work but did consider, is that it is also possible to undertake multi-unit/ screen sync with these players. This can be achieved by networking the players together and setting one unit up as a master to drive sync. For this however, it would be better suited to model 3/4/5 b+ units with Gbe NICs to set up a LAN for inter-unit communication, as the PiA+ only has WIFI.

Media Server & Network

Other than the full week it took to assemble, test, image, and install the media players alone, we had a massive job in collating and converting media to the required codec, container, and resolution for playback, This took several weeks to organize media and sort thru, for which the media server we built was an absolutely essential part of this process.

The server we deployed on-site was a NAS using TrueNAS Scale to host source and manage converted media content for the entire festival inclusive of the entry installation. This was built, mostly from legacy spare parts left over from various other projects, to host an SMB service and allow for automatic backups as media was processed. This system ran on a Core i5 6500U in a SilverStone RM23-502 2U Rackmount Case with 32GB ram hosting a 4TB SSD vdev for project/ active media management and two independent 4TB HDD vdev for twin rolling backups. Only the primary backup was set up with a 500GB SSD for L2 cache for faster archiving.

A standalone 2.5Gbe media network was also set up on-site to connect to the NAS, managed by OpenSense router running on an old Lenovo ThinkCentre M73 with a 2.5Gbe PCIe NIC to manage the LAN. This network was kept offline with media content independently pulled down from the venue network out of hours from carious file shares or ingested from creators via a rotating pair of Samsung 2TB T5 3.2Gen 2 USB-C drives.

For media formatting and transfer for laptops each with Intel i7 8500k, RTX1080 GPU, 32GB RAM, and each with 2.5Gbe connections. These were also used for simultaneous media download, Pi Imager SD card ISO writing, media conversion using Handbrake for content and final transfer to USB drives for playback in the RasPi A+ units. Most parts and software used for this process are listed below and proved invaluable to meet the project deadline.

Software and Hardware

MP4 Museum

TrueNAS Scale

OpenSense

Handbrake

Raspberry Pi Media Players (each unit - 50 units total)

Media Server

  •         1 x SilverStone RM23-502 2U Rackmount Case,
  •         1 x Intel Core i5 6500U CPU
  •         1 x H110M-HDV R3.0 motherboard
  •         2 x 16 GB DDR4 2400Mhz dimms
  •         4 x 1TB Crucial SSD
  •         2 x 500GB SSD Crucial
  •         4 x 4 TB WD Red 5400rpm HDD
  •         1 x PCIe SATA HBA x 4
  •         1 x 2.5Gbe Intel NIC

Network 

  •         1 x Open Sense Router on Lenovo ThinkCentre M73 Intel core i5 4th Gen
  •         1 x 2.5Gbe Switch Qnap QSW-2104-2T
  •         4 x 2.5Gbe Adaptors (for each laptop) STH example of Ugreen NIC

Media Management

  •         4 x Intel i7 8500k laptops, with RTX1080 GPU, 32Gb RAM

MP4 Museum Code

# mp4museum v6 unified - july 2023

# (c) julius schmiedel - http://mp4museum.org

import time, vlc, os, glob
import RPi.GPIO as GPIO
import subprocess

# read audio device config
audiodevice = "0"

if os.path.isfile('/boot/alsa.txt'):
    f = open('/boot/alsa.txt', 'r')
    audiodevice = f.read(1)

# setup GPIO pin
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
GPIO.setup(13, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)

# functions to be called by event listener
# with code to filter interference / static discharges
def buttonPause(channel):
    inputfilter = 0
    for x in range(0,200):
        if GPIO.input(11):
            inputfilter = inputfilter + 1
        time.sleep(.001)
    if (inputfilter > 50):
        player.pause()

def buttonNext(channel):
    inputfilter = 0
    for x in range(0,200):
        if GPIO.input(13):
            inputfilter = inputfilter + 1
        time.sleep(.001)
    if (inputfilter > 50):
        player.stop()

# play media with vlc
def vlc_play(source):
    if("loop." in source):
        vlc_instance = vlc.Instance('--input-repeat=999999999 -q -A alsa --alsa-audio-device hw:' + audiodevice)
    else:
        vlc_instance = vlc.Instance('-q -A alsa --alsa-audio-device hw:'+ audiodevice)
    global player
    player = vlc_instance.media_player_new()
    media = vlc_instance.media_new(source)
    player.set_media(media)
    player.play()
    time.sleep(1)
    current_state = player.get_state()
    while current_state == 3 or current_state == 4:
        time.sleep(.01)
        current_state = player.get_state()
    media.release()
    player.release()

# find a file, and if found, return its path (for sync)
def search_file(file_name):
    # Use glob to find files matching the pattern in both directories
    file_path_media = f'/media/*/{file_name}'
    file_path_boot = f'/boot/{file_name}'
    
    matching_files = glob.glob(file_path_media) + glob.glob(file_path_boot)

    if matching_files:
        # Return the first found file name
        return matching_files[0]

    # Return False if the file is not found
    return False


# *** run player ****


# start player twice to make sure it is working
# seems weird but works
vlc_play("/home/pi/mp4museum-boot.mp4")
vlc_play("/home/pi/mp4museum-boot.mp4")

# please do not remove my logo screen
vlc_play("/home/pi/mp4museum.mp4")

# add event listener which reacts to GPIO signal
GPIO.add_event_detect(11, GPIO.RISING, callback = buttonPause, bouncetime = 234)
GPIO.add_event_detect(13, GPIO.RISING, callback = buttonNext, bouncetime = 1234)

# check for sync mode instructions
enableSync = search_file("sync-leader.txt")
syncFile = search_file("sync.mp4")
if syncFile and enableSync:
    print("Sync Mode LEADER:" + syncFile)
    subprocess.run(["omxplayer-sync", "-u", "-m", syncFile]) 

enableSync = search_file("sync-player.txt")
syncFile = search_file("sync.mp4")
if syncFile and enableSync:
    print("Sync Mode PLAYER:" + syncFile)
    subprocess.run(["omxplayer-sync", "-u", "-l",  syncFile]) 

# the loop
while(1):
    for file in sorted(glob.glob(r'/media/*/*.*')):
        vlc_play(file)

Available under the GPL-3.0 license from Julius Schmiedel

Setup & Installation

The main issue that we came across in the preparation for this installation was the overall power load required to run the displays in the display. For the entry work alone we calculated a total average power draw of 3.93Kw at operating load, inclusive of media players. Because of this, we commissioned a venue upgrade to add additional power and distribute the display load across four separate circuits. We also took advantage of portable RCD units set up across four zones of ten displays each, mainly as a redundant backup to allow for localized possible power spikes. This was in part in case an unanticipated power draw was required for other parts of the festival and also that the startup output was even higher than the general operating wattage overall.

Once this was complete we were able to prepare mountings and lay out the screens to install on rafters in the entry space. This was several weeks of manufacturing brackets for each unit, sourcing hardware, testing, and preparing each screen in advance with its mounting solution 

Installation took place over just under five days, inclusive of testing, playback checks, and cable management with two installers. All the while slowly setting up other parts of the festival with projectors, screens, and displays.

Challenges and Technical Observations

This was a project that took a very large amount of planning, equipment, infrastructure, and power in the design and deployment not just the installation in the foyer but for the whole festival. All of which was mostly undertaken with a two-month lead time, mostly with one technician and a very small budget.

Significant operational and logistics planning was needed to support a wide range of screens, cabling, and provided displays. Some of this was dedicated to research and testing to achieve everything with tight time frames and allocated budget ranges. However, most of the initial work was narrowing down not just effective but efficient solutions to present the sheer volume of footage and how to get it to such a large number of media players.

Planning for this project was as much about the knock-on workflow and considering how much time each step would take in multiples. The whole process involved in assembling 50+ media players, formatting and installing microSD cards, converting footage, and uploading to USB drives is not insignificant. Our major bottleneck was in the end, the relatively slow data transfers of USB 3.1 Gen1 thumb drives. This was one factor we could not change due to our budget restrictions but also sourcing in bulk and delivery lead times.

Overall, this was a massively successful project. The installation in the foyer had positive feedback with return visitation from multiple participants over the festival period. In the end, this was a very well-received installation and entry work that captured the attention of every visitor walking into the space. The Overhare Video Festival at large offered engaging screen activations, films, workshops site activations, and visitation

As an added bonus the fleet of media players will be used in the future at Testing Grounds for other ambitious video projects and can hopefully take advantage of the additional features of the MP4 Museum platform.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.