Page 14 of 37

Re: DGDemux development

Posted: Thu Mar 26, 2020 8:36 am
by Rocky
zqslzwzw wrote:
Sat Mar 21, 2020 7:37 am
1) With the latest DGDemux, no matter whether the option is checked, the THD stream(s) will be demuxed.
I have duplicated this for do_not_split and have it fixed locally. But I can't duplicate it for when do_not_split is not checked. Can you try that again please?
2) If the option is checked, the language property of the generated .thd file is missed, such as '00800 PID 1100.thd'.
The name should be rewritten after the file is closed (when demuxing finishes) with full info in the name. Is that not happening for you?

Re: DGDemux development

Posted: Fri Mar 27, 2020 8:45 am
by Rocky
zqslzwzw hasn't been here for a while so I am going to release the fixes that I have:

* Opening MPLS with [] characters.

* Fix always demuxes THD even when disabled for do not split mode.

The second one also needs to be done for DGIndexNV.

After that, back to DGHDRtoSDR stuff.

Re: DGDemux development

Posted: Sun Mar 29, 2020 3:05 pm
by Bullwinkle
Rocky wrote:
Sun Mar 22, 2020 11:16 am
That Monsters University is pretty insane with 135 segments.
Still waiting for the disk to arrive. Not an essential product? GTFOOH. STOMP!

Re: DGDemux development

Posted: Tue Mar 31, 2020 6:30 am
by Rocky
Monsters disc is here and being ripped right now.

Re: DGDemux development

Posted: Tue Mar 31, 2020 10:43 am
by Rocky
@domy

How did you get Audacity to open your thd file? I have Audacity 2.3.3 and ffmpeg 2.2.2, and I have set it in Preferences/Library. But still, when I try to open my thd file, it says cannot and suggests installing ffmpeg.

Audacity log:

11:32:08: File name is D:\tmp\DGDemuxGUI test\00801 PID 1100 48000 8ch eng DELAY 0ms.thd
11:32:08: Mime type is *
11:32:08: Opening with libsndfile
11:32:08: Opening with liboggvorbis
11:32:08: Opening with libflac
11:32:08: Opening with lof
11:32:08: Opening with libav
11:32:15: Error: FFmpeg: avformat_find_stream_info() failed for file D:\tmp\DGDemuxGUI test\00801 PID 1100 48000 8ch eng DELAY 0ms.thd
11:32:15: Error: can't flush file descriptor 5 (error 5: Access is denied.)
11:32:15: Error: Importer::Import: Opening failed.

Note that import of the separate embedded AC3 succeeds. Also, when opening Audacity it shows that ffmpeg was loaded.

Re: DGDemux development

Posted: Tue Mar 31, 2020 1:33 pm
by Rocky
So it will open some sample files I downloaded but fails on anything from a UHD bluray. Any ideas?

Re: DGDemux development

Posted: Tue Mar 31, 2020 2:36 pm
by Guest
Did you try to Import as Raw Data?
Worked on my system

Re: DGDemux development

Posted: Tue Mar 31, 2020 3:46 pm
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!

Re: DGDemux development

Posted: Tue Mar 31, 2020 7:47 pm
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"

Re: DGDemux development

Posted: Tue Mar 31, 2020 8:02 pm
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

Re: DGDemux development

Posted: Wed Apr 01, 2020 5:24 am
by MeteorRain
Kindly remind that you mis-wrote someone as me in the binary update ;)

Re: DGDemux development

Posted: Wed Apr 01, 2020 6:42 am
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.

Re: DGDemux development

Posted: Wed Apr 01, 2020 7:23 am
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.

Re: DGDemux development

Posted: Wed Apr 01, 2020 7:47 am
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?

Re: DGDemux development

Posted: Wed Apr 01, 2020 9:20 am
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.

Re: DGDemux development

Posted: Sun Apr 05, 2020 9:10 am
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

Re: DGDemux development

Posted: Sun Apr 05, 2020 10:55 am
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.

Re: DGDemux development

Posted: Thu Apr 09, 2020 12:19 pm
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

Re: DGDemux development

Posted: Fri Apr 10, 2020 5:30 am
by Rocky
Released THD gaps processing in slipstream 22. Makes mincemeat out of MONSTERS_UNIVERSITY!

Re: DGDemux development

Posted: Wed Apr 15, 2020 8:49 am
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:

Re: DGDemux development

Posted: Wed Apr 15, 2020 10:17 am
by Bullwinkle
OK, all done! Rocky, can you put a notice in the binaries update thread, please?

Re: DGDemux development

Posted: Wed Apr 15, 2020 10:17 am
by Rocky
Will do. Thank you so much, Bullwinkle!

Re: DGDemux development

Posted: Fri Apr 17, 2020 11:16 am
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.

Re: DGDemux development

Posted: Fri Apr 17, 2020 11:32 am
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.

Re: DGDemux development

Posted: Fri Apr 17, 2020 11:33 am
by Rocky
Go for it, Sherman! Let's see how the young man does on this. Sweet dreams!