popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.02k stars 334 forks source link

Raspberry Pi 4 and omxplayer #716

Open matteoraggi opened 5 years ago

matteoraggi commented 5 years ago

From few days is out raspberry pi 4 with dual hdmi. How can I behave with raspberry pi 4 and omxplayer with dual monitor? Can I launch double omxplayer for these 2 monitors or should I play a big huge video that ids displayed haf on a monitor ans half on the other? and what about aspect ratio? double 4k or what? https://www.raspberrypi.org/blog/raspberry-pi-4-on-sale-now-from-35/

popcornmix commented 5 years ago

omxplayer only supports gpu codecs, so not the new 4K capable HEVC decoder (which has an arm side decoder). So you can't play 4K video with omxplayer.

You can run two copies of omxplayer to play h.264 video on each display.

Librelec has a Pi4 build that supports the 4k hevc decoder. We also hope to have VLC supporting 4K hevc in the future.

walterav1984 commented 5 years ago

You can run two copies of omxplayer to play h.264 video on each display.

Nice that 2 copies of omxplayer is an option.

Would it be possible to sync playback of 2 omxplayer h264 instances for each micro hdmi output(same display/monitor resolution/color depth/clip length)?

For instance to playback lowerthird CGI graphics with KEY+FILL to a video-mixer (Blackmagic Atem). This means one video contains the actual graphical content "FILL" and the second video contains the alpha channel/luma information represented in Black&White called "KEY".

The 4th/last page of the pdf has an example. https://www.renewedvision.com/downloads/tfwm_keying_article.pdf

hansarandjelovac commented 5 years ago

Hello,

Can you please consider creating option for playing strached dual screen video?

Tnx

matteoraggi commented 5 years ago

stretched dual screen video is an option, yes. Which is the max screen resolution that omxplayer support if not 4k?

popcornmix commented 5 years ago

omxplayer can display to a 4K display but can only decode with codecs supported by firmware which are limited to 1920x1080.

matteoraggi commented 5 years ago

ok, so to launch omxplayer contemporarily on 2 different display it is enough to launch this demo: omxplayer file1.mp4 --display 1 | omxplayer file2.mp4 --display 2 But this would be be contemporarily, do you have some suggestions to make these to videos start more close as possible?

zimtzeke commented 4 years ago

sudo apt-get install parallel (echo omxplayer --display 7 file.m4v; echo omxplayer --display 2 file.m4v) | parallel https://github.com/turingmachine/omxplayer-sync/issues/98

zarss commented 4 years ago

ok, so to launch omxplayer contemporarily on 2 different display it is enough to launch this demo: omxplayer file1.mp4 --display 1 | omxplayer file2.mp4 --display 2

Hi. When trying this command, first video is being displayed, but for second video i`m getting "have a nice day ;) ". Which is not so nice at all. Parallel with the same result. How to get two instances running the same time? Thank you.

KenT2 commented 4 years ago

I think display number should be: 0 - touchscreen 2 - HDMI0 7 - HDMI1 but that does not explain why the second command fails!

gizmohd commented 4 years ago

stretched dual screen video is an option, yes. Which is the max screen resolution that omxplayer support if not 4k?

What’s the process to stretch the video across two screens?

matteoraggi commented 4 years ago

omxplayer can play maximum 1920x1080 pixel about the stretch, if possible, you cna evaluate it maybe playing around it parameters..

armorica commented 4 years ago

ok, so to launch omxplayer contemporarily on 2 different display it is enough to launch this demo: omxplayer file1.mp4 --display 1 | omxplayer file2.mp4 --display 2

Hi. When trying this command, first video is being displayed, but for second video i`m getting "have a nice day ;) ". Which is not so nice at all. Parallel with the same result. How to get two instances running the same time? Thank you.

Make sure you've allocated enough memory for video (easily done via raspi-config). I ran into this with 64M video memory. Raising it to 256M solved it.

SandroMiccoli commented 3 years ago

Hey all, I'm trying the same here, but not running straight from the terminal, I'm using omxplayer-wrapper for python, like so:

from omxplayer.player import OMXPlayer

player0 = OMXPlayer('videos/video0.mp4', dbus_name='org.mpris.MediaPlayer2.omxplayer1', args=['--no-osd','--no-keys','-b','--loop','--display=2','-o','local'])
player1 = OMXPlayer('videos/video1.mp4', dbus_name='org.mpris.MediaPlayer2.omxplayer2', args=['--no-osd','--no-keys','-b','--loop','--display=7',])

This is working with different videos playing on each monitor, but my only issue now is the synchrony between these two processes/videos.

Thanks @armorica for the video memory tip, I was having trouble with running two HD videos, after raising it to 256MB it's working fine. :)

I tried what @zimtzeke suggested, installing parallel and running two omxplayer using parallel but that didn't work, only one screen played the video (even after raising GPU memory to 256MB).

Should I use a python library like multiprocessing to run both processes in parallel or are there some settings for omxplayer that could take care of this?