Log in

View Full Version : directshow Bluray disc navigator filter base on libbluray


Pages : 1 2 [3] 4 5 6 7 8 9 10

Mercury_22
3rd April 2012, 19:56
does this happen with all your blurays ? Or just this particular frozen planet one.
I see it throws an exception when the frozen planet one starts to play the main title

No it happens with others too
I think it's better to revert rev 99 for the moment

dukey
3rd April 2012, 23:53
Well I tracked the issue down. Well partly at least. It hangs on bd_close. Normally when it exits it throws a load of exceptions, on that frozen planet title. But if you press some keys, which happens to work in a separate thread, it hangs. Not sure why. The critical sections should protect against any thread insanity.

The frozen planet doesn't work with the latest edition though. I get this error. Hopefully useful for cb2000 ;p

c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\register.c:391: bd_psr
_write(): PSR4 (TITLE_NUMBER) 0x0 -> 0x4
c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\bluray.c:2108: PSR cha
nge: psr4 = 4 (03D445F0)
destroyXlet: lookup( org.videolan.BDJXletContext@5ed01d74, /7fff002e/4001/TitleC
hangeHandler ) = framework.title.TitleChangeProxy_stub2[framework.title.TitleCha
ngeProxy@4d277e8f]
startXlet: lookup( org.videolan.BDJXletContext@5ed01d74, /7fff002e/4001/TitleCha
ngeHandler ) = framework.title.TitleChangeProxy_stub2[framework.title.TitleChang
eProxy@4d277e8f]
c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\bdj\bdj_util.c:19: Cla
ss org/videolan/StreamInfo constructor not found
c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\bdj\bdj_util.c:19: Cla
ss org/videolan/StreamInfo constructor not found
c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\bdj\bdj_util.c:19: Cla
ss org/videolan/StreamInfo constructor not found
c:\users\ian\desktop\bluray\trunk\libbluray\src\libbluray\bdj\bdj_util.c:19: Cla
ss org/videolan/StreamInfo constructor not found
Thread died with exception c0000005 at pc 51ef1795 addr 0

Edit:
heres the link to vid, or menu files anyway
http://www7.zippyshare.com/v/82423600/file.html

cb2000
4th April 2012, 02:39
use same reversion of libbluray.jar and bluray.dll

Mercury_22
4th April 2012, 07:21
Well I tracked the issue down. Well partly at least. It hangs on bd_close. Normally when it exits it throws a load of exceptions, on that frozen planet title. But if you press some keys, which happens to work in a separate thread, it hangs. Not sure why. The critical sections should protect against any thread insanity.

The frozen planet doesn't work with the latest edition though. I get this error. Hopefully useful for cb2000 ;p



Edit:
heres the link to vid, or menu files anyway
http://www7.zippyshare.com/v/82423600/file.html
F.P. works with the latest edition here ! except the "stops responding after stop and exit in the main movie" introduced in rev 99 of course :)

dukey
4th April 2012, 10:15
use same reversion of libbluray.jar and bluray.dll

yeah that worked :)
cb2000 any idea why calling bd_user_input on a separate thread would cause
bd_close to hang ?
It doesn't do it on all titles, just some I think.

dukey
4th April 2012, 22:29
Okay I found out exactly what's happening. I assumed libbluray was thread safe since it uses mutexes to protects its internal state, but it's not.

When
void bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
is called. It calls

(*bdjava->jvm)->AttachCurrentThread(bdjava->jvm, (void**)&env, NULL);

If you are just using a single thread, this is a no-op according to the documentation. But if the current thread has changed it attaches the new one. This is fine, until it exits.

The VM waits until the main thread is the only user thread before it actually unloads. User threads include both Java threads and attached native threads.

So we must use DetachCurrentThread somewhere to fix this. If we can fix this I can probably finish the rest of the control interface :p

