2013-02-28, 19:12
ok so if i run
nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null & sh play /media/LARGEFILES/dvd.mpg
where play script is
curl -g localhost:8080/jsonrpc?request=\{\"jsonrpc\":\"2.0\",\"method\":\"Player.Open\",\"params\":\{\"item\":\{\"file\":\"$1\"\}\},\"id\":\"1\"\}
from terminal it works perfectly...but if i copy the curl command in play and try to run it directly it doesnt work from terminal...
exact same command as in my play "script"...
[1] 2082
{"error":{"code":-32602,"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}curl: (3) <url> malformed
if i want to run
python default.py
from terminal it works only if i have it setup like this
root@raspbmc:/home/pi/.xbmc/addons/script.PlayDVD# cat default.py
import os
os.system('nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')
and this will play if i click on the addon 2x, which means there are 2 rips going at the same time...so not good
error:
so somewhere there is a disconnect between the xbmc and the play command...
i tried this, and played it from the xbmc screen
import os
os.system('mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
import xbmc,xbmcgui
class Main:
def __init__(self):
playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
playlist.clear()
playlist.add('/media/LARGEFILES/dvd.mpg')
xbmc.Player().play( playlist)
m = Main()
success...
it will play if, and only if...
i have the play curl in there 2x, the sleep 10 or sleep 30 or sleep 45 never worked...
import os
os.system('nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')
nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null & sh play /media/LARGEFILES/dvd.mpg
where play script is
curl -g localhost:8080/jsonrpc?request=\{\"jsonrpc\":\"2.0\",\"method\":\"Player.Open\",\"params\":\{\"item\":\{\"file\":\"$1\"\}\},\"id\":\"1\"\}
from terminal it works perfectly...but if i copy the curl command in play and try to run it directly it doesnt work from terminal...
exact same command as in my play "script"...
[1] 2082
{"error":{"code":-32602,"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}curl: (3) <url> malformed
if i want to run
python default.py
from terminal it works only if i have it setup like this
root@raspbmc:/home/pi/.xbmc/addons/script.PlayDVD# cat default.py
import os
os.system('nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')
and this will play if i click on the addon 2x, which means there are 2 rips going at the same time...so not good
error:
so somewhere there is a disconnect between the xbmc and the play command...
i tried this, and played it from the xbmc screen
import os
os.system('mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
import xbmc,xbmcgui
class Main:
def __init__(self):
playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
playlist.clear()
playlist.add('/media/LARGEFILES/dvd.mpg')
xbmc.Player().play( playlist)
m = Main()
success...
it will play if, and only if...
i have the play curl in there 2x, the sleep 10 or sleep 30 or sleep 45 never worked...
import os
os.system('nohup mplayer dvd://1 -dumpstream -dumpfile /media/LARGEFILES/dvd.mpg 1>/dev/null 2>/dev/null </dev/null &')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')
os.system('/home/pi/.xbmc/addons/script.PlayDVD/play /media/LARGEFILES/dvd.mpg')