HydrogenAudio

Lossy Audio Compression => AAC => AAC - General => Topic started by: 141077 on 2011-11-01 17:44:31

Title: DTS or AC3 to AAC
Post by: 141077 on 2011-11-01 17:44:31
Hello there!

I'm from Germany so please excuse me if my english isn't very well. I currently work on something for my university. I'm gonna right down the process of converting an HD .mkv file to an iTunes friendly .m4v. The goal will be to have a file at the end which can be played on most Apple devices. So when there's one 5.1 audio track as a DTS or AC3 file in the mkv I want to have one 5.1 AAC audio track and one in stereo for the mobile devices. In the last two days I've been looking around for the best options and encoders in this forum and in the wiki, but I'm not quite sure what to use and what's even more important: why I should use that?

For this process I'll use a mac. I've read that the Nero Encoder give the best results but since it doesn't excepts .dts or .ac3 files I don't know what I could do. Should I convert the .dts file f.e. first into another format so that NeroAAC would recognize it? Wouldn't that mean a loose of Quality? That's by the way also a very important thing for my work. To know what would be the best options in the encoder and to know how big the quality loss could be etc.

I hope you can point me into some directions and tell me something relevant for my topic. Have a good night everyone!
Title: DTS or AC3 to AAC
Post by: mixminus1 on 2011-11-01 18:35:59
Well, first off, you say you're using a Mac, but then say you want to use Nero's AAC encoder, which is only available for Windows - so, which is it?

The only utility for OS X that I'm aware of that might be able to do what you want in one step is ffmpegX (http://homepage.mac.com/major4/), but I haven't used it in quite some time as it was always very buggy when I tried to use it.

