FalconChristmas / fpp

Falcon Player
http://FalconChristmas.com
Other
563 stars 194 forks source link

FPP VLC portrait mode. #1027

Closed bvbek closed 1 year ago

bvbek commented 3 years ago

Problem with video over vlc on HDMI on portrait mode in 4.x and 5.x I like to use content 9:16 on my screens(portrait mode.) After 3.6.2 version when omx was replace to VLC I got problem with contents in portrait mode. In omx we can simple add in "opt/fpp/scripts/omxplayer" (--orientation 90) like this: exec /usr/bin/omxplayer $FLAGS --orientation 90 -b -I -s "$1" 2>&1 And then all is working like charm.

I do not know how to do the same trick in FPP->VLC version. Of course I changed also :" display_rotate=1 " in /boot/config.txt" but it seams VLC have problem in portrait mode generally because picture is resize and is not even in central position. my HW is : RP4

Is any equivalent script who allows me to run binary vlc like was in omxplayer like: opt/fpp/scripts/omxplayer" so I could add some flag to executive command? Is any way to replace vlc to omx player? Thank you for any help/suggestion.

patdelaney commented 3 years ago

Just so I understand... when you said you added the display_rotate=1 " in /boot/config.txt" Did that boor the PI in to portrait mode?

I can probably look at this later but if you google cvlc command line options, I think that there is a way to rotate the playback.

Once we determine if cvlc can play in Portrait mode, I would be in favor or a setting in FPP settings to "Use portrait mode" I'm not sure if we should extend that as flag on a video item in a playlist, I'm not sure if there really is a use case to do Landscape and Portrait in the same playlist.

bvbek commented 3 years ago

Thank you @patdelaney for respond.

Yes Pi was booted in portrait mode. I use this because I try easy way to test this without use flags, options in vlc command line. I try and this doesn't work with VLC so this is no right direction(probably internal vlc problem)

I try in 4.x version command line some options like: cvlc --aspect 19:9 /home/fpp/media/videos/video-16.mp4 cvlc --transform-type 90 /home/fpp/media/videos/video-16.mp4 but no success. I tried manually upgrade vlc in 4.x version but no success. So now I'm trying to in command line manually run vlc/cvlc but I got ERROR: I got this error in 5.0.-alpha

root@FPP:/home/fpp# cvlc /home/fpp/media/videos/video9-16.mp4
VLC media player 4.0.0-dev Otto Chriek (revision 4.0.0-dev-15674-gd2555ffa5d)
[00db6d68] dummy interface: using the dummy interface module... [b5305958] kms vout display error: cannot open /dev/dri/card0 vlc: posix/filesystem.c:115: vlc_close: Assertion `ret == 0 || errno != EBADF' failed.
Aborted

My file,video is created directly by macro in powerpoint. This is portrait format 9:16 -> 1080x1920 by default. Sure I probably could convert this file to standard 16:9 in some software and then play portrait like landscape but this is little lame especially if we can use some extra flag in running script.

In 5.0-alpha I also installed manually once again omxplayer and run from command line: omxplayer /home/fpp/media/videos/video.mp4 --orientation 90 and it is works like charm. God orientation,speed stable just perfect. Only problem is how to tell fpp to use by default for media/video once again /opt/fpp/scripts/omxplayer. Is any easy way?

dkulp commented 3 years ago

No way to use omxplayer...

To use cvlc from the command line, you likely need to add one of:

--vout mmal_vout

or

--vout fb --no-fb-tty --no-hw-dec

or

--vout mmal_vout --no-hw-dec

mmal is the hardware decoder and direct output. That should work the "best" but is the least configurable. fb is the framebuffer output. To use it, you MAY need to uncomment the "dtoverlay=vc4-fkms-v3d" line in /boot/config.txt . However, if you do that, you will need to turn on the software scaling for any VirtualMatrix you may have. The --no-hw-dec uses the software decoder. That can go to either the fb output or fed into the mmal output routines. It's still software decoding though.

Other command line flag that might work:

:vout-filter=transform --transform-type=270 --video-filter "transform{true}"

That should enable the rotation, but I BELIEVE it only works with the software decoder (and thus needs the --no-hw-dec)

bvbek commented 3 years ago

@dkulp cool examples. cvlc in 5.x require this to work(--vout mmal_vout ). You save me a lot of troubleshooting. I tested all day VLC on RPI. I think any filter in VLC will turn off HW acceleration like you said, so in my case 1080p will generate a lots of CPU so is no point go this way.

I decide to create 4K video over PowerPoint->macro->9:16 and then using 3rd video converter software rotate for 90 or 270 degree and then compress to mp4,1080p in then same time. Now I got excellent sharp picture in VLC without any extra steps using HW-acceleration. I think I should go this way in first place. Anyway I learn a lot about Falcone player and this was not completely lost of time. Thank you guys for help, suggestion and showing me direction.

I got last question/request. Do is any way to remove this black screen between playback in VLC. Is no matter I repeat one playlist or use --loop in command line with cvlc to loop one video. I always got this black flash (les like one second) between clips. If clip/movie got few minutes then this is no problem but if clip got 20 second then this black flash is pretty annoying(every 20 secound). Thank you guys: @dkulp,@patdelaney for suggestion. BTW FPP is excellent peace of great work.

patdelaney commented 3 years ago

@bvbek - I'm curious what you are actually doing with PowerPoint->macro->9:16 and then how does all that relate to your display unless you are doing some sort of digital signage.

@bvbek Can you share your final configuration and settings?

@dkulp Based on what @bvbek sends us, is there a way to add a Setting in FPP "Use Portrait mode"?

bvbek commented 3 years ago

@patdelaney yes indeed. Good hit. For two years I successfully use Yodeck signage for RP4(first MONITOR is for free, fully cloud solution). Picture quality is good but now using FPP picture is even better. I think yodeck itself use some transcoding plus rotate inside cloud and then send compressed file to RP4. Now using this player I can fully use 30MB/s H.264 quality video and picture look extremally good. After testing yesterday do not see reason why go for 4K for now. Only this black flash between clips is very annoying.
I thinking for change to this solution especially because I want also start run some light show for this year(yes I'm green in FPP). When I saw FPP start using Philips Kinect output protocol then definitely I have to switch for this solution.

@patdelaney "config/settings" what are you are exactly mean?

I believe "Portrait mode" for RP4 in VLC will have sense only when developers VLC will be support rotating including HW-decoding mode. Using filtering(no hw decoding support) for 1080P do not have much sense in RP4 for now.
I think for now only option is add omxplayer and using this player only for portrait mode because he use HW-decoding for that.

Littleaton commented 2 years ago

i would love to just be able to rotate a video whenplaying using fpp. example: atmosfx vertical videos are rotated. o need to rotate them 90 deg go play them via a projector.

darylc commented 1 year ago

@eatonaaron see comment from dkulp above