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 16th September 2014, 15:44   #41  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,217
Try doing what I did and 'cheat' MuxMan into thinking the DTS stream is compliant...

All you have to do is chop-off and save a few milliseconds from the beginning of a compliant (2013 bytes/frame) elementary DTS stream. And add it to the beginning of your 'non compliant' elementary DTS stream
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 16th September 2014, 16:40   #42  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
Quote:
Originally Posted by filler56789 View Post
Actually, they are sufficient, IF/WHEN reported correctly. At 48kHz, and with 512 samples per frame,

1006 bytes per frame = 754.500kbps
1024 bytes per frame = 768.000kbps

2013 bytes per frame = 1509.750kbps
2048 bytes per frame = 1536.000kbps
Good point, hence 'bytes per frame' is a derivative property, having bitrate and 'samples per frame'. Still we must be sure that:

'samples per frame' = 512

or is that a constant for DTS?



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 16th September 2014, 16:54   #43  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,336
DTS can in theory go up to 4096 samples per frame, although 512 seems to be the most common at 48kHz.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 16th September 2014, 16:59   #44  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
AFAIK, all DCA encoders available (and they are not many ) use 512 samples per audio frame.

Also, I presume/hope that eac3to, LeeAudBi and MediaInfo take the time to measure the frame size,
instead of assuming it always = 512 samples.

Last edited by filler56789; 16th September 2014 at 17:16. Reason: better wording
filler56789 is offline   Reply With Quote
Old 17th September 2014, 08:53   #45  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,881
512 is the standard value but is not mandatory.
From http://www.etsi.org/deliver/etsi_ts/...14v010301p.pdf

NBLKS (Number of PCM Sample Blocks)
This field indicates that there are (NBLKS+1) blocks (a block = 32 PCM core samples per channel, corresponding to
the number of PCM samples that are fed to the core filter bank to generate one subband sample for each subband) in the
current frame (see note). The actual core encoding window size is 32 × (NBLKS+1) PCM samples per channel. Valid
range for NBLKS: 5 to 127. Invalid range for NBLKS: 0 to 4. For normal frames, this indicates a window size of either
4 096, 2 048, 1 024, 512, or 256 samples per channel.

EDIT:
To know the Actual Bitrate you need the fields from DTS header:
NBLKS (Number of PCM Sample Blocks)

FSIZE (Primary Frame Byte Size)
(FSIZE+1) is the total byte size of the current frame including primary audio data as well as any extension audio data.
Valid range for FSIZE: 95 to 16 383. Invalid range for FSIZE: 0 to 94.

SFREQ (Core Audio Sampling Frequency)
This field specifies the sampling frequency of audio samples in the core encoder, based on Table 5-5:
Code:
Table 5-5: Core audio sampling (valid) frequencies
0b0001   8 kHz
0b0010  16 kHz
0b0011  32 kHz
0b0110  11,025 kHz
0b0111  22,05 kHz
0b1000  44,1 kHz
0b1011  12 kHz
0b1100  24 kHz
0b1101  48 kHz
Now the Actual Bitrate (in Kb/s if Sampling frequency in KHz) is:

8 x (FSIZE + 1) x Sampling-rate / (32 x (NBLKS + 1))

Examples:
8 x (2012 + 1) x 48 / (32 x (15 + 1)) = 1509,75 Kb/s
8 x (2011 + 1) x 48 / (32 x (15 + 1)) = 1509 Kb/s
8 x (1005 + 1) x 48 / (32 x (15 + 1)) = 754,5 Kb/s

Seems MediaInfo 0.7.70 (in Advanced mode) can detect the exact FSIZE for NBLKS 15 (standard value). For the 3 samples before:

Overall bit rate : 1509750
Overall bit rate : 1 510 Kbps

Overall bit rate : 1509000
Overall bit rate : 1 509 Kbps

Overall bit rate : 754500
Overall bit rate : 755 Kbps

