Bluray playback script for VLC/HandBrake/Kodi on Windows

Discussion of advanced MakeMKV functionality, expert mode, conversion profiles
hmsintrepide
Posts: 5
Joined: Sun Jan 01, 2017 8:24 pm
Location: France

Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by hmsintrepide » Sun Jan 01, 2017 8:48 pm

I create a universal (Windows 32 and 64 bit) batch script to symlink BD+ and AACS libraries for some apps.

Download: https://gist.github.com/hmsintrepide/d8 ... a8f7376166
Report bug: https://github.com/hmsintrepide/libmmbd ... ler/issues

Version 3
Auto Admin rights (with powershell, win7+)

Version 2
HandBrake 32/64-bit (1.0.1 tested)
Kodi (16.1 and 17.0 tested)
Use mklink instead of copy

Version 1
VLC 32/64 (2.2.4 tested)
Last edited by hmsintrepide on Sun Jan 08, 2017 9:21 pm, edited 2 times in total.

ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Simple batch for bluray playback with VLC for Windows

Post by ndjamena » Wed Jan 04, 2017 10:09 pm

Since you need administrator privileges anyway, you might as well just put symbolic links to the libraries in the VLC directory.

That way you don't have to copy the libraries every time MakeMKV updates to make sure you have the latest versions and you don't need three copies of each dll on your system.

MKLINK %vlc64%"\libaacs.dll" %libmmbd64%

It works for Handbrake and Kodi too.

hmsintrepide
Posts: 5
Joined: Sun Jan 01, 2017 8:24 pm
Location: France

Re: Simple batch for bluray playback with VLC for Windows

Post by hmsintrepide » Sun Jan 08, 2017 1:42 pm

ndjamena wrote:Since you need administrator privileges anyway, you might as well just put symbolic links to the libraries in the VLC directory.

That way you don't have to copy the libraries every time MakeMKV updates to make sure you have the latest versions and you don't need three copies of each dll on your system.

MKLINK %vlc64%"\libaacs.dll" %libmmbd64%

It works for Handbrake and Kodi too.
Thanks,
I make version 2 with mklink and add handbrake/kodi apps.

ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by ndjamena » Sun Jan 08, 2017 2:22 pm

Just a nitpick, but it's generally called "Administrator Rights" (plural). It looks kind of odd the way you've written it.

If anyone is interested this a batch that will call administrator rights automatically.

http://forum.videohelp.com/threads/3759 ... ost2471615

It's set to put a vbs script in the %temp% folder.

Essentially just put the batch in a path folder and call it like:

CALL BatchName.bat "%~f0" %*

From within any other batch and it should just work.

MKLink can't be called from vbs scripts.

hmsintrepide
Posts: 5
Joined: Sun Jan 01, 2017 8:24 pm
Location: France

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by hmsintrepide » Mon Jan 09, 2017 11:43 am

ndjamena wrote:Just a nitpick, but it's generally called "Administrator Rights" (plural). It looks kind of odd the way you've written it.

If anyone is interested this a batch that will call administrator rights automatically.

http://forum.videohelp.com/threads/3759 ... ost2471615

It's set to put a vbs script in the %temp% folder.

Essentially just put the batch in a path folder and call it like:

CALL BatchName.bat "%~f0" %*

From within any other batch and it should just work.

MKLink can't be called from vbs scripts.
I use powershell for privilege elevation. This is the smallest method, I think.

Code: Select all

if exist %SystemRoot%"\System32\WindowsPowerShell\v1.0\powershell.exe" (
		powershell Start-Process cmd -ArgumentList '/k "%0"' -Verb runAs
	) else (
		echo Start this script with Administrator rights!
		pause
	)
exit

ndjamena
Posts: 830
Joined: Mon Jan 07, 2013 12:23 am

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by ndjamena » Mon Jan 09, 2017 1:05 pm

Should I report bugs here or there?

Your elevation code doesn't work if the batch has a path with a space in it.

If there's a way to call cmd from powershell from cmd and pass arguments with spaces I haven't found it yet.

GHender3
Posts: 3
Joined: Mon May 01, 2017 6:00 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by GHender3 » Tue Jun 06, 2017 3:21 pm

Just wanted to let everyone know that while this method works fine for VLC 2.2.4 (Windows, 64-bit), it's not working with VLC 2.2.6, Windows 64-bit. Libmmbd64.dll renamed libaacs.dll or sitting in the VLC folder as a symbolic link named libaacs.dll leads to VLC saying it can't find a usable libaacs.dll for decryption. I haven't tried a BD-Plus title to check on that.

Downgrading from VLC 2.2.6 to VLC 2.2.4 immediately brought back direct BluRay playback. Handbrake is currently unaffected.

I am also using MakeMKV and VLC 2.2.4 (both 64-bit) under Mac OS X. I haven't yet tried to see what updating VLC to 2.2.5.1 does in that environment. I fear it isn't good. Hope this helps someone.

meesterexx
Posts: 1
Joined: Thu Aug 03, 2017 5:43 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by meesterexx » Thu Aug 03, 2017 5:46 pm

