5

I have a minimum install of Ubuntu and I'm using mplayer or mpv to play mp4 files to fbdev2 or drm in mplayer or mpv respectively.

I have two monitors connected to the PC - 1 in HDMI and 1 in DP1. When I play with mpv, the content only shows on one screen. When I play with mplayer, the same content is mirrored to both screens.

Ideally I would like to simultaneously play different mp4 files (short 10-30 second) on different monitors - in a digital signage fashion.

Do I need to add a second framebuffer?

Current mplayer command I'm running, from CLI, is:

mplayer -vo fbdev2 rotate=1 -fs -nosound -loop 0 /data/narwhals.mp4

NB: I have tried adding -display :0.x where x is 0-1 to no avail.

Current mpv command I'm running, from CLI, is:

mpv -vo=drm -fs-screen=1 /data/narwhals.mp4 --video-rotate=180 --no-audio

NB: I have tried adding --screen=x where x is 0-1 to no avail.

Any guidance here would be much appreciated.

below is xrandr output from terminal in startxfce4. Via ssh or on console xrandr reports "Can't open display"

Screen 0: minimum 8 x 8, current 1920 x 1848, maximum 32767 x 32767
DP1 connected 1920x1080+0+768 (normal left inverted right x axis y axis) 600mm x 340mm
   1920x1080     60.00*+  50.00    59.94
   1920x1080i    60.00    59.94
   1680x1050     59.88
   1400x1050     59.95
   1600x900      60.00
   1280x1024     60.02
   1440x900      59.90
   1280x800      59.91
   1152x864      59.97
   1280x720      60.00    50.00    59.94
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       60.00    59.94
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 connected primary 1360x768+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
   1360x768      60.02*+
   1920x1080     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1920x1080i    60.00    50.00    59.94
   1152x864      59.97
   1280x720      60.00    50.00    59.94
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x576i      50.00
   720x480       60.00    59.94
   640x480       60.00    59.94
   720x400       70.08
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
marc
  • 2,427
  • What shows xrandr --query? This may not work if you are using NVIDIA or ATI drivers... – marc Jan 17 '17 at 09:46
  • xrandr from putty/CLI says it can't find the display. From the console it shows a list of resolutions and the two displays. Video is on-board Intel. – user158798 Jan 17 '17 at 11:22
  • should I be seeing Screen 1 ? from above it looks like Screen 0 is the combined resolution of monitor 1 and 2? – user158798 Jan 18 '17 at 00:24
  • You have DP1 (Display Port 1) & HDMI3 connected. So far so good for your dual displays. You can still tweek mode, resolution, position etc. with xrandr. Have you tried to execute it via setting the environment variable DISPLAY=:0 mvp...? – marc Jan 18 '17 at 09:59

1 Answers1

5

For a cleanest/nicest solution you will need a second framebuffer device, which would require another graphics card. But there's another hacky way to achieve what you want with just one card.

You can list all cards and connectors (monitors) available with:
$ mpv --drm-connector help

Then you can choose which card (0 or 1) and connector to use as an output to play two videos at the same time on two monitors:
$ mpv --vo drm --drm-connector 0.HDMI-A-1 movie_1.mp4 &
$ mpv --vo drm --drm-connector 1.DP-1 movie_2.mp4

When mpv plays video on one card it blocks the connector and the card, so running another instance of mpv on the same card will result in 'access denied' error.

But, surprisingly, you can run mplayer at the same time when mpv is running. mpv blocks one output and mplayer uses another one that's still available.

So if you have just one card you can do this (a hacky solution):
$ mpv --vo drm --drm-connector HDMI-A-1 movie_1.mp4 &
$ mplayer -vo fbdev2 movie_2.mp4

All of the above works with mpv 0.29.0 on Parabola GNU/Linux-libre.

On Ubuntu you might get different options, like --connector instead of --drm-connector. Consult your manpage looking for 'drm':
$ man mpv.

h1x
  • 51