EDIT 2:
I found dts's from surround Audio CD's with 1024 samples/frame:

Code:
Number of PCM Sample Blocks .: 31 ( 1024 samples/frame)
Primary Frame Byte Size .....: 3583 ( 3584 bytes/frame)
Audio Channel Arrangement ...: 9 (5 C + L + R + SL + SR)
Core Audio Samp. Frequency ..: 8 (44,1 kHz)
Transmission Bit Rate .......: 22 (1411,2 Kb/s)
Actual Bitrate = 8 x (3583 + 1) x 44,1 / (32 x (31 + 1)) = 1234,8 Kb/s

MediaInfo show ok:
Bit rate : 1234800
Bit rate : 1 235 Kbps

BTW, ffdcaenc with -b 1411.2 for 44.1 KHz make:

Code:
Number of PCM Sample Blocks .: 15 ( 512 samples/frame)
Primary Frame Byte Size .....: 2047 ( 2048 bytes/frame)
Audio Channel Arrangement ...: 9 (5 C + L + R + SL + SR)
Core Audio Samp. Frequency ..: 8 (44,1 kHz)
Transmission Bit Rate .......: 22 (1411,2 Kb/s)
With Actual Bitrate = Transmission Bit Rate
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 17th September 2014 at 12:07. Reason: Add info
tebasuna51 is offline   Reply With Quote
Old 17th September 2014, 15:24   #46  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Thanks for the complete info, tebasuna51

Quote:
Originally Posted by tebasuna51 View Post
EDIT 2:
I found dts's from surround Audio CD's with 1024 samples/frame:
It would be very-interesting to know what was the software (or firmware?) that was used for producing that DCA stream...

BTW, and according to the file 4_dts-cae-4_cad-4_encode-decode.pdf,
there exist two more "DVD-compliant" bitrates
(for 2.0 and 2.1 only),

503.25kbps and 377.25kbps

And yes, the «1-byte granularity» strikes again

EDIT: Wow, ffdcaenc already supports them too

Code:
File ........: D:\DVD-18\mlpdir\48tunntest.dts
Size ........: 4844620 bytes

----------------------------------------- First Frame Info
CRC present .................: 0 (Not)
Number of PCM Sample Blocks .: 15 ( 512 samples/frame)
Primary Frame Byte Size .....: 670 ( 671 bytes/frame)
Audio Channel Arrangement ...: 2 (2 L + R stereo)
Core Audio Samp. Frequency ..: 13 (48 kHz)
Transmission Bit Rate .......: 12 (512 Kb/s)
Embedded Down Mix Enabled ...: 0 (Not)
Embedded Dynamic Range Flag .: 0 (Not)
Embedded Time Stamp Flag ....: 0 (Not)
Auxiliary Data Flag .........: 0 (Not)
Mastered in HDCD format .....: 0 (Not)
Extension Audio Descr. Flag .: 0 (Channel Extension XCh)   
Extended Coding Flag ........: 0 (Not)
Audio Sync Word Insert. Flag : 0 (Sub-frame)
Low Frequency Effects Flag ..: 0 (Not present)
Predictor History Flag Switch: 1 (Yes)
Multirate Interpolator Switch: 0 (Non-perfect Reconstruction)
Encoder Software Revision ...: 7 (Current)
Copy History ................: 0 (Definition deliberately omitted)
Source PCM Resolution .......: 6 (24 bits)
Front Sum/Difference Flag ...: 0 (Not)
Surrounds Sum/Difference Flag: 0 (Not)
Dialog Normalization Param. .: - 0 dB
--------------------------------------------- Revised Info
Total Frames ......: 7220 
Duration ..........: 77.013 seconds. ( 0 h. 1 m. 17.013 s.)
------------------------------------------------- End Info

