These adverts are supporting the forum's costs and the products/services are not endorsed by the forum owners.
First have you tried?
Log in to Search the Forum for help!
Learn more about using FreeStyler at the FreeStyler WIKI HERE
Learn more about DMX in General at The DMX Wiki HERE

if all else fails and you need a fixture consider the fixture building service HERE

Update on new Versions and Information

A simple media server using Raspberry Pi and FreeStyler!
Post Reply
User avatar
Bangorscott
Just started using FS
Posts: 13
Joined: October 4th, 2015, 1:55 pm
FreeStyler Version: 4.1.1
I Use FreeStyler for: Stage Show
Location: Northern Ireland
Contact:

Update on new Versions and Information

Post by Bangorscott »

Simple Media Server using a Raspberry Pi driven by WiFI, controlled by FreeStyler DMX using sACN E1.31

Wanting to have the ability to be able to project logos and loops to match lighting scenes without too much expenditure for Charity Events, I opted for a Raspberry Pi, and after a lot of trawling about the internet for help and advice, I came up with the following solution, which I have recently updated.

The Pi acts as a simple Video Media server that can store 254 HD mp4 Video loops.

Due to the nature of the DMX selection channel recalling loops in steps i.e. DMX level 1 calls loop 1, DMX level 2 calls loop2, and as it is the Pi performing the mix, which can be up to several seconds long, this transition needs to complete before a new DMX level is set. Consequently the Pi is not ideally suitable for a Lighting Desk using Faders (keypad entry to a DMX level is ok). The DMX level needs to step as a cut to next DMX selection level, and sequences must be programmed as cuts for the Pi, which is possible in Freestyler . However there is a built in level of protection on DMX select,as the selection interval drops, the mix rate on the Pi is dynamically reduced to a faster mix and then a cut,this is restored to the original value after the selection interval has returned to more than a few seconds

I have built in a layer of protection with a section of the load script which checks running OMXplayer process and closes all not required.

Whilst I have several different versions, the performance of the Pi is limited, and on the dual HDMI output version, the transition are slightly slower. On a Pi4/400 three HD instances can run normally at the same time, if a fourth is started they all show the effect of slowing down playback, to mix on both outputs at the same time requires 4 OMXplayer process.

Consequently I recommend using the Single Mix version for live shows, and the other versions to play around with. The Single Mix Version can also be driven from the DMX Console in the remote OLA web interface from a pc on the same network as the Pi without any DMX software. I have only been able to get an instance of OMXplayer to appear on only a single HDMI output at a time, so have branched into different versions, versions are now named as below

SINGLE HDMI OUTPUT- ON MAIN HDMI OUTPUT ONLY

SINGLE MIX version has 4 DMX channels. Has ability to mix to the new clip, with rate adjustable in 8 steps, from a cut, to a slow mix of several seconds. A Dimmer channel allows overall level control of the clip which is carried through to next clip on mix. There are also control levels that pause, play and double speed the Clip as well as slowing it down.

Alternate versions to try out
SINGLE MIX PLUS version has 7 DMX channels. This version has two Video layers with dimmers on both. The first Video Layer can be zoomed/shrunk to reveal 2nd video layer. The first layer has transport controls. Both layers feature auto mix/cut to next loop. Please note DMX channel 3 needs to be at level 128 for default normal playback size of layer 1 (default setting in Freestyler)

DUAL INDIVIDUAL HDMI OUTPUT for Pi4B/400

DOUBLE MIX VERSION has 4 DMX Channels
This version has two independent Video outputs. Simple DMX select for each of the outputs with mix/cut. Communal Dimmer for both for blackouts. Control channel to set mix rate in 8 steps, from a cut to a slow fade. Pause/resume play for both outputs. Runs on Pi4 1GB.

DOUBLE MIX PLUS VERSION 16 DMX Channels
This version has two independent Video outputs. Both Output channels have Shrink/Zoom, Transport controls and Dimmers. There is also a common static background image, provided by DMX control of Pi Desktop Wallpaper. Both Channels feature auto mix/cut to next loop, with common adjustable rate


OLA allows selection of different input plugins to choose the received DMX input. Consequently, it is also possible to configure this to the Pi’s ethernet for Artnet. I also use a DMX King Micro USB as a DMX input, which when used with a Wireless DMX system allows extended cable free range from the Pi.

