View Single Post
Old 27th June 2022, 21:24   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
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