Two separate videos played on the two HDMI outputs

I would like to play two separate videos with mpv player on two separate screens.

I’ve chosen the dietpi, since I don’t want a desktop.

With the command:

sudo mpv --vo=drm -fs -loop /home/video/video.mp4

One screen shows successfully one video. But I did not manage to play another one on the other HMDI output.

I tried to set the screens with fbset:

sudo fbset -g 1280 1024 1280 1024 32 -t 0 0 0 0 0 0 0 /dev/fb0

Outputs:

Unknown video mode `/dev/fb0'

The HDMIs go into HDMI to VGA converter. I don’t know, if that is an issue. I see two shells, when no video is playing.

When playing one video over SSH and using the keyboard to play the other video on the other screen, the video says it’s playing, but there are probably two videos playing on the same screen.

2 Likes

I usually do that on my setup using --geometry , which works on X11 and Weston. Not sure it would work on gnome, but you can try.

I have a dual-head, 1920x1080 (x2) left and right, to play video on HDMI-1 i use --geometry=0:0 and to play video on HDMI-2 i use --geometry=1920:0

3 Likes

Thanks! That was probably the best KISS advice I got in 2023 :sweat_smile:

So, I ended up with installing LXDE to still have a desktop that manages my windows. Now I only need to make my nohup work.

As advised, I have HDMI-1 on the left and HDMI-2 on the right.

/usr/bin/mpv -fs -loop --geometry=0:0 /home/user/video.mp4 # plays on the left screen
/usr/bin/mpv -fs -loop ---geometry=1024:0 /home/user/video.mp4 # plays on the right screen

I now try to get it started after boot somehow, but i think, that should not be that difficult. The script I have is now:

#!/bin/bash
# /home/user/startVideo.sh

nohup /usr/bin/mpv -fs -loop --geometry=0:0 /home/user/video.mp4 2>&1 | tee /tmp/video01.log
disown

nohup /usr/bin/mpv -fs -loop --geometry=1024:0 /home/user/video.mp4 2>&1 | tee /tmp/video02.log
disown

exit 0

When I bash startVideo.sh, the video is played on the left. Then when Ctrl + C, the video on the right plays. As said, probably something with an ampersand at the end and it should work…

Thanks again and have a good 2024!