Kodi Community Forum

Full Version: XBMC External Player Launcher - v1.0.0.3 release - Support for non ISO files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
XBMCExtPlayerLauncher

UPDATE: 1.0.0.3 release - Now supports both ISO and NON ISO files

Get it here: https://googledrive.com/host/0B9N9faZA-S...dXeFVBam8/

Unzip the 2 files to any folder. Just keep the config file with the exe.

Requires .NET 4.5

This is a new little application for Windows that I've written specifically to deal with:

1. Path substitutions in Windows so that when XBMC passes out a non Windows compliant path it can be automatically modified to be a path that Windows can understand using pairs of string substitutions that you supply.

2. Unmounting an ISO

3. Mounting an ISO

4. Launching the External Player you want to use to play your BD ISO.

5. Launching the External Player to play NON ISO files (I use this to play 3D MKV movies that are NOT SBS or OU and are ripped as MVC 3D MKVs with MakeMKV)


It takes 1 input parameter which is a fully qualified path (including file name) to the ISO file you want to mount and play.


If you use this application as the middle man it is not necessary to involve any other batch files etc. in the process. All you need to do is setup the "playercorefactory.xml" file correctly and make that point at this application.

See here: http://forum.xbmc.org/showthread.php?tid=176746

Everything this application does is configurable via the config file supplied with the exe file.

In the config file you will find the following settings:

Code:
<XBMCExtPlayerLauncher.Properties.Settings>
            <setting name="ISOUnmountCmd" serializeAs="String">
                <value>C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\vcdmount.exe</value>
            </setting>
            <setting name="ISOMountCmd" serializeAs="String">
                <value>C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\vcdmount.exe</value>
            </setting>
            <setting name="VirtualDriveLetter" serializeAs="String">
                <value>G:</value>
            </setting>
            <setting name="PathSubstitutions" serializeAs="String">
                <value>nfs://192.168.1.100/mnt/user|//unraid</value>
            </setting>
            <setting name="ISOUnmountParams" serializeAs="String">
                <value>/u</value>
            </setting>
            <setting name="ISOMountParams" serializeAs="String">
                <value />
            </setting>
            <setting name="DelayAfterUnmount" serializeAs="String">
                <value>2</value>
            </setting>
            <setting name="DelayAfterMount" serializeAs="String">
                <value>2</value>
            </setting>
            <setting name="HandleISOMount" serializeAs="String">
                <value>False</value>
            </setting>
          <setting name="ExtPlayerRunCmd" serializeAs="String">
                <value>C:\Program Files (x86)\Stereoscopic Player\StereoPlayer.exe</value>
            </setting>
            <setting name="ExtPlayerParams" serializeAs="String">
                <value>-fsu</value>
            </setting>
            <setting name="DebugMode" serializeAs="String">
                <value>True</value>
            </setting>
     </XBMCExtPlayerLauncher.Properties.Settings>

ISOUnmountCmd and ISOMountCmd

These will probably be the same executable but there is a chance they might not be so I made these 2 separate settings. This is literally a path to the executable to run to mount and unmount ISO files.

The idea is to first unmount any ISO currently mounted on the virtual drive letter you are using for your ISO mounts and then mount the ISO file that you want to play on that same drive letter.

ISOUnmountParams and ISOMountParams

These are the command line parameters, if any, that you want to pass to the executables you've defined in ISOUnmountCmd and ISOMountCmd.

These command line parameters should NOT include the path to the ISO in the case of the ISOMountParams. That will be added as an additional command line parameter automatically.

VirtualDriveLetter

The drive letter that you have allocated to your Virtual Drive software. This must be the drive letter you will be mounting your ISOs on.

It will be passed to your External Player.

ExtPlayerRunCmd

This is the path to the executable of the External Player to be used to play the BD ISO you have mounted.

ExtPlayerParams

Any command line parameters you want to pass to your External Player NOT INCLUDING the drive letter of the virtual drive you are mounting the ISO file on because that will be added as an additional command line parameter automatically.

DelayAfterUnmount and DelayAfterMount

