Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi 4 and omxplayer #716

Open
matteoraggi opened this issue Jun 25, 2019 · 13 comments
Open

Raspberry Pi 4 and omxplayer #716

matteoraggi opened this issue Jun 25, 2019 · 13 comments

Comments

@matteoraggi
Copy link

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
Copy link
Owner

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
Copy link

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
Copy link

Hello,

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

Tnx

@matteoraggi
Copy link
Author

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

@popcornmix
Copy link
Owner

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

@matteoraggi
Copy link
Author

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
Copy link

sudo apt-get install parallel
(echo omxplayer --display 7 file.m4v; echo omxplayer --display 2 file.m4v) | parallel
turingmachine/omxplayer-sync#98

@zarss
Copy link

zarss commented Feb 14, 2020

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
Copy link

KenT2 commented Feb 14, 2020

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

@gizmohd
Copy link

gizmohd commented Feb 29, 2020

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
Copy link
Author

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

@armorica
Copy link

armorica commented Mar 9, 2020

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants