magdesign / PocketVJ-CP-v3

PocketVJ 3.x Control Panel
https://www.pocketvj.com
Other
156 stars 33 forks source link

Sync Signal Solution (Audio) #100

Closed mmunderlinegithub closed 2 years ago

mmunderlinegithub commented 3 years ago

Hi everyone!

I am looking for a solution to sync audio and video and am not coming up with any solution. Do you know a solution for the red arrow (attachment). It could be some kind of sync signal (OSC, MIDI, any other protocol) I just don't know exactly what the Pocket VJ accepts or if it does at all.

I'm sure I'm not the only one with this question? (hopefully)

Screenshot 2021-08-04 at 17 03 30

Thanks everyone for helping! MM

magdesign commented 3 years ago

Please explain why would you want to use a Macbook in your installation? I would solve the task like this:

128362230-eb1e9111-f7e1-4b46-a4f1-ed6f89094c21

Edit:

You could of course trigger a startall command over OSC with an OSCtimeline software of your choice where you trigger the PocketVJ's and your Audio player.

Theaters mostly use OSC (with QLAB). e.g. from command line it would be: oscsend 2.0.0.100 9876 /startmaster

Event people do it often via TCP/UDP commands, e.g with curl you would: curl -s http://2.0.0.100/backend.php/?action=startmaster

magdesign commented 3 years ago

However, I will explain how the sync works:

The master/sender player distributes a timecode over the network, it looks something like this 9.65 16

you can achieve this by manually starting the player in verbose mode, e.g.: /usr/bin/omxplayer-sync -muv /media/internal/video/01_Testfile_HD.mp4

Since in the first few seconds the player outputs unreliable numbers, we wait for 5-10s until the whole syncing process starts. The slaves/receivers then validate what timecode they get and where they are, if they are ahead, they go into pause, if they are behind they make a fast forward. We do this with dbus commands. The players sometimes are flickering a bit within a very small timerange, for this we created the SYNC_TOLERANCE entry, which is by default on .05

mmunderlinegithub commented 3 years ago

I'd like to use a macbook because I need ableton playing quadrophonic audio. Could also imagine to use a file playing all four channels from the same file. Is this possible via your solution with a 4th PI playing the four channels? I assume no because the jack out is stereo. So maybe I have to go with MacBook and some kind of OSC. As far as I understand - it works with QLAB right?

magdesign commented 3 years ago

If I get your setup right, you have 3 players, each of them can play two stereo channels, so you could play 6 channels in sync...

PocketVJ supports any application which is able to send OSC commands, so the choice is yours, what about Vézer or OSCulator osr QLAB.

mmunderlinegithub commented 3 years ago

(still thinking about it, coming back to post my solution)

magdesign commented 3 years ago

shout out: any inputs from other users having a similar setup !!?

magdesign commented 3 years ago

check this too: https://github.com/magdesign/PocketVJ-CP-v3/issues/69 https://github.com/magdesign/PocketVJ-CP-v3/issues/5#issuecomment-453174457

btw. since Ableton only supports midi, you could trigger via midi :)

magdesign commented 3 years ago

any news on this?

mmunderlinegithub commented 3 years ago

still on it! gonna send my solution soon.

BjarneJensen commented 3 years ago

I would do as @magdesign suggests, if you don't mind rendering videos with audio. Then use osc/midi if you need to start from your computer. If you need live audio from your computer, send the same osc/midi start signal, but use computer output for audio. 128362230-eb1e9111-f7e1-4b46-a4f1-ed6f89094c21 I am curious if you could send sync from desktop somehow. I'm a bit rusty, but could ofxVideoSync addon work @magdesign?

magdesign commented 3 years ago

@BjarneJensen

ofxVideoSync addon does not work with omxplayer-sync, its quite a long time ago since we wrote the sync script, but I guess you could bind to the socket and send upcounting numbers in milliseconds... but this must be fluent since omxplayer is not able to use any transport protocol and only checks if the time in master and slave are the same...

mmunderlinegithub commented 3 years ago

Hey everyone. I did it just in the simplest way.

I changed my workflow and bounced the four audio channels to two stereo files and added them each to a PI. Thats it. Surely, there are situation this solution dosent works. E.g. if you have live audio or more channels than PIs and so on...

But thanks indeed for the help!

Greetings, MM