I have tested these on both an RPI4 and RPI400, I had to change the GPU memory setting to at least 128MB, but am running with 256MB. I believe the single O/P 4 DMX channel version will run on Pi3B+, the mixes will be slower as they were scaled using the Faster CPU on Pi4.

This project uses OMXplayer which has sadly been depreciated from the latest Bullseye version of Raspberry OS.

I have all versions available as images for download ( less than 2GB), if you would like a copy email me at :
d.lites.uk@gmail.com

I created profiles for each version for Freestyler and have a set off Macros in each.
DMX4dual.png
16DMX.png
DMX4.png
DMX7.png
INFORMATION ON HOW IT WORKS:
Mirroring my second DMX Universe in Freestyler DMX as sACN E1.31 and using a Raspberry Pi4/400 with Raspbian Legacy OS, either connecting via WiFi (or Ethernet using Artnet).
Installing OLA ( Open Lighting Architecture www.openlighting.org ), and using OLA trigger to run various bash scripts. Using modified dbus control scripts for different users: pi, root, back and back1 (dependent on version)(https://github.com/popcornmix/omxplayer ... control.sh ) to adjust running processes of Omxplayer (https://github.com/popcornmix/omxplayer).
OLA Trigger (https://www.openlighting.org/ola/advanc ... x-trigger/) calls bash scripts and saves variables to the tmp directory for use in other scripts.
For each layer two users are used to toggle between instances of OMXplayer, the live user’s OMXplayer is tracked by a variable. On selection of a new clip, the script checks for the existence of the clip, and if it doesn’t exist, exits the script without action. Otherwise a sub script starts an new instance of OMXplayer for the other user. For safety it kills any previous instance for that user, loads it on a layer below the running OMXplayer, sets Alpha and any size variables. It then waits using its dbuscontrol script for the status to change to playing, before returning to main script. There is an intrinsic delay in OMXplayer on loading clips depending on file size, and this method introduces minimum delay so as not to catch OMXplayer background on load.
The mix method depends on dimmer setting. Above DMX level 244 the incoming clip is set to dimmer level, and the original clip, on a layer above it, has its alpha reduced in a series of steps at a rate derived from the rate DMX level setting. When the DMX level is below 244 the incoming OMXplayer’s alpha is set to 1 and then incremented up to Dimmer level, as the outgoing is decremeted down to zero. If the dimmer level is below 128 there is some scaling on the rate to provide more steps to keep the rate about the same. Once the mix/cut has finished the original OMXplayer process is killed, and the new one moved to top layer.
In the dual output version users pi and root OMXplayer are directed to Display=2, and users back and back1 to Display=7 to achieve the two separate HDMI outputs.
As the two instances alpha levels drop towards zero they become transparent, showing the Pi Desktop. On account of this the Pi desktop wallpaper is used as a background. The Pi taskbar is set to autohide, unclutter has been installed to hide the mouse after 2 seconds. On initialisation of the Media Server, xdotool is used to minimise any open windows to taskbar, and set mouse to coordinates 1920,1080 so taskbar hides. Pcmanfm is used to set desktop wallpaper to 0.png (a black graphic), or in the Dual HDMI version under DMX control to select Pi wallpaper. On close of media server wallpaper is set to 255.png ( which is default wallpaper). Graphics are named sequentially 1.png,2.png,3.png etc in the home/pi/Pictures folder
Video clips are named sequentially 1.mp4,2.mp4,3.mp4 etc in the home/pi/Videos folder.This allows selection of 254 HD 1920x1080 mp4 ( H264-AVC) Video Loops.
These can be uploaded via Putty (www.putty.org), a headless operation can be obtained via VNC (www.realvnc.com/).
You do not have the required permissions to view the files attached to this post.
Last edited by Bangorscott on May 9th, 2022, 4:30 pm, edited 1 time in total.


User avatar
djSupport
Hosts the Freestyler Forum and is an Admin!
Posts: 1812
Joined: July 9th, 2007, 6:57 pm
FreeStyler Version: 3.6.49
I Use FreeStyler for: Just for the Fun of it.
Location: Nuneaton, Warwickshire
Contact:

Re: Update on new Versions and Information

Post by djSupport »

I've just remembered, everyone has an ability to edit the FreeStyler wiki, you could perhaps put your advice and guidance there in how to use your app on it's dedicated page, any issues let me know...
Heather Trott, You Babe! I Drive a Dacia Duster and Explore! Check it out
Post Reply

Return to “Raspberry Pi Simple Media server”