The amount of time, in seconds, that you want the app to wait after unmounting and mounting an ISO file.

This is configurable because it may be necessary to wait longer on certain machines due to performance issues etc.

PathSubstitutions

This is particularly useful and allows you to reformat the path to the ISO file that XBMC passes this application so that non Windows compliant paths can be converted to Windows complaint paths for you automatically.

This setting is a comma delimited string of path substitution pairs that are themselves separated by a pipe " | " character.

Example:

XBMC passes in the following NFS format path:

nfs://192.168.1.100/mnt/user/movies/ISO files/mymovie.iso

That is a Linux standard path and Windows does not recognise that.

For Windows to understand it, it must change to something like this:

//192.168.1.100/movies/ISO files/mymovie.iso

or

//myservername/movies/ISO files/mymovie.iso


To get that substitution to happen automatically we supply a substitution pair as follows:

nfs://192.168.1.100/mnt/user|//myservername

You can supply as many pairs as you like, comma separated. The first pair matched will be used and matching will not continue after a match occurs.

NOTE: You MUST have your media shared via an NFS share AND an equivalent SMB share for these substitutions to work. This app cannot magically find files over a network via SMB if you haven't shared them on an SMB share already. All this app does is convert an NFS network path to an SMB network path on-the-fly based on what you tell it to substitute for what and ASSUMING that the path prefixes you stipulate are already valid shares on your network.

DebugMode

Simply set this to "True" if you want the dos command window to stay open and wait for a key press after the app has finished doing it's work so that you can read the output it writes to the console window.

HandleISOMount

This is a new setting in v1.0.0.3.

This setting allows you to explicitly disable mounting and unmounting of ISO files. This may be required if you do NOT want this app to try and mount an ISO file passed to it and rather want it to just pass the path to the file on to the External Player you have specified because the External Player is capable of automatically mounting any ISO you point it at itself.

The app will check the extension of any file passed to it to see if it is an ISO and will only evaluate this setting if the file that has been passed in IS an ISO file, otherwise this setting is ignored.

-----------------------------------------------------

And that's it. If you are at all familiar with External Players and XBMC this should all make perfect sense and if you aren't this should be pretty easy to understand.

I've made it as configurable as possible and I've tested it my side and it seems to work well.

As always, feedback and input welcomed.
I am using XBMC 12.0 (as people here said 12.2 does not work). and TMT6.5 on windows 8.1.

When selecting an iso or bdmv folder tmt starts up fine and plays the movie with DTS, Dolby etc. But when i close TMT and it switches back to XBMC the sound switches to Cinema PLII and not Stereo ( i see this on my denon x4000 display), When i select an MKV it does not switch audio anymore and XBMC crashes. I am using direct sound via HDMI.

any ideas?
Did you try WASAPI?
I am using W7 with haneWIN NFS Server http://doc.hanewin.net/nfs/nfsd.htm
The XBMC internal DVD player does play these NFS .iso's shared to client pc's. I shared via NFS within the XBMC file path setup.
XBMC does not play 3D iso's so I have a need for an external player now.
Using the method here, TMT6 opens but Virtual CloneDrive does not mount anything.
I have tried various paths with no success and am hoping someone can help me.
I understand this was created for Linux to Windows and I assume haneWIN to Windows is similar.
Fwiw, changing true and false in the debug line did not leave the CMD prompt open. It just flashes open and closes.

I assume this is what needs to be configured <value>nfs://192.168.1.100/mnt/user|//unraid</value>

192.168.1.2 and my W7 pc name is SERVER
@brazen1: You are correct about what you need to configure ie. The substitution pairs.

The thing is, the SAME media MUST be accessible via both an SMB share AND an NFS share at the same time.

That's because any normal Windows app cannot resolve an NFS path so it needs an SMB path instead.

I designed my app to allow you to specify an SMB prefix to replace the EQUIVALENT NFS prefix for your particular network shares.

Where I have "//unraid", you need to figure out what YOUR specific SMB prefix is for your network. It could be something like "//MyMediaServer/Media" as a random example.

It all depends on what you've shared your media as in terms of SMB shares.

