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 26th June 2022, 14:12   #1  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
Convert audio file

A bit delusional question ...

Is there any way to convert ac3 file to true-hd?

I know it's a bit ridiculous ... but I do not want it so that the audio quality is supposed to improve ...
I want to merge 2 audio files to 1 - and one is ac3 and the other is true-hd
And the part of the ac3 is something like 10 seconds ... so I have to change it to true-hd
CapricornX10X is offline   Reply With Quote
Old 26th June 2022, 15:35   #2  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,470
For free you can try:

ffmpeg -i "INPUT.ac3" -strict -2 -acodec truehd "OUTPUT.thd"
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 26th June 2022, 18:27   #3  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
Where do I download the software ...
Can't find anywhere
CapricornX10X is offline   Reply With Quote
Old 26th June 2022, 18:56   #4  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
Quote:
Originally Posted by tebasuna51 View Post
For free you can try:

ffmpeg -i "INPUT.ac3" -strict -2 -acodec truehd "OUTPUT.thd"
you can guide me how to this
CapricornX10X is offline   Reply With Quote
Old 26th June 2022, 19:48   #5  |  Link
Barough
Registered User
 
Barough's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 417
Quote:
Originally Posted by CapricornX10X View Post
Where do I download the software ...
Can't find anywhere
You can grab FFmpeg from the link bellow
https://github.com/BtbN/FFmpeg-Builds/releases
Barough is offline   Reply With Quote
Old 26th June 2022, 20:23   #6  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
Quote:
Originally Posted by Barough View Post
You can grab FFmpeg from the link bellow
https://github.com/BtbN/FFmpeg-Builds/releases
I have no idea how to use it. I downloaded ..
And nothing can open
CapricornX10X is offline   Reply With Quote
Old 26th June 2022, 20:47   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
Ffmpeg, It's a command line program.
So, where Tebasuna51 posted
Code:
ffmpeg -i "INPUT.ac3" -strict -2 -acodec truehd "OUTPUT.thd"
you may need eg (unless you add path to FFMPEG to your system environment)
Code:
D:\SomePath\ffmpeg.EXE -i "D:\AudioInput\INPUT.ac3" -strict -2 -acodec truehd "D:\AudioOutput\OUTPUT.thd"
Also, Input.ac3 and output.thd are just filename examples.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 26th June 2022 at 21:35.
StainlessS is offline   Reply With Quote
Old 26th June 2022, 21:12   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
You could maybe try this [should at least work for ac3, maybe also some other input formats, totally untested]

Bat file Batch Processes all audio files in INDIR folder that match the given file extensions, and converts into type thd in the OUTDIR folder.
AC3_To_THD.BAT
Code:
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
REM We DO NOT LIKE ACCENTS IN FILE NAMES.

setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory [EDIT: I.E., same as BAT File]
set INDIR="."


REM Where to place output file, No terminating Backslash. [EDIT: Or eg, set OUTDIR="D:\OUTPUT" ]
set OUTDIR=".\OUTPUT"

REM Can POSSIBLY add other file extensions to convert, SPACE separated eg " *.eac3", no idea if will work
FOR %%A IN ( *.ac3 ) DO (
  %FFMPEG% -i "%INDIR%\%%A" -strict -2 -acodec truehd "%OUTDIR%\%%~nxA.THD"

)

Pause
Need to Edit Lines in BLUE, and can remove line in RED if required.

Extensions of input filetypes that are processed are shown in Purple [SPACE separated],
eg
*.ac3 *.eac3

(Where above we add SPACE separated " *.eac3", you can add more extensions in similar format,
NO IDEA if any extensions other than *.ac3 will work as required in the conversion, [I only ever bother with Stereo]).

