4

I need to open two omxplayer instances in raspberry pi and I'm using following code in python

command1='omxplayer', '--win', '0 0 1920 880', '-o', 'hdmi', '-d', '--layer', '5', 'DD.mp4'
command2='omxplayer', '--win', '0 880 1920 1080', '-o', 'hdmi', '-d', '--layer', '6','CC.mp4'

sp.Popen(command1)

sp.Popen(command2)

currently I'm using two video files and none of them are HD videos. These two commands are working fine when I execute one at a time. But when I execute my python code or when I execute these commands in two ssh connections both videos are frozen. Somehow I need to play two video files in two omxplayers. I can't figure this out please help. If there is a better way to do this please let me know.

Thank you.

sundar nataraj
  • 8,524
  • 2
  • 34
  • 46
Udara
  • 417
  • 1
  • 5
  • 12
  • Have you tried running those two commands in parallel outside of a Python program, directly on the console? Just to rule out that it might be generally impossible to have two `omxplayer` running at the same time. – BlackJack Jul 18 '14 at 10:12
  • Yes I execute both in two different command lines, when I execute the command1 in command line it played nicely but when I execute command2 in other command line (ssh connections, PuTTY) both players frozen. – Udara Jul 18 '14 at 14:21

1 Answers1

0
command1='omxplayer', '--win', '0 0 1920 880', '-o', 'hdmi', '--layer', '5', 'DD.mp4'
command2='omxplayer', '--win', '0 880 1920 1080', '-o', 'hdmi', '--layer', '6','CC.mp4'

sp.Popen(command1)
sp.Popen(command2)

This is the code, the problem was using "-d" as a option in omxplayer.

Udara
  • 417
  • 1
  • 5
  • 12