Mercury_22
6th April 2012, 07:49
@dukey after your latest changes building it's failing2>BDSource.obj : error LNK2019: unresolved external symbol "void __cdecl PTSToHMSF(__int64,struct tagDVD_HMSF_TIMECODE *)" (?PTSToHMSF@@YAX_JPAUtagDVD_HMSF_TIMECODE@@@Z) referenced in function "public: virtual long __stdcall CBDSource::GetTotalTitleTime(struct tagDVD_HMSF_TIMECODE *)" (?GetTotalTitleTime@CBDSource@@UAGJPAUtagDVD_HMSF_TIMECODE@@@Z)
2>BDSource.obj : error LNK2019: unresolved external symbol "__int64 __cdecl HMSFToPTS(struct tagDVD_HMSF_TIMECODE *)" (?HMSFToPTS@@YA_JPAUtagDVD_HMSF_TIMECODE@@@Z) referenced in function "public: virtual long __stdcall CBDSource::PlayAtTime(struct tagDVD_HMSF_TIMECODE *)" (?PlayAtTime@CBDSource@@UAGJPAUtagDVD_HMSF_TIMECODE@@@Z)
2>C:\DSLibBluray\Win32\Debug\dslibbluray.ax : fatal error LNK1120: 2 unresolved externals
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.88
========== Build: 1 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========

dukey
6th April 2012, 09:56
try now, i added the files, just forgot to submit changes to project files

Mercury_22
6th April 2012, 10:08
try now, i added the files, just forgot to submit changes to project files
It's working now :)

dukey
9th April 2012, 12:29
Mercury_22,
you got any .m2ts files with enhanced ac3 audio ? I am writing stream parsers at the moment. Finished ac3, but need some test files for e-ac3

nevcairiel
9th April 2012, 12:42
E-AC3 on BD doesn't exist in the real world, its only used on the dolby demo disc.

dukey
9th April 2012, 12:51
Okay, thanks for the heads up. I'm only parsing the stream headers so its only a few lines of code.

Mercury_22
9th April 2012, 13:13
Mercury_22,
you got any .m2ts files with enhanced ac3 audio ? I am writing stream parsers at the moment. Finished ac3, but need some test files for e-ac3

Here it is (http://www14.zippyshare.com/v/64308750/file.html) :)

@ Nev if it's not too much to ask can you help make "dslibbluray" properly decode TrueHD with LAVAudio ?
TrueHD is special, the Blu-ray source filter needs to remove the embedded AC3 or it won't work properly.
With LAV I'm getting [truehd @ 02ad42e0] Invalid nonrestart_substr.
[truehd @ 02ad42e0] mlpparse: Parity check failed.
[truehd @ 02ad42e0] Lossless check failed - expected 85, calculated 5f.
[truehd @ 02ad42e0] mlpparse: Parity check failed.
[truehd @ 02ad42e0] Lossless check failed - expected 19, calculated b7.
...

nevcairiel
9th April 2012, 13:21
@ Nev if it's not too much to ask can you help make "dslibbluray" properly decode TrueHD with LAVAudio ?

No thanks, my time is already occupied.

dukey
9th April 2012, 13:29
If you point me in the right direction can probably write the code

nevcairiel
9th April 2012, 13:38
Its actually pretty simple. You need to check the extended stream id in the PES Header.
http://dvd.sourceforge.net/dvdinfo/pes-hdr.html

In PES Extension 2 (at the bottom of the page), the bits marked "Reserved" are the extended stream id.
If the main stream_type == 0x83 (TrueHD) and extended_stream_id == 0x76, then that PES packet is for the AC3 substream, and needs to be skipped.

You can see the parsing in ffmpeg here:
http://git.1f0.de/gitweb?p=ffmpeg.git;a=blob;f=libavformat/mpegts.c;h=f8c96aeff950b5938dbca3d3f5cf2f8b43160b39;hb=HEAD#l913

dukey
9th April 2012, 13:42
Thanks, that should help a lot :)

nevcairiel
9th April 2012, 13:46
While i'm here, i have another question about the need of the special EVR Mixer.

Is all its required for the need to mix the RGB Overlays on top of the video image?
Or is there more?

If the RGB overlay is all, i could easily make for example LAV Video do that (without DXVA, at least), giving us way more flexibility in how the graph is setup.
If i could get the EVR requirement removed, it would be quite a bit more interesting for me, i might even start helping the development if you let me. :p I don't want to start my own BD project, but i want BDs to work. :p

Mercury_22
9th April 2012, 14:04
That will be great :) and CB2000 knows about the EVR
@dukey Did you manage to do something about the LPCM with LAVAudio ?

dukey
9th April 2012, 15:35
While i'm here, i have another question about the need of the special EVR Mixer.

Is all its required for the need to mix the RGB Overlays on top of the video image?
Or is there more?

