Page 2 of 2

Slight difference in audio output delay

Posted: Sun Jun 26, 2022 12:57 pm
by Guest 2
Rocky wrote:
Sun Jun 26, 2022 7:34 am
Please re-download again to get chapter marks on the timeline for MKV.
Great!

Will find some time to test it.

Edit: please add buttons and shortcuts to jump to next/previous chapter.

Slight difference in audio output delay

Posted: Sun Jun 26, 2022 8:06 pm
by Rocky
I knew you'd ask for that.

Re-download again and update DGIndexNV. Fixed another MKV 'GOP back' bug that led to a very busy tight loop for some unlucky streams. :oops:

Seems real good now.

Slight difference in audio output delay

Posted: Mon Jun 27, 2022 3:23 am
by Guest 2
Rocky wrote:
Sun Jun 26, 2022 8:06 pm
Seems real good now.
I thought you added chapters support for BD too :)

C'mon. :D

Slight difference in audio output delay

Posted: Tue Jun 28, 2022 7:33 am
by Rocky
I've added it in my local build. But there is an issue with accuracy of the marks versus the displayed GOPs (for TS), i.e, if you navigate on the timeline to a chapter mark it is close to but not exactly at the intended video. The reason for this is that the chapter marks specify times and they are displayed on the timeline as a function of the ratio of mark_time/total_duration. But the actual displayed video location on the timeline is a function of position_in_file/total_file_size. In MKV, we know the timestamp of the current GOP, but we don't have that for TS. I am thinking about what, if anything, can be done about this. Maybe the PTS could be used, if it is continuous.

EDIT: We also have the arrival timestamp in the first 4 bytes of the 192-byte transport packets that could possibly be used.

EDIT2: Nope, can't use the arrival timestamp as it is only 30 bits and continuously wraps.

Slight difference in audio output delay

Posted: Tue Jun 28, 2022 12:18 pm
by Guest 2
Rocky wrote:
Tue Jun 28, 2022 7:33 am
But there is an issue with accuracy
Don't get mad with visual accuracy.

Enough that the go to chapter, next chapter and previous chapter are frame accurate for future use of episode/chapter extraction.

Slight difference in audio output delay

Posted: Tue Jun 28, 2022 7:24 pm
by Rocky
That's the whole point. It's not accurate period, not just visually. I mean it's not a display issue; it's a matter of getting the correct timestamp for the video frame on display. I'm very close so keep being patient. :P

Slight difference in audio output delay

Posted: Tue Jun 28, 2022 11:09 pm
by Rocky
OK, I found the bug and now have a reliable timestamp for the frame on display, in the same space as the chapter marks. So, a little clean-up and regression testing and I'll have a test version for you. Then later come chapter navigation and demuxing. This hullabaloo was an unavoidable prerequisite for those.

Slight difference in audio output delay

Posted: Fri Jul 01, 2022 8:51 am
by Rocky
Here is a new version with chapter marks for disks:

https://rationalqm.us/misc/DGDecNV_Guest 2.zip

Note on current behavior: When you open a disk and click on the timeline, you will likely notice that the cursor settles at a point different than the location of the click. The reason for this is a bit technical so I won't explain it right now. To accurately position you can click and drag and then let go when the cursor is where you want it. This will be fixed in a subsequent version. That will involve code that interprets the place on the timeline where the click is made as a time rather than a stream offset, coupled with a search (seek operation) within the stream for that time. The stream offset is a good place to start the search, which must check forward and backward from that point. This is needed because it is not possible to jump immediately to a time for ES/TS and begin decoding there, whereas for MKV, the library has a direct time seek function. The cursor location and frame on display after letting go must correspond to a time for proper comparison to the chapter marks. This is not so important for ES/TS because there are no chapter marks to compare to, but it will still be desirable to have the navigation bar always be interpreted as a timeline. When it is implemented for all types then we can think about showing the time with a popup like players do, etc.

I want to get this version out for testing before doing the new seek code.

Slight difference in audio output delay

Posted: Sat Jul 02, 2022 8:27 am
by Rocky
I experimented with the search operation but it is too slow. Fear not, however, it turns out there is an EP_map database in the disk that relates PTS (time) to file offset (byte position). That's what the players use to jump on the timeline. So I'll have to implement EP_map parsing as described in Annex N of the bluray spec.