Last edited by filler56789; 17th September 2014 at 15:33.
filler56789 is offline   Reply With Quote
Old 17th September 2014, 15:47   #47  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,217
Quote:
Originally Posted by filler56789 View Post
BTW, and according to the file 4_dts-cae-4_cad-4_encode-decode.pdf,
there exist two more "DVD-compliant" bitrates
(for 2.0 and 2.1 only),

503.25kbps and 377.25kbps

And yes, the «1-byte granularity» strikes again
This being the case, it would probably make sense if the GUI's in DTS encoders were only able to offer the 'compliant' bit-rate levels, ie: 2.0 channel DTS-CD (if it exists), 5.1 channel DTS-CD, 2.0 channel DVD, 2.1 channel DVD, 5.1 channel DVD, etc...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 9th December 2014, 03:44   #48  |  Link
siella
Registered User
 
siella's Avatar
 
Join Date: Mar 2007
Location: Turkey
Posts: 66
I tried ffdcaenc.exe-213_GCC.7z but stdin didnt work.

Code:
Input:   -
Output:  G:\001.dts
Bitrate: 1509 kbps

Encoding... 0:00 [100.0%]
Done.
stdin is working with ffdcaenc.2014-07-27.win32
__________________
Behappy
BePack.v3.3BeHappy,BeSweet,BeLight,BeSplit,BeSliced,BdAC) with last plugin, encoder and extensions.
Avisynth Movie Screenshot, thumbnails creator

Last edited by siella; 9th December 2014 at 03:48.
siella is offline   Reply With Quote
Old 9th December 2014, 04:35   #49  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by siella View Post
I tried ffdcaenc.exe-213_GCC.7z but stdin didnt work.

Code:
Input:   -
Output:  G:\001.dts
Bitrate: 1509 kbps

Encoding... 0:00 [100.0%]
Done.
stdin is working with ffdcaenc.2014-07-27.win32
Thanks for reporting.
I will TRY to fix the problem, since I'm not a programmer ---
--- therefore, no guarantees...

Last edited by filler56789; 9th December 2014 at 10:39. Reason: update
filler56789 is offline   Reply With Quote
Old 9th December 2014, 11:18   #50  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
FIXED - or at least I think so

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	
643	int32_t main( int32_t argc, char **argv )
644	{
645		_setmode(_fileno(stdin),  _O_BINARY);
646		_setmode(_fileno(stdout), _O_BINARY);
647		return dcaenc_main(argc, argv);
648	}
649	
650	#else
651	
652	int32_t main( int32_t argc, char **argv )
653	{
654		return dcaenc_main(argc, argv);
655	}
656	
657	#endif
Attached Files
File Type: 7z ffdcaenc_213-20141209.7z (109.7 KB, 837 views)

Last edited by filler56789; 9th December 2014 at 12:41. Reason: add code
filler56789 is offline   Reply With Quote
Old 9th December 2014, 14:31   #51  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
Quote:
Originally Posted by filler56789 View Post
FIXED - or at least I think so
The following lines should be better...

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	#endif

643	int32_t main( int32_t argc, char **argv )
644	{
645          #if defined(_WIN32) || defined(_WIN64)
645		 _setmode(_fileno(stdin),  _O_BINARY);
646		 _setmode(_fileno(stdout), _O_BINARY);
647          #endif		
648          return dcaenc_main(argc, argv);
649	}
650
Kurtnoise is offline   Reply With Quote
Old 9th December 2014, 15:53   #52  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by Kurtnoise View Post
The following lines should be better...

Code:
637	#if defined(_WIN32) || defined(_WIN64)
638	
639	#include <Windows.h>
640	#include <io.h>
641	#include <fcntl.h>
642	#endif

643	int32_t main( int32_t argc, char **argv )
644	{
645          #if defined(_WIN32) || defined(_WIN64)
645		 _setmode(_fileno(stdin),  _O_BINARY);
646		 _setmode(_fileno(stdout), _O_BINARY);
647          #endif		
648          return dcaenc_main(argc, argv);
649	}
650
Merci beaucoup
filler56789 is offline   Reply With Quote
Old 10th December 2014, 04:04   #53  |  Link
siella
Registered User
 
