turingmachine / omxplayer-sync

OMXPlayer-Sync facilitates synchronization of multiple OMXPlayer instances over the network in a master/slave fashion.
194 stars 70 forks source link

How to synchronize different individual videos on slaves? #28

Closed OMID-313 closed 9 years ago

OMID-313 commented 9 years ago

Hi,

I want to use 4 raspberry pi 2.0 boards to play 4 different videos via HDMI cables onto 4 TVs, which are NOT placed besides each other, and are NOT video walls.

All I want is to play these individual videos in perfect synchronous mode. Also, I want to use a master RPi to control these slave boards, and send some optional commands, like play, pause, next, previous, shut down, etc. (By using omxd probably.) Besides, I want the whole system to start to play a group of videos in a directory, automatically after boot, and in an infinite loop.

Would you please help me how I can implement such system? How should I use the omxplayer-sync codes to be useful for this purpose? Are there any other solutions you would suggest for such a system?

Your time and support would be highly appreciated.

magdesign commented 9 years ago

All videos must have the same name (content doesn't matter, but length and bitrate must be the same). Use a router/hub/switch to connect all RPis via RJ45 together, make one master, all other slaves.

An other solution for such a system is to use 4x PocketVJ (http://www.pocketvj.com) where you have everything set for your needs.

OMID-313 commented 9 years ago

Thanks @magdesign for your reply.

Ok, after setting identical names, length, and bitrates for all the videos, and also connecting the Pis via a network switch, what else should I do !?

If I write

omxplayer-sync -muv movie1.mp4 movie2.mp4 /movies/*

on the master, and

omxplayer-sync -luv movie1.mp4 movie2.mp4 /movies/*

on the slave, what does exactly happen!? How do they get synced?

Which one should I execute first? The master's code? Or the slave's !!?

Do we store all the videos on the master? Or each RPi has its own video files in its own local storage?

(I'm really sorry; but I'm a beginner and I might ask silly questions. I read the readme file, but didn't quite understand!)

magdesign commented 9 years ago

for the master: omxplayer-sync -mu /location/of/the_movie.mp4 for the slave: omxplayer-sync -lu /location/of/the_movie.mp4

each player has its own file, it only shares the timecode thru the network

OMID-313 commented 9 years ago

Thanks again @magdesign for your reply.

A few more questions, if you don't mind:

  1. Which code must be executed first? The master's code or the slave's !!?
  2. Is it possible to use the omxplayer's standard controls, like p for pause/resume, q for exit, or even DBUS ccommands? If yes, how should we use them? omxplayer -n or omxplayer-sync -n !?
  3. Can I still use omxd ( https://github.com/subogero/omxd a playlist daemon for omxplayer) with omxplayer-sync?

Thanks again for your time and support.

turingmachine commented 9 years ago
  1. It doesn't matter.
  2. Unfortunately the standard keyboard controls are not available. But you could use DBUS-Commands on the master though. The only useful command i can think of is to quit omxplayer. This would force omxplayer-sync to play the next playlist item.
  3. It's not possible to use omxd with omxplayer-sync, because omxd forks it's own instance of omxplayer, and thus omxplayer-sync would be unable to read the current time.

Just supply multiple files to omxplayer-sync, this way all supplied files are played in sequence. The corresponding files must have the same name on each player.

omxplayer-sync file1.mkv file2.mkv *.mkv *
OMID-313 commented 9 years ago

Thank you very much @turingmachine for your helpful reply.

A few more questions:

  1. As I understood, the omxplayer-sync doesn't need a separate master RPi. I mean if we have 4 displays, we can use 4 RPis (1 master + 3 slave). Is this correct !?
  2. Does omxplayer-sync loop the videos automatically !?
  3. How long is the gap between the videos !?
  4. If I want the RPis to start playing videos automatically after boot, can I add the above codes to /etc/rc.local both in master and slave !? Would this work !?

Thanks again for your great support.

turingmachine commented 9 years ago

I suppose you just give it a try. This way you can answer your questions most likely yourself. The answer to all your questions is yes and for 3. it is about 500ms.

OMID-313 commented 9 years ago

Thanks again @turingmachine for your quick reply.

I'll try all these as soon as I get my RPi, and will post the results here.

Thanks a lot for your support.

bjente commented 3 years ago

Hello, I have a question. It might be a quite stupid question but HOW do I upload new videos to the pi's?

hitesh83 commented 3 years ago

Hello, I have a question. It might be a quite stupid question but HOW do I upload new videos to the pi's?

This is not the scope of omxplayer-sync, for this you need to do it your self , you might setup script to look for new content on your network drive via rsync, also might go more sophisticated and build entire client - server so send files etc..

or you can also checkout pocketVJ project .