5

I would like to synchronize one feed (ie. this super maly fight scene from Puss and Boots...lets assume I have it on disk and in .h264) across 3 raspis (via a network) each connected to one HD monitor for a total of 3 HD monitors. I can easily do this via mplayer as described here and via VLC as described here, but neither of those run on raspi in any useful way as they do not exploit hardware acceleration.

What are my options, either with OMXplayer (Raspbian OS), Raspbmc (Raspbmc OS) or with XBMC (XBMC OS)

puk
  • 695
  • 4
  • 10
  • 27

6 Answers6

2

omxplayer is not as nearly feature rich as mplayer or vlc. I don't believe the synchronization feature is internal to the current version of omxplayer. You may be able to achieve some level of synchronization between different stations with some manual methods as described below:

The current (github) version of omxplayer can be controlled through dbus. (The stock version from raspbian wheezy is an old version without this capability last time when I checked). So one approach might be writing a small program which 1) sits on the network receiving UDP commands from your controling device. then 2) sends appropriate dbus messages to the omxplayer process.

If you just want to do it quick and dirty, you can add your own UDP server thread in omxplayer, inject plain control messages (like KeyConfig::ACTION_PAUSE) directly to OMXControl::getEvent().

In order to sync multiple raspi's in this way, you need to modify omxplayer source code to make the player pause in the verying beginning of the playback. Then your controlling device broadcasts a Pause command which make all omxplayers start to play at the same time. All later commands will be broadcasted to all Raspberry Pi's so they will remain synchronized.

Penghe Geng
  • 361
  • 1
  • 5
  • 10
2

There is a project I seen posted at www.raspberrypi.org that was creating a video wall. The project page is at www.piwall.co.uk. Might be useful, I have not tried it myself.

thewade
  • 23
  • 3
1

I added synchronizing capabilities to omxplayer, you can checkout the repo here. Note this is still in development, however, to the best of my knowledge, it is the only way to get reliable synchronization across multiple raspis.

puk
  • 695
  • 4
  • 10
  • 27
1

Look at https://github.com/turingmachine/omxplayer-sync , it's synchronize multiples pi with unmodified omxplayer, only a python program.

Paco
  • 11
  • 1
0

You could make it easily with Gstreamer and its fully supported. There are precompiled packages on Rasbpian that you can use.

From server, you could stream file with rtp. On clients you can just run simple playbin and that is it. All 3 in the same time.

10robinho
  • 726
  • 8
  • 17
0

I found one potential solution, though it is not perfect. I have a test script up on git hub which tries to launch, in my case 2, threads, which each eventually call omxplayer on two different raspis. The program picks a time in the future to sychronize the launch of omxplayer, ie. (12:00:00 exactly, or 5 seconds from now), then a shell script waits as best it can and then, hopefully, the two raspis launch at the same time. Currently, 90% of the trials launch with less than 100ms difference between the two, however, the audio delay is still noticeable. I take this to mean that either the human ear is extremely sensitive, or launching omxplayer and playing the movie are two different things.

Also, I am assuming that once started, and with smooth playback, the two raspis will play the video at the same exact speed.

If you plan on playing audio from only a single source (ie. a home theater system), this solution should suffice.

Warning:

As is, the code has a bug whereby every 1 in a 100 times it just hangs.

puk
  • 695
  • 4
  • 10
  • 27