DGDemux development

User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

So it will open some sample files I downloaded but fails on anything from a UHD bluray. Any ideas?
DAE avatar
Guest

Re: DGDemux development

Post by Guest »

Did you try to Import as Raw Data?
Worked on my system
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

It may appear to work. But raw data is uncompressed and raw with no metadata. A THD file is not that. You can read anything as raw!
DAE avatar
Guest

Re: DGDemux development

Post by Guest »

Well I found this
https://forum.audacityteam.org/viewtopic.php?t=88387
Seems there is a size issue, apparently it will only open smaller thd (size) files
Also ffmpeg plugin 2.2.2 does not support "thd atmos"
DAE avatar
Guest

Re: DGDemux development

Post by Guest »

Quick test
BluRay thd track with no atmos 2.38 GB opens fine
UHD thd track with atmos 4.00 GB does not open
UHD thd track with atmos 3.49 GB does not open
Issue does appear to be atmos
User avatar
MeteorRain
Posts: 130
Joined: Fri Jul 25, 2014 4:04 pm
Location: New Jersey

Re: DGDemux development

Post by MeteorRain »

Kindly remind that you mis-wrote someone as me in the binary update ;)
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

MeteorRain wrote:
Wed Apr 01, 2020 5:24 am
Kindly remind that you mis-wrote someone as me in the binary update ;)
Fixed. Thank you for alerting me.
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

Yes, my research confirms it is caused by the atmos. I wonder if what domy did was convert to flac using a recent ffmpeg and then rename it as file.thd_. You see that _ in his audacity screenshot. I will try it this way.
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

Or maybe he used ffmpeg to just strip the atmos. I know that can be done but don't have a command line for it. Anybody?
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

OK, I found a working command line:

ffmpeg -i file.thd -c:a copy -bsf:a truehd_core out.thd

Now out.thd can be opened by audacity (with ffmpeg installed). Here are the timings I get for Monsters:

video: 6258.425 seconds
embedded ac3 (corrected by gaps processing): 6258.432 (good sync to video, 7ms async by end of stream)
truehd: 6258.528 (bad async of 103ms by end of stream)

The truehd is out of sync and so it is clear that I need to implement gaps processing for THD. It may also be interesting to add an option to DGDemux to strip the ATMOS on demuxing.
DAE avatar
domy
Posts: 28
Joined: Fri Mar 20, 2020 10:50 am

Re: DGDemux development

Post by domy »

I used eac3to to rip the THD from the m2ts and convert it to mono flac, so that I could open it up in Audacity and easily compare multiple segments/streams. For example:

Code: Select all

eac3to "BDMV\STREAM\00055.m2ts" 2: 1_55.flac -mono
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

I see, thank you. Try my method. It's much faster and doesn't re-encode.

Working on THD gaps correction. It's not straightforward due to the embedded AC3 and the major/minor frames distinction.
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

I have it working but have to double check that the embedded AC3 is not getting hit due to a small technical matter. The durations I get are now:

video: 6258.418 seconds
thd: 6258.420 seconds

Sync is spot on all the way through. So that looks pretty good. :D
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

Released THD gaps processing in slipstream 22. Makes mincemeat out of MONSTERS_UNIVERSITY!
User avatar
Bullwinkle
Posts: 338
Joined: Thu Sep 05, 2019 6:37 pm

Re: DGDemux development

Post by Bullwinkle »

OK guys, Rocky is busy on something or other so I'm gonna finish off the garbage skipping feature. Our test disk is CROUPIER reported by mini-moose. Love that nick by the way. Nobody calls me mini! :lol:
User avatar
Bullwinkle
Posts: 338
Joined: Thu Sep 05, 2019 6:37 pm

Re: DGDemux development

Post by Bullwinkle »

OK, all done! Rocky, can you put a notice in the binaries update thread, please?
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

Will do. Thank you so much, Bullwinkle!
DAE avatar
domy
Posts: 28
Joined: Fri Mar 20, 2020 10:50 am

Re: DGDemux development

Post by domy »

Thank you so much for implementing THD gaps correction! :bravo:

I'm trying to re-check the THD audio stream of some of my Pixar blu-rays with the new version, but ffmpeg/eac3to now fails to decode the THD stream due to checksum errors (is that something that can be fixed?). Your ffmpeg command to remove Atmos doesn't seem to work for me; I just get "Unable to find a suitable output format for 'truehd_core'". Which ffmpeg version did you use?

ffmpeg 2.2.2 (the one Audacity wants):

Code: Select all

.\ffmpeg.exe -i "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd" -bsf:a truehd_core -c:a copy "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms CORE.thd"
ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on May 22 2014 19:56:44 with gcc 4.8.2 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[truehd @ 00ee7780] major sync info header checksum error
    Last message repeated 56411 times
[truehd @ 00eeea60] Could not find codec parameters for stream 0 (Audio: truehd, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd: could not find codec parameters
Conversion failed!
ffmpeg 4.2.2 (latest):

Code: Select all

ffmpeg -i "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd" -bsf:a truehd_core -c:a copy "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms CORE.thd"
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, truehd, from 'C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: truehd, 48000 Hz, 7.1, s32 (24 bit)
[NULL @ 0000015da1a06980] Unable to find a suitable output format for 'truehd_core'
truehd_core: Invalid argument
eac3to:

Code: Select all

C:\Users\domin\Desktop\dgdemux_output\toy-story-4>"C:\Program Files (x86)\eac3to\eac3to.exe" "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd" "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd_.flac" -mono -progressnumbers -log="C:\Program Files (x86)\eac3to\UsEac3To.log"
TrueHD (Atmos), 7.1 channels, 48kHz, dialnorm: -28dB
Removing TrueHD dialog normalization...
Decoding with libav/ffmpeg...
Encoding FLAC with libFlac...
Creating file "C:\Users\domin\Desktop\dgdemux_output\toy-story-4\00800 PID 1100 48000 8ch eng DELAY 0ms.thd_.flac"...
process: 1%
[truehd @ 00032fc0] End of stream indicated.
[truehd @ 00032fc0] Lossless check failed - expected 00, calculated d6.
The libav decoder reported error -1094995529 while decoding.
I've got a small feature suggestion as well: Maybe add a "Remove dialog normalization" switch/option? I think that would be a nice quality-of-life option.
User avatar
Sherman
Posts: 577
Joined: Mon Jan 06, 2020 10:19 pm

Re: DGDemux development

Post by Sherman »

Wow, thanks so much for the feedback, domy (you are a hero for me). I have to take my nap right now but when I wake up we'll get this sorted out for you.
Sherman Peabody
Director of Linux Development
User avatar
Rocky
Posts: 3607
Joined: Fri Sep 06, 2019 12:57 pm

Re: DGDemux development

Post by Rocky »

Go for it, Sherman! Let's see how the young man does on this. Sweet dreams!
User avatar
Bullwinkle
Posts: 338
Joined: Thu Sep 05, 2019 6:37 pm

Re: DGDemux development

Post by Bullwinkle »

Thinking is not optional, Sherman.

Domi, Levi has a message for you:

https://www.youtube.com/watch?v=qXavZYeXEc0
User avatar
Natasha
Posts: 150
Joined: Wed Nov 20, 2019 11:11 am

Re: DGDemux development

Post by Natasha »

You people are demented. Mr. Big will not like this.
User avatar
Curly
Posts: 715
Joined: Sun Mar 15, 2020 11:05 am

Re: DGDemux development

Post by Curly »

It's the heart that sings.
Curly Howard
Director of EAC3TO Development
User avatar
Natasha
Posts: 150
Joined: Wed Nov 20, 2019 11:11 am

Re: DGDemux development

Post by Natasha »

Cry me a river.

Image
User avatar
Boris
Posts: 92
Joined: Sun Nov 10, 2019 2:55 pm

Re: DGDemux development

Post by Boris »

Listen up! We got big shipment from Wuhan:

* masks
* gowns
* gloves
* test kits

And big clearance special on dog meat! Send PM for details. We are here for you.
Post Reply