If your media is ONLY shared on NFS shares, there is nothing my app can do to help you, it needs an equivalent SMB network path to do the on-the-fly conversion for you.

I will take a look at why the debug switch isn't working as intended, thanks for the feedback on that.
I need to continue to WiFi stream NFS. SMB does not have the throughput for the client pc's reading large iso's. If I leave XBMC configured for NFS only, and I SMB share my data so that Virtual CloneDrive can read it on client pc's, would that mean the client pc's would stream it in SMB and/or NFS? If I'm pointing everything to SMB shares, could NFS shares still take precedence since haneWIN would still be actively sharing NFS?

"specify an SMB prefix to replace the EQUIVALENT NFS prefix". I don't understand if this means your code would be giving the NFS shares a way into a Windows machine via a SMB protocol at the same throughput or if NFS gets downsized into a SMB bottleneck? I just read your original thread again. It says you're sharing NFS and reading it on W7 . How are you able to launch VCD? Did you have to change your NAS to share NFS and SMB at the same time? Sorry for the confusion. Please provide an example of coma separated pairs. I don't know anything about string substitutions. I just need VCD to mount at NFS throughput and if tricking it into mounting by providing a SMB path for it is the answer, this code of yours will be very beneficial to many of the enthusiasts. Thank you for your contribution and your input.
@brazen1:

1. Windows does not natively support NFS, hence the need for HaneWIN. XBMC has built-in support for NFS and works around that.

2. As I understand it, HANEWin is an NFS server, but that does not help your situation if your CLIENT is a Windows box, because your Windows client STILL will not be able to access those NFS shares.

From what I understand, HANEWin allows Linux type clients to access files on a Windows box using NFS.

It does NOT, however, allow Windows clients to access NFS shares on a server sharing files via NFS. And therein lies your problem.


3. If you have setup XBMC, on a Windows CLIENT (HTPC running Windows 7 for eg), and you have imported all your media into your XBMC library via NFS shares, you then have a situation where XBMC is
happy because it has built-in support for NFS (it IS effectively an NFS compliant client regardless of what Windows does or does not support).

BUT, any other Windows media player will NOT be able to interpret those NFS paths properly (unless they too have an NFS client built into them internally).

I'm not aware of anything that you can install that will make Windows, as a whole, support NFS network paths, where the Windows box in question is a CLIENT.

It comes down to each Windows app internally supporting NFS shares or not. And most do NOT.

4. Given points 1 to 3 above, I wrote my app to convert NFS paths into SMB paths on-the-fly to get around the problem described.

You WOULD need to stream via SMB to solve your current problems. If you mount the ISO via SMB, it will stream via SMB, it will NOT magically stream via NFS.

You would need an ISO mounter application that has an NFS client built into it to get around that problem.


In my case, my NAS is a Linux based unRAID server and everything is shared both via NFS and SMB, always.

In addition, everything I stream is over wired LAN only and it is pretty much irrelevant to me if the streaming is via NFS or SMB, but I prefer NFS anyway.

In your case, with WiFi streaming, you do have some unique problems if you cannot get the performance you need via SMB.

The only 3 ways I can see out of your current predicament:

1. Switch to streaming via cabled connection. I understand it simply may not be possible for you, but needs to be stated regardless.

2. Find software that you can install on a Windows box that will make the entire Windows OS support NFS shares natively. SOLUTION FURTHER DOWN.

3. Switch to Linux on your client machine (HTPC). If you did that you would get NFS support at OS level and in theory ANY app you run on that Linux box would automatically work with NFS shares.

This would not be an option for me because I find Linux incredibly frustrating for client applications, I only use it for servers personally, but that's just me.


Unfortunately there is no magic bullet for your problem. If you are working in Windows environment where everything is Windows including your clients, and using HaneWIN to give yourself that ability to serve up media via NFS, you are actually creating problems for yourself outside of something like XBMC that supports those NFS shares internally.

The bottom line is that the vast majority of Windows apps will NOT understand an NFS share, and if XBMC is looking at NFS shares it is going to pass NFS paths to any External Player it launches on a Windows client, which is then going to completely confuse that External Player if it does not also have an NFS client built-in.

