Question

I have ever same problem: i need to show 2 video in the same screen (from command line in unix).

on the web i find a tutorial (http://t3chadd1ct.wordpress.com/2013/04/19/omxplayer/), that solve my problem... using the "screen command"

[...] This was solved easily by making use of the screen function. The example below illustrates how to create a 2×2 matrix [...]

screen
> -dmS camera1 sh -c 'omxplayer --win "0 0 960 540" rtsp://ip_address/live; exec bash' screen -dmS camera2 sh -c
> 'omxplayer --win "960 0 1920 540" rtsp://ip_address/live; exec bash'
> screen -dmS camera3 sh -c 'omxplayer --win "0 540 960 1080"
> rtsp://ip_address/live; exec bash' screen -dmS camera4 sh -c
> 'omxplayer --win "960 540 1920 1080" rtsp://ip_address/live; exec
> bash'

I've follow this tutorial but doesn't work correctly: my script execute only a video (the first one "camera2"):

more tmp01.sh 
#!/bin/sh

#1)this work:
#nohup omxplayer --win "0 0 1440 800" ../Shared/NO_LOGO_1/01.avi &
#nohup omxplayer --win "0 801 1440 900" ../Shared/NO_LOGO_1/02.avi &

#2)doesn't work
screen -dmS camera2 sh -c `omxplayer --win "0 0 200 200" /home/pi/Shared/NO_LOGO
_1/02_a.avi; exec bash`

screen -dmS camera1 sh -c `omxplayer --win "200 200 600 600" /home/pi/Shared/NO_
LOGO_1/01_a.avi; exec bash`

Where am I wrong??? Thank you very much!

Was it helpful?

Solution

You're using the wrong kind of quotes. Use ' instead of the backquote (`). The way you are using it, the screen command won't terminate until the omxplayer's output is complete (i. e. until that terminates.

screen -dmS camera2 sh -c 'omxplayer --win "0 0 200 200" /home/pi/Shared/NO_LOGO_1/02_a.avi; exec bash'

instead of

screen -dmS camera2 sh -c `omxplayer --win "0 0 200 200" /home/pi/Shared/NO_LOGO_1/02_a.avi; exec bash`

See the difference?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top