Can you run WINE, i.e. Windows under OS X?  If so, eac3to (http://forum.doom9.org/showthread.php?t=125966) might be able to do pretty much exactly what you want very easily (and reliably!).  I say "might" as I've never tried it under WINE.  However, eac3to is essentially a stand-alone program, so it seems like it would be a good candidate for successful operation under WINE.

It can decode any surround format (although I think it still may have some channel-mapping issues with 7.1 DTS-HD, not sure), can output multichannel or stereo mixdown, and can easily pipe to neroAacEnc.exe for on-the-fly AAC encoding.

The only caveat is that I don't think it can output multichannel and stereo AAC files simultaneously - you'll have to do two encodes for each source file, or launch parallel instances (which should work, but I've never tried it).
Title: DTS or AC3 to AAC
Post by: 141077 on 2011-11-01 18:49:39
Well, first off, you say you're using a Mac, but then say you want to use Nero's AAC encoder, which is only available for Windows - so, which is it?

Oh yeah sorry I forgot to mention that. I was planning on using the Nero Encoder with WINE yes. I have WINE already installed. I don't know if it'll work with eac3to (I think I've read somewhere that this isn't possible) but I'll try now and tell you. Thank you
Title: DTS or AC3 to AAC
Post by: Kohlrabi on 2011-11-01 19:59:29
I suggest to use foobar2000 (http://www.foobar2000.org/) in wine, with the DTS (http://www.foobar2000.org/components/view/foo_input_dts) and AC3 (http://www.foobar2000.org/components/view/foo_ac3) decoder components. Please be aware that the DTS decoder has problems with DTS-HD (found on some BD sources), at least as far as I know. You can then easily set up Nero AAC to be used in foobar2000's converter to convert your files. Or you could convert your files to AIFF or WAV and encode them with the Nero commandline encoder directly or use Apple's Quicktime encoders, which for low bitrates produce better results than Nero (http://listening-tests.hydrogenaudio.org/igorc/aac-96-a/results.html).
Title: DTS or AC3 to AAC
Post by: mixminus1 on 2011-11-01 20:21:49
FWIW, if eac3to works under WINE, it can read .mkv files directly, eliminating the demuxing step that would be necessary with fb2k.
Title: DTS or AC3 to AAC
Post by: Kohlrabi on 2011-11-01 20:27:35
foobar2000 can in fact read MKV files, but I as far as I know only reads the first audio track.
Title: DTS or AC3 to AAC
Post by: 141077 on 2011-11-01 22:09:40
I suggest to use foobar2000 (http://www.foobar2000.org/) in wine, with the DTS (http://www.foobar2000.org/components/view/foo_input_dts) and AC3 (http://www.foobar2000.org/components/view/foo_ac3) decoder components. Please be aware that the DTS decoder has problems with DTS-HD (found on some BD sources), at least as far as I know. You can then easily set up Nero AAC to be used in foobar2000's converter to convert your files. Or you could convert your files to AIFF or WAV and encode them with the Nero commandline encoder directly or use Apple's Quicktime encoders, which for low bitrates produce better results than Nero (http://listening-tests.hydrogenaudio.org/igorc/aac-96-a/results.html).


Wow, that's it! I didn't even dare to think foobar2000 would work with WINE don't know why. I just tested it and converted a dts to an m4a using the neroaacenc. Worked perfectly!  Now I have to get some information about the settings I should use. But I think I'll do that tomorrow. Someone said that for a DTS-track with a bitrate like 1500kbps anything above 384kbps in the Nero settings would be an overkill. Like the results in 384 VBR in AAC would be equivalent to the DTS-track. I have a few difficulties "understanding" this codec, especcially why 384 in VBR could bring the same results as 1500kbps. 384 in VBR doesn't mean the maximum in the VBR is 384kbps right?
Title: DTS or AC3 to AAC
Post by: kode54 on 2011-11-01 23:12:26
I think the 384 VBR setting means for stereo files, and you're converting surround files. If you want a stereo downmix, use the 5.1 to Stereo DSP filter.
Title: DTS or AC3 to AAC
Post by: 141077 on 2011-11-02 15:05:20
OK thanks for that. What I'm not getting is how can 384 kbps in VBR be as good as 1500 kbps in CBR? I don't really know what to use right now because I didn't really understand what's behind this codec and the idea of a VBR. My aac file out of a 1510 kbps DTS track goes from about 1043-1215 kbps with the options -q 1.00...
Title: DTS or AC3 to AAC
Post by: smok3 on 2011-11-02 16:06:19
(http://brontosaurusrex.69.mu/wp-content/uploads/2011/09/vans.png)
as a 2nd option you might want to check my hippy OSX ffmpeg encoder idea;
http://forum.doom9.org/showthread.php?t=162621 (http://forum.doom9.org/showthread.php?t=162621)
(you would have to write your own script for 5.1 DTS to 5.1 AAC and for 5.1 to 2ch stereo)

pros:
- osx native, x264 will use all cores (you will probably have to transcode the video at least for "mobile devices", no?)
- the final app is drag and drop (just make one for itunes and one more for "mobile devices"), also the final apps can be copy/pasted on multiple machines if needed.
- bragging rights to be able to solve things with open source tools

cons:
- there is no sbr AAC encoder in the compiles that comes with that and internal AAC encoder is not really well documented, so some major googling will be required
or you would have to compile your own version of ffmpeg with the appropriate sbr encoder (libaacplus).
- dunno in what usability stage is ffmpeg's DTS or AC3 decoder
- ffmpeg is hit and miss, so some major time waste can be expected

p.s. a nice overview if ffmpeg was compiled with libfaac
http://www.spinonesolutions.com/2010/04/ps...ng-with-ffmpeg/ (http://www.spinonesolutions.com/2010/04/ps3-h264aac-5-1-encoding-with-ffmpeg/)
Title: DTS or AC3 to AAC
Post by: Kohlrabi on 2011-11-02 18:42:07
I just realised that if the intention is to convert MKV to Apple-compliant MP4 files that Handbrake (http://handbrake.fr/) should deliver good results.
Title: DTS or AC3 to AAC
Post by: 141077 on 2011-11-02 18:43:17
as a 2nd option you might want to check my hippy OSX ffmpeg encoder idea;
http://forum.doom9.org/showthread.php?t=162621 (http://forum.doom9.org/showthread.php?t=162621)

Can someone please explain me how that is possible? Are thos 384 VBR for each channel? I just can't imagine how that could be enough for a DTS track with about 1500 constant.
Title: DTS or AC3 to AAC
Post by: Kohlrabi on 2011-11-02 19:25:29
Can someone please explain me how that is possible? Are thos 384 VBR for each channel? I just can't imagine how that could be enough for a DTS track with about 1500 constant.

Just use a quality based setting if possible (implies VBR). I for one tend to use Nero at q 0.4 for my video encodes, and do not care about the resulting bitrate at all, as long as it sounds OK (like the source). Bitrate is generally no meaningful metric to compare audio quality, anyway.

If you're in doubt, you could try your hand at an ABX test (http://www.hydrogenaudio.org/forums/index.php?showtopic=16295). DTS tracks tend to be insanely huge, and at least I never found any benefit over the oftentimes 3 times smaller AC3 tracks on DVDs (modulo bad mastering).


EDIT: Removed unrelated banter.
Title: DTS or AC3 to AAC
Post by: saratoga on 2011-11-02 19:37:07
I just can't imagine how that could be enough for a DTS track with about 1500 constant.


DTS is huge because its not very efficient.  For modern codecs, 160k to 192k per stereo pair is plenty.
Title: DTS or AC3 to AAC
Post by: smok3 on 2011-11-02 21:50:59
just can't imagine how that could be enough for a DTS track with about 1500 constant.

DTS is an old and fat format and i think (but i will not claim) that 1500 is fiting to an audio cd drive (movies: timecode on the actual film, audio playing in sync from a "cd" device). Cant really recall any details about the lossy compression used.
Title: DTS or AC3 to AAC
Post by: saratoga on 2011-11-02 22:31:03
Cant really recall any details about the lossy compression used.


32 band QMF used as the transform, so its a subband coder vaguely like MP2.
Title: DTS or AC3 to AAC
Post by: smok3 on 2011-11-03 09:09:49
I just realised that if the intention is to convert MKV to Apple-compliant MP4 files that Handbrake (http://handbrake.fr/) should deliver good results.

care to define "apple-compilant"?
Title: DTS or AC3 to AAC
Post by: Kohlrabi on 2011-11-03 18:55:31
I just realised that if the intention is to convert MKV to Apple-compliant MP4 files that Handbrake (http://handbrake.fr/) should deliver good results.

care to define "apple-compilant"?

Correctly muxed MP4 with the proper x264 encoder settings, which can be read by iTunes/Quicktime or iPhones/iPods. Handbrake offers specific presets for Apple targets.
Title: DTS or AC3 to AAC
Post by: smok3 on 2011-11-03 20:22:40
quicktime takes anything this days, afaik, so handbrake doesn't really "provide" anything (actually it provides a new logical layer between user and x264, trying to be smarter than x264 itself), got it? Handbrake also provides a year old binary. p.s. And you dont have to explain anything to me, explain that to the op (i would not bother with my van app, if i thought handbrake is cute)