@brazen1:

A quick Google as come up with some NFS client options for Windows clients that look promising:

http://sourceforge.net/projects/ms-nfs41-client/

http://labf.com/nfsaxe/

http://connectivity.opentext.com/product...ients.aspx

I don't know anything about those, but they both look like they are application independent, driver level, network clients that would make your ENTIRE Windows client PC support NFS shares.

If that's the case, those are the kinds of things that would solve YOUR specific problem, because they would completely eliminate the need for any path conversion and in theory ANY Windows application would be able to correctly parse an NFS share with one of those things installed.

HANEWin is your SERVER solution.

Something like those listed above would be your CLIENT solution.

And to re-iterate, XBMC doesn't care either way because it has a built-in NFS client and doesn't need any help accessing NFS shares regardless.

------------

It also looks like there is a Microsoft supplied NFS client available that you can install:

http://technet.microsoft.com/en-us/libra...32036.aspx

http://technet.microsoft.com/en-us/libra...32891.aspx

Looks like it may be VERY easy to enable this in Windows 7:

SOLUTION

The Windows 7 operating system can provide an NFS client, but the NFS client service is disabled by default, and must be enabled for access to NFS exports from the IBM SONAS system.

Enabling the NFS client on a Windows 7 system:
Select Control Panel.
Select Programs.
Select Programs and Features.
Select Turn Windows Features on or off.
Select Services for NFS.
Select the check box Client for NFS and click OK.

THAT WORKS !

But it's not quite so straight forward.

After you've installed the Windows 7 NFS client, you need to mount an NFS share as a drive letter in Windows.

To do that, you simply drop to a command prompt from windows and type something like this:

mount \\192.168.1.100\mnt\user\movies m:

The "m" drive will then be mapped to that share and Windows will be able to access that NFS share as an NFS share by referring to m:

My app is still potentially required because if you've already built your XBMC library WITHOUT using a drive letter mount like that, you will still need my app to do path subtitution on the path that XBMC hands off to External Players to substitute the prefix of the path with the drive letter you've mounted that share on.

If you really want to make your life simple, you would first mount your NFS shares on drive letters on a client machine, THEN import all your media into the XBMC library and build the library using those drive letters instead of the fully qualified NFS paths, and then XBMC will hand off perfectly working network paths to any External Player it calls as long as the client machine running XBMC has the shares mounted on those SAME drive letters.

It's up to you how you solve it.

Bottom line: There is a fix for your problem and it only takes about 5 minutes to implement either way. I just did it myself with no prior knowledge !
1st.... thank you so much for your precise reply. Your details are outstanding and very helpful. I'm hours into trying and frustrated. Endless searches trying various things including your input have yielded slim results for me. It appears to be very easy for others to mount drive letters to NFS shares on a client running windows and I don't know why I can't? I've tried more things than I can count and hoping you won't abandon me. I already had enabled nfs client in windows features on the client. Let me share a little of what I'm doing and perhaps I'm missing something obvious:

Most of the paths I enter produce Network Error - 53. Searching shows many questioning it but no answers that worked. I tried a couple dword reg edits with no results.

This path, amongst a few others, produces this without an error but, when I go to explorer or network I don't see any folders added. I assume that command is what you suggested and I should see a mapped folder after I pressed enter or do those options that appear mean nothing?

Image[/img]

I can see the shares from haneWin:

Image[/img]

I did not share the folders on the windows server except for haneWin on the above and I assume I don't need to and it should just assign a drive letter and I can see them which I can't. When I do share the folders on the server through properties in windows, naturally I can map, mount, etc. on the client just using windows sharing and bypassing haneWin but iso's buffer and that's with the server and the client wired. They do not buffer in xbmc since as you said, xbmc has built in support for nfs. Also, since xbmc renders these files on clients can I rule out firewalls or some other silly thing? I also tried changing the share drive and folder names. How would you enter the path if you were me using the above info? I'm stumped?
@brazen1

I'm fairly sure your problem with the mounting is purely because you aren't providing the NFS paths to the mount command correctly.

