DGDemux development
Re: DGDemux development
Hey Rocky!
I got it working. I had to buffer payload data starting at a packet with payload_unit_start_indicator = 1 up to but excluding the next packet with payload_unit_start_indicator = 1. I learned that trick from you. Then I call a function I made called reorder_pcm() to do the byte swaps on the buffered data. Then that data can be written to disk. I tested it on Ratatouille and the resulting .w64 file is identical to the one produced by sox.exe, it plays fine in MPC-HC, and mkvtoolnix accepts it.
I'm gonna do some code review and testing and then I'll hand it over to you for release. Don't forget we need this in DGIndexNV also. BTW, DGIndexNV has a bug that mangles a few samples at the start of the demuxed PCM file. We can fix that at the same time.
Coding is fun! QM can wait for a while.
I got it working. I had to buffer payload data starting at a packet with payload_unit_start_indicator = 1 up to but excluding the next packet with payload_unit_start_indicator = 1. I learned that trick from you. Then I call a function I made called reorder_pcm() to do the byte swaps on the buffered data. Then that data can be written to disk. I tested it on Ratatouille and the resulting .w64 file is identical to the one produced by sox.exe, it plays fine in MPC-HC, and mkvtoolnix accepts it.
I'm gonna do some code review and testing and then I'll hand it over to you for release. Don't forget we need this in DGIndexNV also. BTW, DGIndexNV has a bug that mangles a few samples at the start of the demuxed PCM file. We can fix that at the same time.
Coding is fun! QM can wait for a while.
Sherman Peabody
Director of Linux Development
Director of Linux Development
Re: DGDemux development
Great work, Sherman! Waiting for your go-ahead.
Then it is on to various other things (no particular order):
* DGIndexNV zoom = 1/8 for 8K video. "Handcuffs of Zoom."
* Demuxing by episode.
* Port PCM wrapping to DGIndexNV.
You could take the last one since you like coding so much.
Then it is on to various other things (no particular order):
* DGIndexNV zoom = 1/8 for 8K video. "Handcuffs of Zoom."
* Demuxing by episode.
* Port PCM wrapping to DGIndexNV.
You could take the last one since you like coding so much.
- Mr. Peabody
- Posts: 46
- Joined: Tue Dec 24, 2019 9:20 am
Re: DGDemux development
Sherman, I know you're having fun with the coding, but don't forget your homework. And clean your room!
- Bullwinkle
- Posts: 338
- Joined: Thu Sep 05, 2019 6:37 pm
Re: DGDemux development
Looking closely at your solution, Sherman, I see that it will explode with 20-bit PCM. 20-bit is a legal bluray bit depth. The last 5% of every project determines its success or failure. I learned that from me. The omission is not worth a stomping, but definitely a snort or two. A little tap with the two front hooves to remind you where the real power lies.
Re: DGDemux development
Bullwinkle, if you can demonstrate a bluray with 20-bit audio I will add support for it.
Rocky, good to go.
Rocky, good to go.
Sherman Peabody
Director of Linux Development
Director of Linux Development
Re: DGDemux development
I'll make a release in the morning with this and the frame rate detection fix for some HEVC streams. Thank you for your contribution.
Love your sense of humor:
Love your sense of humor:
Code: Select all
// Set sample size in bytes.
switch ((audio[index].format_m2ts & 0xc0) >> 6)
{
case 1: // 16-bit
size = 2;
break;
// case 2: // 20-bit
// size = puke;
// break;
case 3: // 24-bit
size = 3;
break;
}
Re: DGDemux development
DGDemux download link gets a 404 error
Re: DGDemux development
Fixed. Thank you.
Re: DGDemux development
Just curious, Pea. Are dried lemon peels and empty McDonalds boxes a health hazard? Or are you just throwing your weight around?
Curly Howard
Director of EAC3TO Development
Director of EAC3TO Development
- Mr. Peabody
- Posts: 46
- Joined: Tue Dec 24, 2019 9:20 am
Re: DGDemux development
How do we know that you are a responsible adult, given that you ruined history? Did you know that I too am a highly sought-after speaker?
https://youtu.be/KZSyGCIBDEs
https://youtu.be/KZSyGCIBDEs
Curly Howard
Director of EAC3TO Development
Director of EAC3TO Development
Re: DGDemux development
Let's stay on topic, guys. Thank you!
Re: DGDemux development
Curly, my daddy is stronger than your daddy!
Sherman Peabody
Director of Linux Development
Director of Linux Development
Re: DGDemux development
Hi DG, many thanks for your continued work on those tools that make ends meet !
Here comes a small thingy for DGDemux 1.0.0.26c:
https://forum.doom9.org/showthread.php? ... ost1911589
(DGDemux 1.0.0.26 reports 30.000fps for an extra video stream (here MPEG-2 NTSC) where it should be 29.970 or 30000/1001)
Here comes a small thingy for DGDemux 1.0.0.26c:
https://forum.doom9.org/showthread.php? ... ost1911589
(DGDemux 1.0.0.26 reports 30.000fps for an extra video stream (here MPEG-2 NTSC) where it should be 29.970 or 30000/1001)
Re: DGDemux development
Who says it should be 29.97? Can you please cut the first 100MB of the first M2TS in that playlist and upload it somewhere? Also the MPLS file. And please, give me the screenshot! Unapproved attachments at other forums are useless. Thank you.
I can fix it quick if you provide these things.
I can fix it quick if you provide these things.
Re: DGDemux development
Thanks for following up at the other forum. We can continue there.
Re: DGDemux development
Problem fixed.
Re: DGDemux development
Success ! 1.0.0.26(d): fps shows 29.970 correctly.
Repeated donation underways, just for all the DG Tools I have used over the years.
P.S. Oh, I just saw it, so I am Moose Approved now !
So no stomping for the next 7 miles...
Repeated donation underways, just for all the DG Tools I have used over the years.
P.S. Oh, I just saw it, so I am Moose Approved now !
So no stomping for the next 7 miles...
Re: DGDemux development
Thank you, Emulgator! I think you hold the record now for speed of becoming Moose Approved.
The funny thing is that 30i is not even a legal bluray frame rate. You'd'a thought a diligent squirrel would know that. Derp.
The funny thing is that 30i is not even a legal bluray frame rate. You'd'a thought a diligent squirrel would know that. Derp.
Re: DGDemux development
A little status update on my THD prototype:
I've gotten my application to the point where I can give it a list of m2ts files and it gives me a THD file where all the segments are cut in line with the Bresenham algorithm (and it decodes correctly with ffmpeg ). While the sync is now spot on throughout the entire film, the cuts are in the wrong places and it's definitely audible (where you can hear a subtle "pop" that disappears when you do the cut correctly).
Tomorrow I'll dive into matching the decoded audio of the neighboring THD frames at the cut locations to get it just perfect.
Once I'm done with that, I'll clean it up and publish it on my Github
I've gotten my application to the point where I can give it a list of m2ts files and it gives me a THD file where all the segments are cut in line with the Bresenham algorithm (and it decodes correctly with ffmpeg ). While the sync is now spot on throughout the entire film, the cuts are in the wrong places and it's definitely audible (where you can hear a subtle "pop" that disappears when you do the cut correctly).
Tomorrow I'll dive into matching the decoded audio of the neighboring THD frames at the cut locations to get it just perfect.
Once I'm done with that, I'll clean it up and publish it on my Github
Re: DGDemux development
Sounds good. I'll be very interested to see what you come up with.
Re: DGDemux development
I've had success with extracting the audio data at the ends of a THD stream. It turns out that if two segments overlap by a frame, they match almost perfectly. Almost.
Have some samples from Monsters University (signed 32-bit, but really 24-bit, integers):
Last THD frame of 00055 (segment 1), channel 0:
First THD frame of 00056 (segment 2), channel 0:
The sample sequences match almost identically, being at most 1 unit of resolution off in this case. This makes me happy . I'll definitely need to test all of my Disney/Pixar discs to see what tolerance I can ultimately get away with when matching, but this is looking very promising.
It also appears that at least on Monsters University, the true bit depth is only 20 bits per sample instead of 24 (due to every sample being a multiple of 16). This is weird and unexpected and I'm not fully convinced yet that I'm not wrongly assuming the sample value data layout, but ffmpeg spits out the same values if I ask it to convert the THD stream to PCM signed 24 bit. Definitely need to make sure I get this right.
Have some samples from Monsters University (signed 32-bit, but really 24-bit, integers):
Last THD frame of 00055 (segment 1), channel 0:
Code: Select all
sample: -295504
sample: -270672
sample: -241760
sample: -212416
sample: -184096
sample: -158032
sample: -133376
sample: -113584
sample: -94656
sample: -72672
sample: -44256
sample: -9104
sample: 27792
sample: 66304
sample: 104480
sample: 136272
sample: 161984
sample: 181840
sample: 194704
sample: 206496
sample: 223856
sample: 247152
sample: 274176
sample: 305600
sample: 342336
sample: 381248
sample: 417872
sample: 451552
sample: 481584
sample: 506080
sample: 523952
sample: 535824
sample: 542512
sample: 541968
sample: 529904
sample: 510112
sample: 485440
sample: 458256
sample: 428976
sample: 399280
Code: Select all
sample: -295488
sample: -270672
sample: -241744
sample: -212400
sample: -184080
sample: -158048
sample: -133376
sample: -113584
sample: -94672
sample: -72656
sample: -44256
sample: -9088
sample: 27792
sample: 66304
sample: 104480
sample: 136272
sample: 162000
sample: 181824
sample: 194720
sample: 206496
sample: 223872
sample: 247152
sample: 274176
sample: 305600
sample: 342336
sample: 381248
sample: 417888
sample: 451552
sample: 481584
sample: 506080
sample: 523952
sample: 535840
sample: 542528
sample: 541984
sample: 529904
sample: 510112
sample: 485424
sample: 458256
sample: 428976
sample: 399280
It also appears that at least on Monsters University, the true bit depth is only 20 bits per sample instead of 24 (due to every sample being a multiple of 16). This is weird and unexpected and I'm not fully convinced yet that I'm not wrongly assuming the sample value data layout, but ffmpeg spits out the same values if I ask it to convert the THD stream to PCM signed 24 bit. Definitely need to make sure I get this right.
Re: DGDemux development
Always exciting to hear from you, domy. I've been rebuilding my attic air return system and have to tell you, I am knackered! Will respond tomorrow, if Sherman doesn't jump in before then. Kids, these days.
Can't salvage the ducts so going with this:
https://www.homedepot.com/p/Master-Flow ... /202562740
Happiness is shiny new ducts and vents.
Start to fix one thing and two things it depends on break. 70s construction was the pits.
:belly-laugh:
Can't salvage the ducts so going with this:
https://www.homedepot.com/p/Master-Flow ... /202562740
Happiness is shiny new ducts and vents.
Start to fix one thing and two things it depends on break. 70s construction was the pits.
:belly-laugh:
Re: DGDemux development
Blown-in or batts? That is the question. I'm thinking batts. Blown-in is so messy and think of wading through it for future repairs.