Above bat file not tested. [I'm not sure what "-strict -2" does, or if applies to non ac3 input files]
(If it dont work with non *.ac3 extensions, then use only *.ac3 in Purple wildcard file extensions)

To use above (with 1st BLUE line edited to PATH to FFMPEG.EXE, other two BLUE lines untouched),
create some directory eg "CONVERT", inside it, put the bat file and also create an CONVERT\OUTPUT folder.
Copy ac3 input files to the CONVERT folder, run the bat file. Output thd files in CONVERT\OUTPUT.

Alternative additional mod, Change 2nd BLUE line Input Path to set INDIR=".\INPUT",
also create an CONVERT\INPUT folder, as well as CONVERT\OUTPUT. Put Input files in Input folder,
leaving CONVERT\ for conversion *.BAT files only.

EDIT:
This is similar style BAT file, Batch converts files of specified extensions, ALL to 16 bit Stereo WAV
Edit similar to above Bat.
Audio_to_16Bit_Stereo_WAV.BAT
Code:
REM Convert audio to 16 bit stereo
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
REM We DO NOT LIKE ACCENTS IN FILE NAMES.


setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory
set INDIR="."


REM Where to place output file, No terminating Backslash.
set OUTDIR=".\OUTPUT"


FOR %%A IN (*.thd *.dts *.ac3 *.w64 *.aac *.m4a *.eac3 *.wav) DO (
  %FFMPEG% -i "%INDIR%\%%A" -vn -acodec pcm_s16le -ac 2 "%OUTDIR%\%%~nxA.WAV"

)

Pause
-vn = No video Output.
-acodec pcm_s16le = Pulse Code Modulated, 16 bit, Little Endian.
-ac 2 = 2 audio channels.
nxA.WAV = WAV file output.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2022 at 14:27.
StainlessS is offline   Reply With Quote
Old 27th June 2022, 21:24   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
CapricornX10X,
I answer you here instead of in PM.

Sorry, but now I've tried the BAT files, and have NOT been able to get them to work when anything other than INDIR=".",
Dont know what I've done to break them, think BAT template INDIR used to work years ago, but not now.
(Was shamlessly stolen from some good CLI Command guy's bat).

but here, this does work:- https://www.mediafire.com/file/dablj...ONVERT.7z/file
Has
Code:
CONVERT\
CONVERT\BIN\
CONVERT\BIN\FFMPEG.Exe
CONVERT\OUTPUT\
CONVERT\Audio_to_16Bit_Stereo_WAV.BAT
CONVERT\AC3_To_THD.BAT             [With *.ac3 and *.dts]
Must copy input files into CONVERT\ alongside the BAT files ::: Dont Change INDIR.

###################

Has anybody has a clue why the BAT file dont work when "Set INDIR=".\INPUT" (and also when CONVERT\INPUT\ exists with *.ac3 files) ?

The *.dts conversion thing shows something like "Only implemented fror Mono And Stereo" message when convert to THD,
maybe future version ffmpeg fixes that. (used version ffmpeg is only a few months old I think).

AC3_To_THD.BAT [With *.ac3 and *.dts]
Code:
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
REM We DO NOT LIKE ACCENTS IN FILE NAMES.

setlocal

REM Where to Find ffmpeg
set FFMPEG=".\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory [EDIT: I.E., same as BAT File]
set INDIR="."

REM Where to place output file, No terminating Backslash. [EDIT: Or eg, set OUTDIR="D:\OUTPUT" ]
set OUTDIR=".\OUTPUT"

REM Can POSSIBLY add other file extensions to convert, SPACE separated eg " *.eac3", no idea if will work
FOR %%A IN ( *.ac3 *.dts ) DO (
  %FFMPEG% -i "%INDIR%\%%A" -strict -2 -acodec truehd "%OUTDIR%\%%~nxA.THD"
)

Pause
Edited for wrap-around
Code:
C:\CONVERT>REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)

C:\CONVERT>REM We DO NOT LIKE ACCENTS IN FILE NAMES.

C:\CONVERT>setlocal

C:\CONVERT>REM Where to Find ffmpeg

C:\CONVERT>set FFMPEG=".\BIN\ffmpeg.exe"

C:\CONVERT>REM Where to get input file, No terminating Backslash, "." = current directory [EDIT: I.E., same as BAT File]

C:\CONVERT>set INDIR="."

C:\CONVERT>REM Where to place output file, No terminating Backslash. [EDIT: Or eg, set OUTDIR="D:\OUTPUT" ]

C:\CONVERT>set OUTDIR=".\OUTPUT"

C:\CONVERT>REM Can POSSIBLY add other file extensions to convert, SPACE separated eg " *.eac3", no idea if will work

C:\CONVERT>FOR %A IN (*.ac3 *.dts) DO (".\BIN\ffmpeg.exe" -i ""."\%A" -strict -2 -acodec truehd "".\OUTPUT"\%~nxA.THD" )

C:\CONVERT>(".\BIN\ffmpeg.exe" -i ""."\A.ac3" -strict -2 -acodec truehd "".\OUTPUT"\A.ac3.THD" )
ffmpeg version 5.0-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2
  --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
   --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264
    --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
    --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec
    --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio
    --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame
    --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa
    --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[ac3 @ 00000277505ace40] Estimating duration from bitrate, this may be inaccurate
Input #0, ac3, from '.\A.ac3':
  Duration: 02:31:20.67, start: 0.000000, bitrate: 224 kb/s
  Stream #0:0: Audio: ac3, 48000 Hz, stereo, fltp, 224 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (ac3 (native) -> truehd (native))
Press [q] to stop, [?] for help
Output #0, truehd, to '.\OUTPUT\A.ac3.THD':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Audio: truehd, 48000 Hz, stereo, s32 (24 bit), 128 kb/s
    Metadata:
      encoder         : Lavc59.18.100 truehd
size= 1562240kB time=02:31:20.67 bitrate=1409.4kbits/s speed= 128x
video:0kB audio:1562240kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

C:\CONVERT>Pause
Press any key to continue . . .
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2022 at 21:43.
StainlessS is offline   Reply With Quote
Old 27th June 2022, 22:04   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
CapricornX10X, As said in PM, please post in thread.
I dont like PM, and am nearly always about 98%->99% full, and have to choose some PM's to get rid of, just to say post in thread.

You say that the batch file dont work.

Does line from post #7 work, ie [modded for your file and input / output directories of course]

Code:
D:\SomePath\ffmpeg.EXE -i "D:\AudioInput\INPUT.ac3" -strict -2 -acodec truehd "D:\AudioOutput\OUTPUT.thd"
Also, Does it convert to WAV via the CONVERT folder ? [EDIT: via CONVERT\Audio_to_16Bit_Stereo_WAV.BAT]

If not, does it play in some media player ?

What it does do might also be handy, ie error messages.

EDIT: It does have the ".ac3" extension, YES ? [EDIT: If not, then what extension]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2022 at 22:56.
StainlessS is offline   Reply With Quote
Old 27th June 2022, 22:12   #11  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
I'm not the most knowledgeable in this environment of commands

I tried and failed, even with the file you sent for download
CapricornX10X is offline   Reply With Quote
Old 27th June 2022, 22:16   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
Does it have ac3 file extension ?
and if it fails, what does it do when it fails, what does it say ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th June 2022, 22:40   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
Can you down this small (4.6MB) AC3 file.
https://www.mediafire.com/file/svg2n...nwf/A.AC3/file
and try again with the convert whotsit,
copy into the CONVERT folder, and
Double click "AC3_To_THD.BAT", output will be in OUTPUT folder.
Works here with exact same CONVERT folder upped to Mediafire several posts ago.

Source file was just 60 secs of mp3 podcast talking converted to AC3.

AC3
Code:
General
Complete name                            : C:\Z\A.AC3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
File size                                : 4.58 MiB
Duration                                 : 1 min 0 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 640 kb/s

Audio
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Duration                                 : 1 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 28.711 FPS (1536 spf)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 4.58 MiB (100%)
THD
Code:
General
Complete name                            : C:\CONVERT\OUTPUT\A.AC3.THD
Format                                   : TrueHD
File size                                : 7.79 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : TrueHD
Bit rate mode                            : Variable
Maximum bit rate                         : 9 597 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: C
Sampling rate                            : 44.1 kHz
Frame rate                               : 1 102.500 FPS (40 spf)
Compression mode                         : Lossless
output above looks a bit strange, 2 channels, Center channel only.
Maybe I should have used (or converted to) AC3 to 48000Hz.

Anyways, it does convert whether complies with any kind of spec of not.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2022 at 22:51.
StainlessS is offline   Reply With Quote
Old 28th June 2022, 01:12   #14  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,470
Quote:
Originally Posted by StainlessS View Post
...
The *.dts conversion thing shows something like "Only implemented fror Mono And Stereo" message when convert to THD,
maybe future version ffmpeg fixes that. (used version ffmpeg is only a few months old I think).
Work fine for 5.1 also:
Code:
General
Complete name                            : D:\Test\AudioD\Samples\ac3\6a321.ac3_.thd
Format                                   : MLP FBA
Format/Info                              : Meridian Lossless Packing FBA
Commercial name                          : Dolby TrueHD
File size                                : 3.73 MiB
Overall bit rate mode                    : Variable

Audio
Format                                   : MLP FBA
Format/Info                              : Meridian Lossless Packing FBA
Commercial name                          : Dolby TrueHD
Bit rate mode                            : Variable
Maximum bit rate                         : 9 597 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Compression mode                         : Lossless
Obtained with:
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 28th June 2022, 15:02   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,228
Thanks teb,
guess we just have to wait for CapricornX10X to show up.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 28th June 2022, 15:57   #16  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
Hi everyone friends ..
thanks very much
It took me a while to figure out ... but I eventually succeeded, along with useac3to

This allowed me to perform the conversion successfully.
But when I take the new thu file and put it in tsmuxer along with the video file.
And I mux ...
I play powerdvd and there is no audio

Thanks StainlessS
Thanks Barough
Thanks tebasuna51

Last edited by CapricornX10X; 28th June 2022 at 16:03.
CapricornX10X is offline   Reply With Quote
Old 30th June 2022, 18:44   #17  |  Link
CapricornX10X
Registered User
 
Join Date: Mar 2020
Posts: 81
So ... no one can help me?
CapricornX10X is offline   Reply With Quote
Old 30th June 2022, 20:29   #18  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,078
Just so you know... The last time I tested the Dolby TrueHD audio encoder in FFmpeg, I wasn't able to hear them using my OPPO UDP-203 player!

You might be better off converting everything to 'lossy' Dolby Digital or even 'lossless' FLAC...
__________________
| 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 online now   Reply With Quote
Old 1st July 2022, 03:02   #19  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,470
Quote:
Originally Posted by CapricornX10X View Post
So ... no one can help me?
I don't use Powerdvd, with mpc-hc the thd obtained with ffmpeg play fine.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 5th July 2022, 10:17   #20  |  Link
Losko
Registered User
 
Join Date: Dec 2010
Posts: 57
Quote:
Originally Posted by Barough View Post
You can grab FFmpeg from the link bellow
https://github.com/BtbN/FFmpeg-Builds/releases
Hey, this is worth bookmarking
Losko 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 15:58.


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