siella's Avatar
 
Join Date: Mar 2007
Location: Turkey
Posts: 66
Many thanks, it is working without any problem now
__________________
Behappy
BePack.v3.3BeHappy,BeSweet,BeLight,BeSplit,BeSliced,BdAC) with last plugin, encoder and extensions.
Avisynth Movie Screenshot, thumbnails creator
siella is offline   Reply With Quote
Old 15th February 2016, 15:57   #54  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by filler56789 View Post
Sooner or later, I will have to update ffdcaenc's "README2.TXT" @ GitHub.
Even better, I wrote a new file — DECODING_ISSUES.TXT.

https://raw.githubusercontent.com/fi...ING_ISSUES.TXT
filler56789 is offline   Reply With Quote
Old 6th June 2016, 05:58   #55  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Better late than jamais... I added a configure file to the source-code, so that the users don't need to mess around with autoreconf anymore...

https://github.com/filler56789/ffdcaenc-2/releases
filler56789 is offline   Reply With Quote
Old 30th June 2018, 12:05   #56  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,255
Any hope for 7.1 dts encoding support ?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 30th June 2018, 12:44   #57  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,217
Quote:
Originally Posted by Selur View Post
Any hope for 7.1 dts encoding support ?
Much as I'd like to see 6.1 or 7.1 DTS encoding, as far as I know we still don't have 5.1 DTS encodes working correctly in hardware playback devices...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 30th June 2018, 19:12   #58  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,480
Quote:
Originally Posted by Selur View Post
Any hope for 7.1 dts encoding support ?
Not with the code written by Patrakov && improved by Alexei Andropov, at least.

The following speaker layout is for the "extended surround" thing (6.0 and 6.1):

Code:
13: FC, BC, FL, FR, BL, BR
whereas this is the only 7.0 /7.1 speaker layout available:

Code:
14: CL, FC, CR, FL, FR, BL, BR
which is from Sony's SDDS and "nobody uses" :-/
Midzuki is offline   Reply With Quote
Old 1st July 2018, 09:49   #59  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,881
Quote:
Originally Posted by SeeMoreDigital View Post
Much as I'd like to see 6.1 or 7.1 DTS encoding, as far as I know we still don't have 5.1 DTS encodes working correctly in hardware playback devices...
Without problems in my Yamaha receiver using standard Transmission Bit Rate, encoding DTS with:

ffdcaenc.exe -i input_5.1.wav -o 768.dts -l -b 754.5
ffdcaenc.exe -i input_5.1.wav -o 1536.dts -l -b 1509.75

BTW 7.1 is only allowed in DTS HD (MA or HR)
ffdcaenc only encode to standard DTS, also DTS-ES (6.1) is not supported:

Error: Unsupported number of channels (only 1, 2, 3, 4, 5 and 6)!
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 1st July 2018, 11:47   #60  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,217
Quote:
Originally Posted by tebasuna51 View Post
Without problems in my Yamaha receiver using standard Transmission Bit Rate, encoding DTS with:

ffdcaenc.exe -i input_5.1.wav -o 768.dts -l -b 754.5
ffdcaenc.exe -i input_5.1.wav -o 1536.dts -l -b 1509.75
I've been using UsEac3To to generate my DTS files. Followed by MKVToolNix GUI to mux them (along with video), into the .mkv container and TSmuxer GUI to mux them into the .m2ts container.

But when I play the DTS.mkv and DTS.m2ts muxes in my OPPO, all I hear is a garbled mess and it crashes the player.

EDIT: Perhaps I could try your samples?
__________________
| 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; 1st July 2018 at 13:24.
SeeMoreDigital is offline   Reply With Quote
Reply

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 09:26.


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