I can say with certainty that NO ":" should appear anywhere in any part of the first argument, for starters, and I strongly suspect that neither should the shared drive letter.

The command requires a minimum of TWO input arguments:

Argument 1 : The NFS path you are mounting

Argument 2: The drive letter you are mounting that NFS path ON. This is NOT the drive letter HANEWin is sharing on the server, it's the
drive letter on the CLIENT you want to map the NFS share TO.

Therefore, in your case, assuming you want to mount your "/j/3D Movies" NFS share onto the M drive on the client PC you would do:

mount "\\192.168.1.2\mnt\user\3d movies" "m:"

What I'm NOT sure about there is the "\mnt\user" part. For NFS shares on a Linux box like my unRAID server that's normal, but if you are sharing from
a Windows box using HANEWin I'm not sure it's necessary.

If it's not necessary then your mount command is probably even simpler:

mount "\\192.168.1.2\3d movies" "m:"

NOTE: I am wrapping both arguments in quotes there because your NFS shares have spaces in the names, so you MUST do that.

NOTE2: You seem to have TWO "3D Movies" shares, one that is readonly and one categorised as "All Machines", but the first one has a space
in the name and the second one does NOT. That could potentially confuse the issue even more. I strongly suggest that you eliminate any
duplicate shares on the HANEWin server and make sure each unique path is only shared ONCE with ONE name to avoid confusion going
forward.

The easiest way for you to determine the exact correct format of your NFS paths is to go into XBMC on the same client machine you
are trying to do the mount on, go to Videos->Files, and in there proceed as if you are going to add a source and use XBMC to browse
your network for NFS shares, then pick one and LOOK at what XBMC shows you it sees that NFS path as. That will tell you exactly
what format / path structure you need to use to hit a HANEWin share correctly.
@brazen1

UPDATE:

I've just quickly read a few articles on HANEWin shares and the formatting of those paths could be a bit more odd than I thought.

It's possible that you actually need to construct your MOUNT command on the client to look like one of these 2 formats:

mount "\\192.168.1.2\mnt\user\j\3d movies" "m:" -------- The important change there is the inclusion of "j"

or even possibly

mount "\\192.168.1.2:\mnt\user\j\3d movies" "m:" -------- Here the ":" is back in the fist argument after the ip address of the server and I've included the "j"

I'm not sure if that ":" is necessary (I said in the previous post it was not, I know, but it might be).

And I'm not sure if that "j" (or any other) drive letter is necessary.

BOTH might be necessary, so try different combinations.

What I AM sure of, is that what you originally posted was definitely not right and would never work Smile

@brazen1

2 good articles on configuring HANEWin servers:

http://forum.stmlabs.com/showthread.php?tid=6285

http://www.mede8erforum.com/index.php/to...625.0.html

From that second article:

exports example for whole drive
e:\ -public -name:e

export example for folder
d:\movies -public -name:movies

Manual NFS
example for whole drive --- 192.168.0.10:/e
example for folder --- 192.168.0.10:/movies

Worth noting in those examples:

1. They are using the -name parameter on the server side.

2. The formatting of the NFS paths. Note the use of the ":" after the IP address and note how the drive letter D is NOT referred to
in the NFS path itself (but that may be due to the use of the "-name" parameter when sharing the source).
Well, I've tried hours of many path combinations and all I receive is network error 53. I installed haneWin on another virgin pc and still error 53. I configured haneWin many different ways including their own example (c:\tools) and still error 53. I configured advanced firewall to allow ports and .exe's. I've also come to learn W8.1 no longer offers client for nfs on any versions and Microsoft has completely eliminated it. That's my final straw. It's great XBMC has nfs support built in. Too bad it's player can't do iso 3D's. This external player option sounded easy and perfect right up until it's time to implement it. I may never figure out why ALL my rigs refuse to cooperate but I really appreciate the effort you put forth and I thank you. Should you or anyone else have further input to offer, don't hesitate and if I come across a solution I will share it as well. Thanks again.....
Hello.

Thank you for writing the external launcher player app.

