Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
5th June 2022, 19:29 | #1 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
deew (Dolby Encoding Engine Wrapper)
Dolby Encoding Engine Wrapper deew: https://github.com/pcroland/deew (Installation instructions on the github page.) Code:
Description: - handles Dolby's XML input fuckery in the background, giving you a proper CLI interface - converts inputs to RF64 which DEE can use - bit depth, number of channels and other infos are parsed from the source - an XML file will be generated for each input based on the settings - the script utilizes thread pooling for batch encoding (see config) - supports WSL path conversion for the Windows version of DEE (see config) - in case of an invalid bitrate it will pick the closest allowed one - automatic sample rate conversion using ffmpeg's soxr resampler in case of an unsupported sample rate - for DD/DDP/AC4 unsupported rates will be converted to 48 kHz - for TrueHD unsupported rates will be converted to 48 kHz if source sample rate is lower than 72 kHz, otherwise will be converted to 96 kHz - automatic channel swapping for 7.1 sources (DEE swaps Ls Rs with Lrs Rrs for some reason) - automatic dialnorm setting - automatically compensates for DEE's 256 sample delay (DD and DDP encoding) - checks if intermediate file is already created so you can encode different formats/bitrates using a single intermediate file, for example: "deew -f dd -b 448 -i input -k" "deew -f dd -b 640 -i input -k" "deew -f ddp -i input" - works even with video inputs (first audio will be selected) - fancy terminal output using rich - versatile delay option that supports ms, s and also frame@fps formats - parsing delay from filenames Help: > deew -h deew 3.2.1 USAGE: deew [-h] [-v] [-i [INPUT ...]] [-ti INDEX] [-o DIRECTORY] [-f FORMAT] [-b BITRATE] [-dm CHANNELS] [-d DELAY] [-r DRC] [-dn DIALNORM] [-in INSTANCES] [-k] [-mo] [-fs] [-fb] [-lb] [-la] [-np] [-pl] [-cl] [-c] [-gc] FLAGS: -h, --help show this help message. -v, --version show version. -i, --input [INPUT ...] audio file(s) or folder(s) -ti, --track-index INDEX default: 0 select audio track index of input(s) -o, --output DIRECTORY default: current directory specifies output directory -f, --format FORMAT options: dd / ddp / ac4 / thd default: ddp -b, --bitrate BITRATE options: run -lb/--list-bitrates default: run -c/--config -dm, --downmix CHANNELS options: 1 / 2 / 6 specifies downmix, only works for DD/DDP DD will be automatically downmixed to 5.1 in case of a 7.1 source -d, --delay DELAY examples: -5.1ms, +1,52s, -24@pal, +10@24000/1001 default: 0ms or parsed from filename specifies delay as ms, s or frame@FPS FPS can be a number, division or ntsc / pal you have to specify negative values as -d=-0ms -r, --drc DRC options: film_light / film_standard / music_light / music_standard / speech default: music_light (this is the closest to the missing none preset) specifies drc profile -dn, --dialnorm DIALNORM options: between -31 and 0 (in case of 0 DEE's measurement will be used) default: 0 applied dialnorm value between -in, --instances INSTANCES examples: 1, 4, 50% default: 50% specifies how many encodes can run at the same time 50% means 4 on a cpu with 8 threads one DEE can use 2 threads so 50% can utilize all threads (this option overrides the config's number) -k, --keeptemp keep temp files -mo, --measure-only kills DEE when the dialnorm gets written to the progress bar this option overrides format with ddp -fs, --force-standard force standard profile for 7.1 DDP encoding (384-1024 kbps) -fb, --force-bluray force bluray profile for 7.1 DDP encoding (768-1664 kbps) -lb, --list-bitrates list bitrates that DEE can do for DD and DDP encoding -la, --long-argument print ffmpeg and DEE arguments for each input -np, --no-prompt disables prompt -pl, --print-logos show all logo variants you can set in the config -cl, --changelog show changelog -c, --config show config and config location(s) -gc, --generate-config generate a new config Last edited by pcroland; 4th January 2024 at 13:49. |
22nd August 2022, 21:31 | #2 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
Code:
deew 2.6.0: - changed default DRC to music_light, which is closer to the missing none preset: https://forum.doom9.org/showpost.php?p=1972689&postcount=136 - fixed DRC option not being applied for stereo TrueHD encodes - colorized argparse's help a little bit - renamed -t/--threads to -in/--instances to be more accurate, since one DEE instance can use 2 threads. see -h for more info deew 2.6.1: - fixed typo in help deew 2.6.2: - added additional instance clamping for Windows DEE (6), it seems like you can't do more than 6 even on a 16 thread cpu deew 2.7.0: - fixed first metavar removal for argparse's --input - fixed exception printing in threads - use a Windows path by default under WSL - temp path added to the summary - better instructions on config error deew 2.8.0: - added summary_sections to config - parsing delay from filenames too |
24th August 2022, 13:24 | #4 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
Code:
deew 2.8.1: - fixed version in tool itself deew 2.8.2: - removed m/p delay support and updated help to avoid confusion deew 2.8.3: - moved binary version parsing to another place to avoid error if binaries is set to false in config deew 2.8.4: - fixed unnecessary newlines in argparse deew 2.8.5: - fix spelling in override everywhere - use custom pyinstaller build to avoid anti-viruses going crazy |
9th September 2022, 16:07 | #7 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 7,075
|
Thanks, I test some encodes with:
deew -f ddp -k -la -dn -31 -np -b 448 -i input.wav deew -f thd -k -la -dn -31 -np -i input.wav Some tips: -k (preserve intermediate files .xml and rf64 and next encode don't recreate them): Code:
Intermediate already exists && dee -x C:\Portable\0\temp/input.xml With 7.1 deew make always the remap between SL-SR <-> BL-BR with the fake channelmask (FL FR FC LF BL BR SL SR) But if source is (FL FR FC LF SL SR TFL TFR) the remap is not necesary, see https://forum.doom9.org/showthread.p...64#post1963264 But DEE ignore the channelmask and output a eac3/thd stream (L R C LFE Ls Rs Rls Rrs) instead the correct (L R C LFE Ls Rs Vhl Vhr) like Audition 2017 can do and my AVR play fine. -r none don't work (like you say): Code:
ERROR: allowed DRC values: film_light, film_standard, music_light, music_standard, speech. - la (I don't see differences using it) -dn -31 (like is the recommended value to override attenuation with decoders/players bad configurated) ask: Code:
Consider leaving the dialnorm value at 0 (auto), setting it manually can be dangerous, are you sure you want to do it? [y/n]:
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 10th September 2022 at 02:08. Reason: typo |
9th September 2022, 21:23 | #8 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
I didn't say -r none works, DEE doesn't have a "none" preset and it's not listed in the --help either. If someone could implement DRC bit editing in Python it would be appreciated.
-la, --long-argument prints the ffmpeg and dee commands for each input with visible path names ("Intermediate already exists &&" means it skips the intermediate generation because there already is one), by default the ffmpeg and dee commands are printed with an "[input]" instead of the paths once (before that it lists the files where an intermediate file already exists) I don't know what you mean. |
10th September 2022, 01:51 | #9 | Link |
Moderator
Join Date: Feb 2005
Location: Spain
Posts: 7,075
|
I only want expose the problems, not for your wrapper but for the DEE encoder itself.
I read the DEE docs and I don't know how select the NONE DRC preset or the (FL FR FC LF SL SR TFL TFR) channel map 3D 5.1.2, much more usefull than (L R C LFE Ls Rs Rls Rrs) only 2D sound 7.1, than can be emulated with 5.1 without differences. By the moment the certified encoder in Audition 2017 is the best EAC3 encoder for me.
__________________
BeHappy, AviSynth audio transcoder. Last edited by tebasuna51; 10th September 2022 at 02:07. Reason: typo |
29th September 2022, 04:39 | #10 | Link |
Registered User
Join Date: Feb 2020
Posts: 552
|
Can you encode this 16 bit flac with TrueHD dolby encoder? I do not like how ffmpeg encoder produces quite horrible artifacts on my LG C9 HW decoder. I think it is a bug, even though it is lossless with our ffmpeg decoder.
The song has some quite crazy sounds. https://0x0.st/o4aU.%20%D0%9D%D0%B8%...BB%D0%B0%D0%B9 Does dolby encoder support mono? Can you reencode this? https://trac.ffmpeg.org/ticket/1726 You can use this: https://0x0.st/o9S0.flac Last edited by tebasuna51; 29th September 2022 at 15:15. Reason: double post |
29th September 2022, 05:26 | #11 | Link | |
SuperVirus
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,393
|
Quote:
F.W.I.W., the MLP/TrueHD encoder of ffmpeg has always generated files that are LARGER than the ones created by the old Surcode and the new Dolby compressors :-/ So I suppose that even though those files may be technically-correct or spec-compliant, this doesn't mean they will always be happily-accepted or correctly-decompressed by the ""certified"" decoders :-/ UPDATE: https://forum.doom9.org/showthread.p...68#post1975568
__________________
«Your software patents have expired.» Last edited by filler56789; 29th September 2022 at 06:21. Reason: . |
|
29th September 2022, 06:18 | #12 | Link |
SuperVirus
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,393
|
@Balling:
that FLAC is sampled at 44.1 kHz and maybe your device expects only 48 kHz (or higher) inputs Did you resample it to 48 kHz before compressing to THD with ffmpeg?
__________________
«Your software patents have expired.» |
30th September 2022, 11:56 | #14 | Link |
Registered User
Join Date: Mar 2014
Location: Hungary
Posts: 115
|
https://envs.sh/QK0.thd
encode_to_dthd: Unsupported channel number: 1. |
30th September 2022, 12:36 | #15 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,248
|
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
Last edited by SeeMoreDigital; 30th September 2022 at 12:39. |
30th September 2022, 13:33 | #16 | Link |
SuperVirus
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,393
|
Speaking in general, it seems the DLLs and EXEs of Dolby's Encoding ""Engine"" suck by design :-/
F.W.I.W: adding the line "<custom_dialnorm>-31</custom_dialnorm>" to the XML configuration file apparently avoids the undesired dialnorm thing. Still, no way to set the DRC value to "none".
__________________
«Your software patents have expired.» |
30th September 2022, 14:16 | #17 | Link | |
Registered User
Join Date: Feb 2020
Posts: 552
|
Quote:
Compare to this, encoded with ffmpeg, the artefacts start as soon as chorus starts on 0:01:02 and do not happen if you decode with PC, only when lavfilter bitstreams: https://0x0.st/o4Vg.%20%D0%9D%D0%B8%...BB%D0%B0%D0%B9 What is also strange is that this thd is two times smaller. And reencoding your file is bigger, so I suppose it dithers to 24 bit. And yes, reencoding still produces artefacts while bitstreaming, so BUG IN FFMPEG (or LG people never tested no normalisation metadata file). Last edited by Balling; 30th September 2022 at 14:27. |
|
30th September 2022, 16:31 | #18 | Link |
SuperVirus
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,393
|
@Balling:
https://www.mediafire.com/file/53xvp...kolai.rar/file The archive contains both the "raw" THD stream and a conveniently-indexed MKA file. eac3to says only "TrueHD, 2.0 channels, 48kHz", so I presume the file has no dialog normalization actually :-|
__________________
«Your software patents have expired.» Last edited by filler56789; 30th September 2022 at 16:33. Reason: clarity |
2nd October 2022, 22:25 | #20 | Link |
Registered User
Join Date: Feb 2020
Posts: 552
|
>so I presume the file has no dialog normalization actually :-|
Dialnorm MAY BE present, but it will be only applied in Plex decoder (again TrueHD decoder in ffmpeg does not support DRC) if Dolby media encoder was "DRC default on" ON AND if you do not set -31 Last edited by Balling; 2nd October 2022 at 23:04. |
Thread Tools | Search this Thread |
Display Modes | |
|
|