If the RGB overlay is all, i could easily make for example LAV Video do that (without DXVA, at least), giving us way more flexibility in how the graph is setup.
If i could get the EVR requirement removed, it would be quite a bit more interesting for me, i might even start helping the development if you let me. :p I don't want to start my own BD project, but i want BDs to work. :p

I think the problem was sometimes the primary video stream stops, and only the substreams render. So with the default evr mixer or vrm9 nothing will render, hence the need for the custom mixer. The custom mixer actually works fairly transparently. You just need to create an instance of it and it pretty much works. I had to make a few changes to get it to work with my custom presenter, ie to make it thread safe with regards to direct3d. I've done a fair bit of work on the mixer, so anyone that uses a custom presenter only minimal changes would be required.

nevcairiel
9th April 2012, 15:38
I don't care if/how the custom mixer works, i just want to be able to use madVR as well. :p
Doesn't sound like it would be impossible to do the same in a decoder or post-processor that just accepts the substream.

Technically, i could write a very simple dummy filter that just accepts the RGB images and uses madVRs OSD functionality to render them. Doesn't even have to be in LAV. :d

dukey
9th April 2012, 15:43
It should be perfectly possible to write your own mixer for it. It's not locked to a custom EVR mixer, it just uses it if its in the graph. You can connect VRM9 to pin0 and it'll render video.

nevcairiel
9th April 2012, 15:45
I was only wondering if the EVR mixer serves another purpose as well, but as i gathered, thats not the case currently.

wanezhiling
10th April 2012, 06:36
Pretty nice, a good step for non-commercial BD navigator!:thanks:

I'll test later.

cb2000
10th April 2012, 14:00
as I mentioned before, the mixer mix 6 stream max, background(raw image or MPEG 2/4 I frame), main video, main subtitle, pip video, pip subtitle, interactive overlay(HDMV IG or BDJ), now in dslibbluray just implement main video, main subtitle and interactive overlay. To mix them, three solution, 1. custom mixer, 2. intergrate all video decoder inside soure filter, 3.the decoder can decode all streams and mix it. Current using solution 1.

cb2000
10th April 2012, 14:06
for solution 1 and 3 the mixer/decoder should accept souce filter to adjust position and scale of either stream, especialy the pip video and subtitle. Although it is not implement now.

cb2000
10th April 2012, 14:15
wishes more people can help or join to improve it, because I just start to work in a new company and can not work on it full time like before...

nevcairiel
10th April 2012, 14:51
Like i said, i would be happy to help with the little time i have. Once i got it working the way i like it, anyway. :)

cb2000
10th April 2012, 15:09
What shall I do for you?
Like i said, i would be happy to help with the little time i have. Once i got it working the way i like it, anyway. :)

wanezhiling
10th April 2012, 15:16
:)Wow it's worth waiting when another so talented developer joins.

nevcairiel
10th April 2012, 15:22
What shall I do for you?

The important part is to figure out how to build everything properly. I can compile the C++ parts just fine, but how do you build the BD-J parts, and where do the three extra DLLs come from that you include in the zip? :)
I'm a Java developer at my day job, so working on the BD-J parts would seem like a logical choice, I can do enough C++ on my other projects. ;)

Of course another aspect would be trying to fix issues that only occur with my decoders, once everything is stable enough for those aspects.

Anyway, my SF name is the same as here.
If more people join, maybe some place should be setup where efforts can be coordinated, so that nothing is done twice? :d

dukey
10th April 2012, 15:32
I think they are java related dlls, but really I am not sure.

Edit:
I actually know java too. I did it for about 3 years, but it's been a while :p

cb2000
10th April 2012, 16:52
There is a ant build.xml in bdjpath, I use eclipse to compile it.
three extra DLLs are compiled from phoneme(with my patch), a J2ME VM from http://phoneme.java.net/, should I upload it? It is so big about 10000 files and 100+M.
The important part is to figure out how to build everything properly. I can compile the C++ parts just fine, but how do you build the BD-J parts, and where do the three extra DLLs come from that you include in the zip? :)
I'm a Java developer at my day job, so working on the BD-J parts would seem like a logical choice, I can do enough C++ on my other projects. ;)

Of course another aspect would be trying to fix issues that only occur with my decoders, once everything is stable enough for those aspects.

