I want to play the video of unknown dimensions on the top right corner of my LCD tv without scaling it. I wish --win -0 0 does that.
1 Answer
I can do this with some Python code.
I used 'pygame' to get the screen resolution and the 'OMXPlayer' wrapper to get the video size. Then set video position according to the calculated top right position and size.
python3 topright.py Downloads/SampleVideo_1280x720_10mb.mp4
#!/usr/bin/env python3
import pygame,sys,time
from omxplayer.player import OMXPlayer
pygame.init()
displayInfo = pygame.display.Info()
screenWidth = displayInfo.current_w
screenHeight = displayInfo.current_h
print('Screen:',screenWidth,screenHeight)
player = OMXPlayer(sys.argv[1])
videoWidth = player.width()
videoHeight = player.height()
print('Video:',videoWidth,videoHeight)
player.set_video_pos(screenWidth-videoWidth,0,screenWidth,videoHeight)