May you post the source code, please? I want to edit it so that mpls sends the file folder NOT the mpls to total media theater. My bluray folder rips are not working as a result of this bug.

Thanks
I have made some program specific changes to account for playing BD and DVD folders using PowerDVD13.

My changes are here...
Code:
IsBDFolder = fileExt.Equals(".bdmv", StringComparison.OrdinalIgnoreCase) || fileExt.Equals(".mpls", StringComparison.OrdinalIgnoreCase);
          IsDVDFolder = fileExt.Equals(".ifo", StringComparison.OrdinalIgnoreCase);

Code:
if (IsBDFolder)
          {
              filePath = filePath.Substring(0, filePath.LastIndexOf("BDMV\\") + "BDMV\\".Length);
          }
          if (IsDVDFolder)
          {
              filePath = filePath.Substring(0, filePath.LastIndexOf("VIDEO_TS\\") + "VIDEO_TS\\".Length);
          }
Hi there!

Thanks for making this...but I could not get it to work.
My situation at the moment is like this

I use <playercorefactory>
<players>
<player name="CNV_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\alfred\AppData\Roaming\XBMC\userdata\PlayCNV.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>false</hideconsole>
<warpcursor>none</warpcursor>
</player>

<player name="PDVD_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\alfred\AppData\Roaming\XBMC\userdata\PlayPDVD.bat</filename>
<args>"{1}"</args>
<hidexbmc>true</hidexbmc>
<hideconsole>false</hideconsole>
<warpcursor>none</warpcursor>
</player>
<player name="BDMV_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\alfred\AppData\Roaming\XBMC\userdata\PlayBDMV.bat</filename>
<args>"{1}" /fullscreen</args>
<hidexbmc>true</hidexbmc>
<hideconsole>false</hideconsole>
<warpcursor>none</warpcursor>
</player>
<player name="Disc_Player" type="ExternalPlayer" audio="false" video="true">
<filename>C:\Users\alfred\AppData\Roaming\XBMC\userdata\PlayDisc.bat</filename>
<args>"{1}" /fullscreen</args>
<hidexbmc>true</hidexbmc>
<hideconsole>false</hideconsole>
<warpcursor>none</warpcursor>

</player>
</players>
<rules action="prepend">
<!-- Bluray CNV -->
<rule filename=".*CNV.*" player="CNV_Player"/>
<!-- Bluray PDVD -->
<rule filename=".*CBL.*" player="PDVD_Player"/>

<!-- Bluray Disc -->
<rule protocols="bd|dvd" player="Disc_Player"/>
</rules>
</playercorefactory>

As well as 2 different .bat files (being called by [CBL])

This one

@echo off

rem "C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\Power2Go9\VirtualDrive9.exe" /d=0 %1
"C:\Program Files (x86)\Cyberlink\PowerDVD13\PDVDLP.exe" H:
rem "C:\Program Files (x86)\CyberLink Corp\Power2Go8\VirtualDrive.exe" /d=0 /u


and this one being called by [CNV]

@echo off
rem you can place your PlayISO file in \Roaming\XBMC\userdata\
rem you need to put the correct VCDMount drive letter in the command below

rem "C:\Program Files (x86)\Elaborate Bytes\VirtualCloneDrive\VCDMount.exe" /d=0 %1
"C:\Program Files (x86)\CyberLink\Power2Go9\VirtualDrive9.exe" /d=0 %1
rem "C:\Program Files (x86)\Cyberlink\PowerDVD13\PDVDLP.exe" H:
"C:\Program Files (x86)\ArcSoft\TotalMedia Theatre 5\uLaunchTMT5.exe" H:
rem "C:\Program Files (x86)\CyberLink Corp\Power2Go8\VirtualDrive.exe" /d=0 /u


I t would work with either mounting program

Thanks

Alfred
Thanks man. Whats incredible. In my case, i have a nfs server based ubuntu, and a windows 7 with xbmc. The easy way to mount nfs on w7 is open windows explorer, tools, Map Network Drive; then insert something like this: ip-of-NFS-Server:/Share-Name
I use this to play h265 on gotham 13.
Pages: 1 2