View Full Version : anyone compiled and tried dcaenc ?
Selur
19th December 2011, 15:44
Just stumbled over http://aepatrakov.narod.ru/dcaenc/ and was wondering if someone compiled and tried it.
So if anyone has some experience to share please do so. :)
Cu Selur
Kurtnoise
19th December 2011, 15:58
same experimental encoder uses in ffmpeg/avconv tools...
amtm
19th December 2011, 17:35
No this is a new one as the blog post here (http://patrakov.blogspot.com/2011/09/i-wrote-dts-encoder.html) points out.
The DTS "encoder" in FFmpeg was ported by someone else from my old proof-of-concept code that served as a tool to understand the DTS subband transform. It could only encode stereo PCM files into a valid DTS bitstream of the same bitrate, which is useless for any practical purpose. Now dcaenc provides a useful encoder that accepts multichannel sound and encodes it to the bitrate specified by the command line parameter.
Midzuki
19th December 2011, 18:32
OK, since "nobody" :devil: cares... :D
Downloaded the dämn source code, configured, compiled dcaenc.exe and gentables.exe, and...
- CONs:
does not have a progress indicator ;
it's slooow :rolleyes:
-PROs
it works :) ( or at least I think so :p )
Tested sample = an ordinary CDDA track (stereo, 16-bits, 44.1kHz)
Resulting output (@576kbps) = plays fine with Mplayer
:cool: :cool: :cool:
amtm
19th December 2011, 19:14
What about playback using something other than mplayer? Do you have the Arcsoft decoder you could test a sample with? I'd try but I'm not at home right now.
Kurtnoise
19th December 2011, 19:16
No this is a new one as the blog post here (http://patrakov.blogspot.com/2011/09/i-wrote-dts-encoder.html) points out.
your quote is outdated...it produces multichannel (only 5.0 & 5.1) as well.
amtm
19th December 2011, 19:18
Great but still doesn't change that this is a new encoder which is not part of ffmpeg as the author points out.
amtm
19th December 2011, 19:23
The key words: The DTS "encoder" in FFmpeg was ported by someone else from my old proof-of-concept code
So even if the encoder in ffmpeg/avconv now has 5.1 or 5.0 support doesn't change the fact that this NEW encoder is not the same one you mentioned as he explicitly points out.
Kurtnoise
19th December 2011, 19:31
just compare by yourself instead of writing...
amtm
19th December 2011, 20:43
just compare by yourself instead of writing...
I did compare the source which is how I know they aren't the same thing. The current encoder as linked in the blog post is dtsenc (http://gitorious.org/dtsenc/dtsenc/trees/master) which even with a cursory glance is obvious it's not the same encoder as in ffmpeg. It's been significantly modified since ffmpeg integrated and changed his original code from 2008.
Midzuki
19th December 2011, 21:21
What about playback using something other than mplayer? Do you have the Arcsoft decoder you could test a sample with? I'd try but I'm not at home right now.
Currently my home PC still is a mess :( which means the DirectShow environment (read: codecs and splitters) has not been optimized yet ( because I'm too lazy, yes :o ). I haven't even re-installed foobar2000 yet :eek:
Still, with or without Mplayer :) the program dcaenc.exe needs to be tested "exhaustively" :devil: This will include samples @32kHz, 5.1@44.1kHz@REAL1411kbps (i.e., without SPDIF-padding), Back-Center channel properly-flagged, etc, whatever :)
amtm
19th December 2011, 22:36
That's okay just curious. I still need to give it a good testing. I've only had time to glance around the source so far. If only for 2.0 and 5.1, since I don't believe it yet can do more than 6 channels, it sounds like it could be great for fixing the broken silence frames issue in delaycut.
Midzuki
20th December 2011, 02:05
...
...
it could be great for fixing the broken silence frames issue in delaycut.
That's a good point. AVI-Mux GUI might use it as well
( however nobody but Alex Noe himself would want to rewrite and recompile the source-code, apparently :( )
Anyway, more good news: foobar2000 likes dcaenc :p
LoRd_MuldeR
20th December 2011, 14:46
@Midzuki:
What build environment did you use to make the Win32 build? MSYS+MinGW?
If so, could you give me some advice on how to properly setup 'autoreconf' under that environment?
It fails for me with:
MuldeR@MULDER-PC /d/SVN/Tools/dtsenc
$ autoreconf -f -i -v
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
/bin/m4: unrecognized option `--gnu'
Try `/bin/m4 --help' for more information.
autom4te-2.68: failed to run /bin/m4: Bad file number
aclocal: /usr/bin/autom4te-2.68 failed with exit status: 1
autoreconf: failed to run aclocal: Bad file number
MuldeR@MULDER-PC /d/SVN/Tools/dtsenc
$
(BTW: My plan is to hack in a progress-indicator and Win32 Unicode support)
:thanks:
amtm
20th December 2011, 15:39
That's a good point. AVI-Mux GUI might use it as well
( however nobody but Alex Noe himself would want to rewrite and recompile the source-code, apparently :( )
Is it really that bad? :p :D Maybe I'll give it a look over one of these days amongst all the other projects I have going on. :p
Midzuki
20th December 2011, 15:58
@Midzuki:
What build environment did you use to make the Win32 build? MSYS+MinGW?
Yesss :)
gcc.exe (XvidVideo.RU - GCC 4.5.2 i686-pc-mingw32) 4.5.2
Also, and IIRC :o ,
"./configure --disable-alsa"
(BTW: My plan is to hack in a progress-indicator and Win32 Unicode support)
YAY! :cool:
Midzuki
20th December 2011, 16:01
Is it really that bad? :p :D
Well, I still haven't seen any "AVI-Mux GUI Mod" builds :p
Maybe I'll give it a look over one of these days amongst all the other projects I have going on. :p
:thanks:
LoRd_MuldeR
20th December 2011, 16:01
Well, my problem is, that I don't have a 'configure' script yet. It needs to be generated with autoconf.
Can you tell me what version of autoconf (and from where) you used? I installed autoconf + perl + libcrypt, but get the error from above :(
Midzuki
20th December 2011, 16:09
Humm, that's weird :confused:
IIRC (again), I just downloaded the full package from Xhmikosr's site some months ago, and (probably) just discarded the 64-bit stuff.
Anyway:
$ autoconf --version
autoconf (GNU Autoconf) 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
Hope this helps :o
LoRd_MuldeR
20th December 2011, 17:13
Okay, the good news is: I got autoconf working by re-installing MSYS with the official MSYS installer.
The bad news is that the configure script it produces is broken. At one point it uses some PKG_PROG_PKG_CONFIG variable that nowhere has been define before :rolleyes:
Had to hack configure.ac as well as Makefile.am to finally convince that ... to give me a Makefile. But now I am set up, I think, finally!
Midzuki
20th December 2011, 17:42
Great! :)
(BTW: My plan is to hack in a progress-indicator and Win32 Unicode support)
A listing of the valid frequencies and bitrates would be useful as well ;)
Cheers.
LoRd_MuldeR
20th December 2011, 17:44
For now, here is the progress indicator. Will look at other things at a later time ;)
Midzuki
20th December 2011, 19:39
Danke! :thanks:
Gonna test it A.S.A.P. :o
amtm
20th December 2011, 20:00
Great! :)
A listing of the valid frequencies and bitrates would be useful as well ;)
Cheers.
From the README for sample rate frequencies:
The sample rate must be one of the following values: 32000, 44100, 48000 or those divided by 2 or 4.
I don't see anything in the README about only accepting a certain range of bitrates but it does mention:
The approximate bitrate is specified in bits per second and may be rounded up by the library.
Also for channels:
Note that values greater than DCAENC_CHANNELS_3FRONT_2REAR always return an error now because their encoding requires the Xch extension that is undocumented and thus not implemented.
So nothing greater than 5.1 for now.
Midzuki
20th December 2011, 20:08
According to THE :) .pdf:
8 11.025 12 16 22.050 24 32 44.1 48 (kHz)
and...
(kbps)
32 56 64 96 112 128 192 224 256 320 384
448 512 576 640 768 960 1024 1152 1280
1344 1408 1411.2 1472 1536 1920 2048 3072 3840
LoRd_MuldeR
20th December 2011, 20:09
Here is a new version with Unicode support. Also, for convenience, I changed the third parameter from bit/s to kbit/s ;)
Repository:
http://gitorious.org/~mulder/dtsenc/mulders-dtsenc/trees/master
amtm
20th December 2011, 20:23
According to THE :) .pdf:
8 11.025 12 16 22.050 24 32 44.1 48 (kHz)
Which is exactly what I and the README on gitorious said. All those sample rates fall under 32000, 44100, and 48000 or any of those values divided by 2 or 4. :)
Also with respect to the bitrates you listed, the encoder ends up rounding values up to one of those but it will accept any value you want to input except for anything less than 32000bps or higher than 6144000bps.
Midzuki
20th December 2011, 20:27
Well, both lame and twolame do care about listing the valid encoding bitrates and frequencies,
in order to ensure the end-user has been well-informed :)
amtm
20th December 2011, 20:31
Well, both lame and twolame do care about listing the valid encoding bitrates and frequencies,
in order to ensure the end-user has been well-informed :)
Like I said, the README on Gitorious does list the valid frequencies and he does note any bitrate will be potentially rounded up, but explicitly listing all valid bitrates would be good to do.
amtm
20th December 2011, 20:33
Here is a new version with Unicode support. Also, for convenience, I changed to third parameter from bit/s to kbit/s ;)
Repository:
http://gitorious.org/~mulder/dtsenc/mulders-dtsenc/trees/master
But you don't seem to have modified his bitrate range check or the rounding math as well in dcaenc.c.
Edit: Never mind I see you scale the bitrate before it gets there back to bps.
LoRd_MuldeR
20th December 2011, 20:54
Removed off-topic posts. Please stay at topic and be nice to each other :)
In the meantime I added support for reading input from STDIN (must have a Wave header for now) and writing output to STDOUT.
(Attachment in previous post has been updated)
b66pak
20th December 2011, 21:30
thanks a lot...
_
L.E.
In the meantime I added support for reading input from STDIN (must have a Wave header for now)
how about an "-ignorelength" for +4gb wavs?
_
LoRd_MuldeR
20th December 2011, 22:09
how about an "-ignorelength" for +4gb wavs?
Not yet. But you should be able to pipe in such files via STDIN.
LoRd_MuldeR
21st December 2011, 00:45
If the input Wave file could not be read, dcaenc will now tell you why.
Selur
21st December 2011, 07:20
@LoRd_MuldeR: Thanks! for the patched version(s) :)
----
Using the patched version I tried:
ffmpeg -threads 8 -v -10 -y -i "D:\Encoding Output\test.mp3" -ac 2 -acodec pcm_s16le -f wav - | dcaenc - "D:\Encoding Output\test.dts" 128
ffmpeg -threads 8 -v -10 -y -i "D:\Encoding Output\test.mp3" -ac 2 -acodec pcm_s16le -f s16le - | sox --ignore-length --temp "D:\Encoding Temp" --buffer 2097152 -S -t raw -e signed-integer -2 -c2 -r48000 - -t wav - | dcaenc - "D:\Encoding Output\test.dts" 128
dcaenc "D:\Encoding Output\test.wav" "D:\Encoding Output\test.dts" 128
and all result in: "Wrong bitrate or sample rate!"
What am I doing wrong?
-> works when using bitrates >= 320 ;)
Midzuki
21st December 2011, 10:53
@ Lord_Mulder:
$ autoconf
configure.ac:11: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
-.-
Selur
21st December 2011, 11:21
Is it just me or does "dcaenc test.wav test.dts 3072" cause dcaenc to freeze (on a 2.0 input wav)?
755, 1280, 1510 and 3072 work fine for 5.1.
320, 384, 448, 512, 576, 640, 755, 1280 and 1510 work fine for 2.0, but 3072 doesn't.
Cu Selur
Midzuki
21st December 2011, 11:31
I am no expert, but for 2.0 audio, and regarding the DCA compression, anything above 576kbps should be clearly labeled as "overkill".
Selur
21st December 2011, 11:48
probably, but atm. I'm not checking which values are same but which are possible. ;)
Midzuki
21st December 2011, 12:21
Anyway, that's not a bug, but a feature :) Why on Earth would someone want to "compress" by using a bitrate HIGHER than the original one? :D
Selur
21st December 2011, 12:35
No it would be a feature it dcaenc would complain, but it freezes. :/
btw. I second the '-ignore length' request, since:
ffmpeg -threads 8 -v -10 -y -i "Test-AC3-5.1.avi" -ac 6 -acodec pcm_s16le -f s16le - | sox --ignore-length --buffer 2097152 -S -t raw -e signed-integer -2 -c6 -r48000 - -t wav - | dcaenc - "test.dts" 755
and
ffmpeg -threads 8 -v -10 -y -i "Test-AC3-5.1.avi" -ac 6 -acodec pcm_s16le -f s16le - | sox -q --ignore-length -t raw -e signed-integer -2 -c6 -r48000 - -t wav - | dcaenc - "test.dts" 755
both stop with:
Could not open or parse "-".
Error: Data chunk not found!
ffmpeg -threads 8 -v -10 -y -i "Test-AC3-5.1.avi" -f wav - | dcaenc - "test.dts" 755
works, but I guess that to accept the sox output a '-ignorelength' would be needed :)
Cu Selur
Ps.: ffmpeg -threads 8 -v -10 -y -i "Test-AC3-5.1.avi" -f wav - | sox -V0 --ignore-length -t wav - -t wav - | dcaenc - "test.dts" 755 doesn't work either
Midzuki
21st December 2011, 12:42
Well-spotted :stupid:
Feel free to :uglylol: Patrakov (and/or Lord_Mulder) :D
Selur
21st December 2011, 14:59
okay, got sox working :) one needs to use '-t wavpcm' instead of '-t wav' :)
Midzuki
21st December 2011, 15:21
^ Thanks for finding and sharing :) :goodpost:
Hopefully in the next build Mulder will include a comprehensive manpage for dcaenc :devil: :p
Midzuki
21st December 2011, 18:51
A listing of the valid frequencies and bitrates would be useful as well.
Stupid me :o
all I had to was edit main.c :stupid:
Usage: dcaenc input.wav output.dts bits_per_second
Valid sample rates (in kHz):
8 11.025 12 16 22.05 24 32 44.1 48
Valid bitrates (in kbps):
32 56 64 96 112 128 192 224
256 320 384 448 512 576 640 768
960 1024 1152 1280 1344 1408 1411.2 1472 1536
:cool: :cool: :cool:
Selur
21st December 2011, 19:15
@midzuki: did you try the bitrates&frequencies?
for me with 48kHz
for 5.1 only 755, 1280, 1510 and 3072 worked
for 2.0 only 320, 384, 448, 512, 576, 640, 755, 1280 and 1510 worked
worked = did not cause a freeze, crash and were really created
Cu Selur
Midzuki
21st December 2011, 22:40
^ @ Selur: not yet :o , I'm still trying to do 10 things at the same time :eek:
I will post my findings A.S.A.P.
Midzuki
22nd December 2011, 00:00
Initial results:
stereo@48kHz cannot be encoded below 320kbps
(just confirming)
stereo@44.1kHz cannot be encoded below 256kbps
mono@48kHz cannot be encoded below 192kbps
Probably those limits were hard-coded by Patrakov himself; an outdated version of the DTSHD Encoder for example, was able to encode 48kHz mono at 126kbps (according to the respective manual, bien entendu).
worked = did not cause a freeze, crash and were really created
Over here, no freezing nor crashing, just a simple error message:
Wrong bitrate or sample rate
dj_doc
22nd December 2011, 01:25
Just played around with LoRd_MuldeR's dcaenc build, sox and eac3to I used Hellboy Director's Cut German Blu-Ray rip
maybe someone will look for how to build a dts file from Blu-Ray PCM track
"c:\Program Files (x86)\RipBot264\Tools\eac3to\eac3to.exe" "e:\Blu-Rays\HELLBOY\" 1)
M2TS, 1 video track, 6 audio tracks, 21 subtitle tracks, 2:12:29, 24p /1.001
1: Chapters, 16 chapters
2: h264/AVC, 1080p24 /1.001 (16:9)
3: AC3, English, 5.1 channels, 448kbps, 48kHz
4: RAW/PCM, English, 5.1 channels, 16 bits, 48kHz
5: AC3, French, 5.1 channels, 448kbps, 48kHz, dialnorm: -30dB
6: AC3, German, 5.1 channels, 448kbps, 48kHz, dialnorm: -30dB
7: RAW/PCM, German, 5.1 channels, 16 bits, 48kHz
8: AC3 Surround, English, 2.0 channels, 192kbps, 48kHz, dialnorm: -26dB
Extract and Convert, don't forget do byteswap, and you're ready to mux your brand new dts track ;-)
"c:\Program Files (x86)\RipBot264\Tools\eac3to\eac3to.exe" "e:\Blu-Rays\HELLBOY\" 1) 7:stdout.wav -down16 -simple | sox -V0 --ignore-length -twavpcm - -t wavpcm - | dcaenc -i - -o "Hellboy_audio_German.dts" -l -b 1510
Midzuki
22nd December 2011, 10:04
@ Lord_Mulder:
Would you mind releasing a "rarball" :p that can be compiled directly by MinGW
( id est, «just patch, configure and make» ) http://forum.doom9.org/images/icons/icon5.gif
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.