nevcairiel
10th April 2012, 16:59
I see. Just wanted to know where its from.
I'll try to compile the BDJ parts later, need to create a new Eclipse setup.

cb2000
10th April 2012, 17:07
file needed to build java code can be found in test-120.zip. and should config the java compiler to ouput 1.4 class file.
I see. Just wanted to know where its from.
I'll try to compile the BDJ parts later, need to create a new Eclipse setup.

dukey
10th April 2012, 17:25
Bill,
did you see this post ?
http://forum.doom9.org/showpost.php?p=1569205&postcount=116
About fixing DTS

nevcairiel
10th April 2012, 18:56
Bill,
did you see this post ?
http://forum.doom9.org/showpost.php?p=1569205&postcount=116
About fixing DTS

Its about TrueHD, not DTS. :)
I can probably implement that, as long as noone complains that the AC3 substream is then completely dropped.

I just need to find a disc with TrueHD. ;)

dukey
10th April 2012, 19:18
pm Mercury_22. He has quite a collection which I'm sure he could upload a few samples for :)

starla
10th April 2012, 19:24
If more people join, maybe some place should be setup where efforts can be coordinated, so that nothing is done twice? :d

There already is duplicate effort done - to bad that the forces havent been joined earlier. Only the BD-J is missing from the http://forum.team-mediaportal.com/threads/native-blu-ray-support.102375/

I personally would have helped with the venture if it had happened earlier, but now there isn't that much for the personal gain - as only the BD-J side is missing and that is something I cannot help as I'm a complete Java noob.

--
tourettes

dukey
10th April 2012, 19:32
It happens. I only discovered your project existed a few days ago :p Can it work as a standalone filter, or is just for media portal ?

nevcairiel
10th April 2012, 19:42
The problem is that many people just start working on things instead of inquiring if stuff already exists.
I have known about MPs version of a BD filter for quite a while, but sadly some decisions were made in that project that make it harder to run it outside of MediaPortal (quite some changes to the player are required for it to work at this time), and i sadly noticed it too late to be still able to influence anyone.

I cannot say which of the two has a better chance for the future. It would of course be beneficial to join forces and try to create one universal solution, but of course that means there is some extra effort on both sides.
The BD-J changes for one can (and should) be contributed back to libbluray itself, so that everyone can benefit from them.

Mercury_22
10th April 2012, 21:11
@ Nev thanks for fixing pcm_mpeg decoding ! and I'm thinking that this is a good moment if you can spare some time to add some simple tray icons for LAVFilters so we can be sure that LAV it's used when testing DSLibBluray

nevcairiel
10th April 2012, 21:15
@ Nev thanks for fixing pcm_mpeg decoding ! and I'm thinking that this is a good moment if you spare some time to add some simple tray icons for LAVFilters so we can be sure that LAV it's used when testing DSLibBluray

Use GraphStudio and connect to the graph to check. :p
Also, decoding wasnt broken, it was just outputting those stupid warnings for no good reason.

Mercury_22
10th April 2012, 21:25
Use GraphStudio and connect to the graph to check. :p
Also, decoding wasnt broken, it was just outputting those stupid warnings for no good reason.

Good to know about PCM as for GraphStudio ...:D

EDIT maybe it's the same case with mpeg 2 (stupid warnings) ?

dukey
10th April 2012, 21:54
what warnings do you get with mpeg2?

Mercury_22
10th April 2012, 22:33
what warnings do you get with mpeg2?

[mpeg2video @ 037f13a0] hardware accelerator failed to decode picture

But it's playing

nevcairiel
11th April 2012, 06:55
[mpeg2video @ 037f13a0] hardware accelerator failed to decode picture

But it's playing

This should usually be limited to the start of the video for one or two frames, if it keeps happening on a regular basis something is wrong.

Mercury_22
11th April 2012, 08:34
This should usually be limited to the start of the video for one or two frames, if it keeps happening on a regular basis something is wrong.
You're right it happens only at the "start of the video" so it's just another "stupid warning" ?:)
Also DSLibBluray has big problems with both LAV's VC-1 but that's something for another time if you'll have the time to take a look after TrueHD :p

dukey
11th April 2012, 15:53
What happens with VC1 ? I don't have any VC1 stuff to test with.

nevcairiel
11th April 2012, 16:10
Without looking, my guess is that VC-1 isnt properly assembled back into frames, which is required for it.