setting aspect ratio and zoom when launching an url

Requests, suggestions, support, and everything else python / plugin related.
Post Reply
dragonmood
Posts: 11
Joined: Tue Sep 18, 2012 6:18 am

setting aspect ratio and zoom when launching an url

Post by dragonmood »

Hi there
I've developed a little python script to replay the last France24 news, it works but I've got 1 question : is there a way to specify with xbmc.Player the parameter for aspect ratio and zoom?
I've set on "cut the black lines" but strangely it doesn't work well...
is there a way to specify these parameters before launching the video url?
Also I'm not sure how I can test if an url is valid...

Code: Select all

import time
import xbmc, xbmcgui
from datetime import datetime, timedelta
from xbmc import log

now = datetime.now()
t = now 
currentMin= int(t.strftime ('%M'))
if currentMin < 20:
	t = now - timedelta(hours=1)
	currentMin = "30"
	URLFallBackMin = "00"
else:
	if currentMin < 50:
		currentMin ="00"
		URLFallBackMin = "30"
	else:
		currentMin = "30"
		URLFallBackMin = "00"
# some vars
Year = str(t.strftime ('%y'))
Month= str(t.strftime ('%m'))
Day = str(t.strftime ('%d'))
currentHour= str(t.strftime ('%H'))
if len(Day)<2:
	Day="0"+Day

URL="http://medias.france24.com/fr/vod/jt/FRAN" + Year +  Month + Day + "-" + currentHour + currentMin + "-Live.flv"
URLFallBack = "http://medias.france24.com/fr/vod/jt/FRAN" + Year +  Month + Day + "-" + currentHour + URLFallBackMin + "-Live.flv"

listitem = xbmcgui.ListItem('France 24')
listitem.setInfo('video', {'Title': 'France 24 dernier JT', 'Genre': 'News'})
try:
	# xbmc.log ( 'TRYING URL : ' + url , xbmc.LOGDEBUG)
	xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play( URL, listitem )
except:
	# xbmc.log ( 'TRYING URL : ' + URLFallBack , xbmc.LOGDEBUG)
	xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play( URLFallBack, listitem )
pass
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: setting aspect ratio and zoom when launching an url

Post by skatulskijean »

Hi !
I think is better you switch to DVDPlayer!
I think for Mplayer the xbmc.Player.Video.AspectRatio is not working !
But i think you can only get. the AspectRatio with this!

Look here http://forum.xbmc.org/showthread.php?tid=141706

Regards jan

http://ankara.baskent.edu.tr/~obaskin/x ... /xbmc.html

http://passion-xbmc.org/gros_fichiers/X ... hon%20Doc/
dragonmood
Posts: 11
Joined: Tue Sep 18, 2012 6:18 am

Re: setting aspect ratio and zoom when launching an url

Post by dragonmood »

thank you Jan!
I'll try with DVDplayer for the aspect ratio, isn't there a way to specify the zoom even with mplayer? In fact if I would have to choose between the two I would choose the zoom.
Post Reply