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.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th October 2018, 09:45   #14721  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,167
This is the link I posted earlier: https://developer.apple.com/library/...TFFAppenG.html
Apple's AAC encoder uses 2112 samples of delay. At 48 kHz that's exactly 44ms. If you use QAAC it confirms this.

(Of course we still can't be 100% sure that's what they use for their streaming but it's the best guess until someone has a properly decrypted sample.)
sneaker_ger is offline   Reply With Quote
Old 18th October 2018, 10:29   #14722  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,167
Quote:
Originally Posted by sneaker_ger View Post
Quote:
Originally Posted by justnobody View Post
and we demux this file with eac3to and put them (all tracks) together again with mkvtoolnix, delay is gone, 0ms now
If you demux to "raw" (ADTS) AAC there is no way to store the delay infos that mkv or mp4 container can store. It is lost. You will introduce a slight delay (here: -5ms). MediaInfo doesn't know this. It is not an AI that analyzes e.g. speech to mouth movement of video but only looks at the delay values stored in the container (mkv/mp4).
@justnobody
One thing I forgot to add:
When you extract certain audio formats with eac3to it will delete/add audio frames to preserve the delay value of the source container as best as possible (within length of 1 audio frame). The eac3to log should tell you if that happens. Not sure if that works with AAC as eac3to's AAC handling seems to be very limited.
sneaker_ger is offline   Reply With Quote
Old 18th October 2018, 13:43   #14723  |  Link
Dulus_No
Registered User
 
Join Date: Sep 2016
Posts: 8
Quote:
Originally Posted by mkver View Post
You are making presumptions about the aac encoder delay that needn't be true. Not every aac encoder has a delay of 2 frames. The best bet would probably to test Apple's AAC encoder. Or maybe Dulus_No knows a bit more about this?
[Edit]: This and this both suggest 2112 samples which are exactly 44ms. You knew that, didn't you?
[Edit2]: Yes, you did. Of course you did.
The same delay shows up not only on AAC tracks but also on AC3 (video has a +42ms / 1 frame delay). mp4dump of original m4v with drm and decrypted with TunesKit m4v.
Dulus_No is offline   Reply With Quote
Old 18th October 2018, 14:09   #14724  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,167
Ok, so only one edts/elst with "media time" != 0.
sneaker_ger is offline   Reply With Quote
Old 18th October 2018, 21:20   #14725  |  Link
arrgh
Registered User
 
Join Date: Dec 2007
Posts: 102
Quote:
Originally Posted by sneaker_ger View Post
There are 2 ways to store Dolby Vision. One as SEI messages in the base video stream. On Blu-Ray it seems they use a second "track" instead. As you say there isn't really any way to "properly" copy that into mkv yet.
yes, I see a second Video track...

https://www.bilder-upload.eu/bild-d1...93458.jpg.html

so, that means it is relly a second independant track and not something like a "forced pgs" which sometimes comes as an individual track, sometimes enbedded in a general track where some frames are marked as forced...
or, in other words, the contend of this track is not also included in the first video stream; to maintain the complete data one would need to mux the second track into a container?
there are also no other containers (instead of mkv) which could be used for this and enable rederers like madVR to use the data?

Last edited by arrgh; 18th October 2018 at 21:27.
arrgh is offline   Reply With Quote
Old 18th October 2018, 21:29   #14726  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,167
I don't know any free software that supports Dolby Vision. (This includes madVR.)
sneaker_ger is offline   Reply With Quote
Old 30th October 2018, 23:48   #14727  |  Link
killerpot
Registered User
 
Join Date: Sep 2014
Posts: 4
wav bug in eac3to !! only version 3.24 old one dont bug! HELP PLZ!

eac3to wav to ac3 bug in v3.34 and all other version i try 3.27,3,29,3.30,3.31,3.34 and others all bug

only old one 3.24 not bug!!
bug 3.34 and other give this error: proof here https://puu.sh/BTB58/7697ab92ae.mp4 (3,34 for this example)

aborded at file position 262144 !!! spend 6 hour try fix that nothing work i try all king of thing

different folder location just in case not work and other thing i try PLZ HELP ME SOMEONE!

why eac3to 3.24 work???
eac3to wav to ac3 only work! with v3.24
check the proof here https://puu.sh/BTAUz/8be7a5e60d.mp4

FILE HERE ON GOOGLE DRIVE (FOR TESTING) vff.wav
https://drive.google.com/open?id=1aB..._kJdA4CA_G74Wa

some one can test it and help me plz! i want to know what is the probleme annoy me so much thx!

in 3.34 the only time it's work it's making this line "eac3to vff.wav vff.ac3 -resampleTo48000 -down16

-448" WHY EAC3TO SHOULD WORK WITH 44,1 KHZ RIGHT? it's work in 3.24!
killerpot is offline   Reply With Quote
Old 31st October 2018, 03:14   #14728  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,436
@killerpot

I can reproduce the bug but the Aften encoder included in eac3to is deprecated, use ffmpeg instead without problems:

ffmpeg.exe -i vff.wav -acodec ac3 -center_mixlev 0.707 -ab 448k vff.ac3
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 31st October 2018, 09:20   #14729  |  Link
killerpot
Registered User
 
Join Date: Sep 2014
Posts: 4
but the problem i hate ffmpeg if you try to encode ac3 in audacity (ffmpeg audacity version) your ac3

will be a shit for shure.and the command are more complicated in ffmpeg.question #1 what this does
-center_mixlev 0.707 (its and 5,1 wav to ac3 i wanna encode)

question #2 no other freeware are better then aften to encode ac3.but a question did ffmpeg use aften in

their thing to encode ac3 ?

question #3 i think in the past eac3to tell he encode with aften my ac3 and now that tell libaften do

you know if it's the case ?

question#4 if it's the case what the difference between aften and libaften ?
killerpot is offline   Reply With Quote
Old 31st October 2018, 10:59   #14730  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,436
1) By default ffmpeg put in ac3 header a value of -center_mixlev 0.595, the correct default is 0.707 to avoid low dialog volume if downmixed to stereo.