On the other hand, DGIndexNV is not a player and the parsing is quite complex, so maybe we just say not gonna do all that, just use click and drag to locate your cursor. Unfortunately, that would rule out chapter navigation buttons and automatic chapter demuxing etc. So I'll look into the parsing before deciding.

Slight difference in audio output delay

Posted: Sat Jul 02, 2022 12:43 pm
by Sherman
Rocky wrote:
Sat Jul 02, 2022 8:27 am
we just say not gonna do all that, just use click and drag to locate your cursor
You're kidding, right Rocky? The EP_map parsing doesn't look so hard.

Slight difference in audio output delay

Posted: Sat Jul 02, 2022 1:30 pm
by Rocky
Go for it, Sherm! I'm tired.

Slight difference in audio output delay

Posted: Sun Jul 03, 2022 5:18 am
by Guest 2
Rocky wrote:
Fri Jul 01, 2022 8:51 am
Here is a new version with chapter marks for disks
Thank you.

It seems to be working fine. Would be nicer to have marker on time bar to move as it indexes video. :D

Slight difference in audio output delay

Posted: Sun Jul 03, 2022 6:29 am
by Rocky
Oops, redownload for a fix for that. Next release will have EP_map parsing.

Slight difference in audio output delay

Posted: Sun Jul 03, 2022 10:48 am
by Guest 2
Rocky wrote:
Sun Jul 03, 2022 6:29 am
Oops, redownload for a fix for that. Next release will have EP_map parsing.
Now that we have time, what about showing it on the right of button bar? Such as, current time/total time alternatively to current frame/total frames?

Slight difference in audio output delay

Posted: Sun Jul 03, 2022 12:45 pm
by Rocky
Will surely consider it at the right time.

Slight difference in audio output delay

Posted: Tue Jul 05, 2022 4:39 pm
by Sherman
Guys, I got a good start on the random access using the EP_map. You know what, it's not so easy as I thought, but don't worry, I'm on it. I have parsed everything needed but parsing is only part of it. Once you have the map for the clip, sequence, and PID of interest, you have to search it and interpret it in a complex way. If you doubt the complexity, have a look at the bluray spec. Guys, I'm still learning long division from Albert. And not so long ago I was writing in cursive. So that's where I am. I'm holding the fine and coarse maps in my hands and trying to figure out what to do with them.
:bravo:

Slight difference in audio output delay

Posted: Thu Jul 07, 2022 6:06 pm
by Sherman
I studied the spec in the bathtub today and think I understand it. So tomorrow I'll write the search code. And yes, I did wash behind my ears.

Slight difference in audio output delay

Posted: Mon Jul 11, 2022 12:07 pm
by Rocky
I put a release candidate up for DGDecNV:

https://rationalqm.us/dgdecnv/binaries/dgdecnv_244.zip

Any testing would be appreciated. I have a small fix to make for DGDemux that I want to include in the package before release. Note that disk random access using EP_map is not yet working. Use click and drag for close positioning as before.

@Guest 2

The only difference from the last test release is that disk chapter marks are cleared on File/Close.

Slight difference in audio output delay

Posted: Fri Jul 15, 2022 7:22 am
by Rocky
Please re-download the release candidate to get these fixes:

* Adjust the times in the QP file when 'skip first' is enabled.
Chapters were already adjusted.

* Chapter and QP items that are contained in skipped M2TS files
are no longer included in the chapter and QP files.

* Timeline navigation for bluray disks with 'skip first' and/or 'skip last'
was broken. Fixed.

The first two will be ported to DGDemux.

Ride it hard! I'm getting ready to pull the trigger on release.

Slight difference in audio output delay

Posted: Mon Jul 18, 2022 8:13 pm
by Rocky
Released as build 244. Marking resolved.

Slight difference in audio output delay

Posted: Sun Jul 24, 2022 5:23 am
by Guest 2
Is there any reason why dgdemux.exe, while same version, has different size and checksum in DGDecNV and DGDemux packages? Aren't they interchangeable?

Slight difference in audio output delay

Posted: Sun Jul 24, 2022 12:12 pm
by Rocky
Ah, good point.

Yes, they should be the same. Sometimes the DGDecNV bundled DGDemux gets behind. Typically doesn't matter because DGIndexNV uses it only for the streams list, and nothing has changed there for a while. Nevertheless let's update it.

EDIT: Done.