GHender3 wrote:Just wanted to let everyone know that while this method works fine for VLC 2.2.4 (Windows, 64-bit), it's not working with VLC 2.2.6, Windows 64-bit. Libmmbd64.dll renamed libaacs.dll or sitting in the VLC folder as a symbolic link named libaacs.dll leads to VLC saying it can't find a usable libaacs.dll for decryption. I haven't tried a BD-Plus title to check on that.

Downgrading from VLC 2.2.6 to VLC 2.2.4 immediately brought back direct BluRay playback. Handbrake is currently unaffected.

I am also using MakeMKV and VLC 2.2.4 (both 64-bit) under Mac OS X. I haven't yet tried to see what updating VLC to 2.2.5.1 does in that environment. I fear it isn't good. Hope this helps someone.
Thank you, this did help.
Can confirm, 2.2.5.1 does not work. Had to drop back to 2.2.4.

GHender3
Posts: 3
Joined: Mon May 01, 2017 6:00 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by GHender3 » Thu Aug 03, 2017 7:57 pm

meesterexx wrote:
GHender3 wrote:Just wanted to let everyone know that while this method works fine for VLC 2.2.4 (Windows, 64-bit), it's not working with VLC 2.2.6, Windows 64-bit. Libmmbd64.dll renamed libaacs.dll or sitting in the VLC folder as a symbolic link named libaacs.dll leads to VLC saying it can't find a usable libaacs.dll for decryption. I haven't tried a BD-Plus title to check on that.

Downgrading from VLC 2.2.6 to VLC 2.2.4 immediately brought back direct BluRay playback. Handbrake is currently unaffected.

I am also using MakeMKV and VLC 2.2.4 (both 64-bit) under Mac OS X. I haven't yet tried to see what updating VLC to 2.2.5.1 does in that environment. I fear it isn't good. Hope this helps someone.
Thank you, this did help.
Can confirm, 2.2.5.1 does not work. Had to drop back to 2.2.4.
For what it's worth, VLC 2.2.5.1 works just as well as 2.2.4 using Makemkv under Mac OS X. An official release of 2.2.6 isn't yet available for Mac. So I didn't have to revert there. I have no explanation for Handbrake working fine but not VLC, or why this is only happening in Windows. Glad to see that I was able to help someone.

CryptMan
Posts: 3
Joined: Sun Sep 10, 2017 5:12 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by CryptMan » Sun Sep 10, 2017 5:17 pm

Hi,

looks like Kodi 18 has also problems with this. In Kodi 17 it was working but in Kodi 18 it crashes if the files are in the Kodi folder and a BD is in the drive.

Code: Select all

Thread 1248 (process 12108)
# 0 strlen
# 1 aacs_open_device
# 2 bd_stop_bdj
# 3 bd_stop_bdj
# 4 bd_stop_bdj
# 5 bd_stop_bdj
# 6 bd_stop_bdj
# 7 bd_stop_bdj
# 8 process_jpeg
# 9 process_jpeg
#10
#11
#12 process_jpeg
#13
#14
#15
#16 set_app_type
#17 BaseThreadInitThunk
#18 RtlGetAppContainerNamedObjectPath
#19 RtlGetAppContainerNamedObjectPath

joniw
Posts: 5
Joined: Thu Dec 07, 2017 11:46 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by joniw » Fri Dec 08, 2017 7:40 am

Hello,

this problem is discussed over here.

joniw
Posts: 5
Joined: Thu Dec 07, 2017 11:46 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by joniw » Sat Dec 09, 2017 10:04 am

Hello,

it looks like this is a problem in libmmbd. At some point it does a string length check where a NULL value is allowed in libaacs. This leads to the exception shown here.

This problem affects VLC because it also uses libbluray.

Do we have chance that this is addressed in libmmbd?

CryptMan
Posts: 3
Joined: Sun Sep 10, 2017 5:12 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by CryptMan » Mon Dec 18, 2017 9:49 am

Thank you joniw to pointing this out. It's great to see that I'm not alone with this problem.

I hope that Mike reads here and can find a solution for this.

CryptMan
Posts: 3
Joined: Sun Sep 10, 2017 5:12 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by CryptMan » Thu Dec 21, 2017 7:28 am

joniw wrote:Hello,
it looks like this is a problem in libmmbd.
Are sure that the problem is really in that lib an not in the underlying makemkv?
I ask because mike said here http://makemkv.com/forum2/viewtopic.php?f=10&t=7008 that this part of MakeMKV is OpenSource.
And that would mean that anybody could fix it.

Just an idea.

joniw
Posts: 5
Joined: Thu Dec 07, 2017 11:46 pm

Re: Bluray playback script for VLC/HandBrake/Kodi on Windows

Post by joniw » Thu Dec 21, 2017 3:51 pm

CryptMan wrote:And that would mean that anybody could fix it.
That is right, i can insert a fix there. My problem is i am using windows and i do not have a proper build chain for windows. For me it seems to be an easy fix but i do not how many changes in makemkv are needed to support this.

Post Reply