2) The ac3 encoder in ffmpeg is a improved aften encoder (by the same developer Justin Ruggles)

3) eac3to always use libaften.dll to encode ac3, but you can use pipe to encode with aften.exe. Or better use Aften directly:

aften vff.wav vff.ac3

(defaults: -b 448 for 5.1, -cmix 0 [= -3.0 dB = 0.707], -readtoeof 1 only needed if wav > 4 GB, -pad 0 to avoid 5.3 ms of delay)

4) Don't exist differences between aften and libaften, here seems a eac3to bug when call libaften with a 44.1KHz source.

If the command are complicated for you use my UsEac3to GUI and the A/V Recode option to use ffmpeg for ac3 recode directly.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 1st December 2018, 01:14   #14731  |  Link
Masutin
Registered User
 
Join Date: Oct 2009
Posts: 22
To convert to mono, what more options are required to avoid the error 'No channel mapping to AAC defined'?
Code:
stdout.wav -mono | QAAC
Masutin is offline   Reply With Quote
Old 1st December 2018, 02:27   #14732  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,436
stdout.wav -mono -simple | QAAC

Work with a simple wav header, with a WAVE_FORMAT_EXTENSIBLE header (default) the channel mask can be other than 4 (mono center channel).

Remember: the undocumented switch "-mono" extract the center channel from a multichannel input or left channel from stereo input, don't make a downmix from input channels.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 10th December 2018, 21:11   #14733  |  Link
Lyle_JP
Unreasonable User
 
Lyle_JP's Avatar
 
Join Date: Nov 2003
Posts: 212
Quote:
Originally Posted by tebasuna51 View Post
1) By default ffmpeg put in ac3 header a value of -center_mixlev 0.595, the correct default is 0.707 to avoid low dialog volume if downmixed to stereo.
I always use
Code:
-dialnorm -27
on my ffmpeg ac3 encodings. Does that do the same thing, or should I also add
Code:
-center_mixlev 0.707
?
Lyle_JP is offline   Reply With Quote
Old 10th December 2018, 21:38   #14734  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,729
The "Dialog Normalization" and the "Center Mix Level" are independent parameters.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 10th December 2018, 22:42   #14735  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,436
Quote:
Originally Posted by Lyle_JP View Post
I always use -dialnorm -27
Always?
Not all sources need that parameter.
My recommendation is let the ffmpeg default -31

