2010-02-02, 23:16
hippojay Wrote:Hi,
Nice work, but I'd been having problems getting this to work with ripped BD file structures. It looks like the problem is file name and spaces. I've fixed it by popping a couple of double quotes around the filename:
mkvStart = '"%s" stream file:\"%s\"' %(self.settings.mkvLocation, choice[:-15])
I did that initially as well but ran into issues on my linux machine with that. Will need to investigate before I'll make the change.
Quote:There is also another problem in that sometimes makemkvcon is using the next available port (51001) rather than 51000. This might account for any "hangs" awaiting a stream. Some sort of port detection might help (perhaps utilising the PID of the makemkvcon process - sorry I can't help with any actual code, but I've never looked a python before - so i'd be doing all this through shell commands..)..
EDIT: something like this, but it's real hacky:
PPID = subprocess.Popen('makemkvcon stream file:\"/home/xbmc/data/BluRay/\"', shell=True)
PID = subprocess.Popen('ps --ppid %s' %(PPID.pid) + ' | grep makemkvcon | awk \'{print $1}\'' ,shell=True )
PORT = subprocess.Popen('netstat -alpt | grep %s ' %(PID) + ' | awk \'{print $4}\' | cut -f2 -d:' ,shell=True)
print PORT
as you can see, this is my first python script
I'd like to have a more reliable method for local port detection for sure, but somehow this doesn's seem like 'it' to me at the moment (Also, it's not very crossplatform...). Also, the script should be terminating any running makemkvcon before starting another, so what process is still using that port in your case?