Quote:
or should I also add -center_mixlev 0.707?
Like LigH say is not the same.

Here I recommend use 0.707, default used by Dolby, instead the ffmpeg default 0.595.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 11th December 2018, 19:22   #14736  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 230
Quote:
Originally Posted by tebasuna51 View Post
Here I recommend use 0.707, default used by Dolby, instead the ffmpeg default 0.595.
Does the appropriate value for -center_mixlev vary from source to source (in the way that -dialnorm does) or is it always a matter of preference?
Richard1485 is offline   Reply With Quote
Old 11th December 2018, 22:20   #14737  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,436
Of course if there are options is because it can vary.

I only recommend defaults without analyze the source.
For instance when recode soundtracks from others formats.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 12th December 2018, 14:52   #14738  |  Link
Richard1485
Registered User
 
Join Date: Feb 2010
Posts: 230
Quote:
Originally Posted by tebasuna51 View Post
Of course if there are options is because it can vary.
Yes, or because there are preferences.

Quote:
Originally Posted by tebasuna51 View Post
I only recommend defaults without analyze the source.
Understood. Thanks, tebasuna!
Richard1485 is offline   Reply With Quote
Old 13th December 2018, 19:35   #14739  |  Link
GCRaistlin
Registered User
 
GCRaistlin's Avatar
 
Join Date: Jun 2006
Posts: 252
madshi, can you please take a look at this bug: http://bugs.madshi.net/view.php?id=377
__________________
Magically yours
Raistlin
GCRaistlin is online now   Reply With Quote
Old 15th December 2018, 08:03   #14740  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,291
Same here:

Code:
eac3to.exe valerian.m2ts 2: c:\video\temp.pcm -down6
MKV, 1 video track, 2 audio tracks, 3 subtitle tracks, 2:17:25, 24p /1.001
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: TrueHD (Atmos), English, 7.1 channels, 48kHz, 2419ms
   "TrueHD Atmos 7.1"
3: AC3 EX, English, 5.1 channels, 640kbps, 48kHz, 2419ms
   "AC-3 5.1-EX"
4: Subtitle (PGS), English, "English (Forced)"
5: Subtitle (PGS), English, "English (SDH)"
6: Subtitle (PGS), German, "German"
a02 Extracting audio track number 2...
a02 Decoding with libav/ffmpeg...
a02 Applying RAW/PCM delay...
a02 Mixing surround channels...
a02 Swapping endian...
a02 Remapping channels...
a02 Creating file "c:\video\temp.pcm"...
----[truehd @ 026336c0] Lossless check failed - expected 00, calculated c1.
[truehd @ 026336c0] Lossless check failed - expected 00, calculated 46.
[truehd @ 026336c0] Lossless check failed - expected 00, calculated 34.
--[truehd @ 026336c0] Lossless check failed - expected 00, calculated 24.
-[truehd @ 026336c0] Lossless check failed - expected 00, calculated 5b.
[truehd @ 026336c0] Lossless check failed - expected 00, calculated 81.
[truehd @ 026336c0] Lossless check failed - expected 00, calculated 83.
------------[truehd @ 026336c0] Lossless check failed - expected 00, calculated e7.
-[truehd @ 026336c0] Lossless check failed - expected 00, calculated 3b.
--[truehd @ 026336c0] Lossless check failed - expected 00, calculated e2.
-[truehd @ 026336c0] Lossless check failed - expected 00, calculated 96.
[truehd @ 026336c0] Lossless check failed - expected 00, calculated 78.
This is with a brand new Blu-ray (Valerian and the City of a Thousand Planets).


Thing is, I'd love to use ffmpeg directly, but I can't extract the Atmos stream with tsMuxer first (as it doesn't recognize it).
__________________
Gorgeous, delicious, deculture!

Last edited by asarian; 15th December 2018 at 08:15. Reason: Typo
asarian is offline   Reply With Quote
Reply

Tags
eac3to

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.