Previous Page | Next Page

by WowZipZipBoomBoomWow at 12:12 PM EST on December 3, 2014
I have a batch file that I can just drag and drop a file onto (or a folder, or multiple files/folders).

Each file is analyzed by test.exe to see how many channels they have, and then piped into FFMPEG.

Stereo files are processed as stereo.
Mono files are converted to stereo for compatibility with various players, sound cards, and surround speaker configs.
Files with more than 2 channels are automatically downmixed to stereo, keeping all channels (using a pan string like what I posted earlier).

FFMPEG then outputs them in whatever format / quality I want (I use Opus @ 128 kbps).

When everything is finished, I get a report. The report includes any files that have more than 2 channels. The full version of these files (as multichannel wavs from test.exe) are saved in a temp directory. This way, I can easily review them and either reprocess them with a different pan string (keep/drop whatever channels I want) or mix them manually (using audacity or something).
by Mouser X at 9:28 PM EST on December 3, 2014
Mind posting a copy of that BAT file (or the content/string thereof)? I have a batch comand I use that HCS provided years ago, but it doesn't handle multi-channel files sufficiently. I'm using it to convert files to ADX in most cases, and sometimes LOGG. The ADX format only handles stereo, so being able to downmix "on-the-fly" would be really nice. And, it requires that you alter the command/string to match the file extension you want to work on. Being able to automate even that would simplify things a little bit.

If you can share it, I'd appreciate it. Thanks in advance. Mouser X over and out.
by WowZipZipBoomBoomWow at 4:07 PM EST on December 4, 2014
Hopefully the formatting isn't screwed up in any way...
Edit: Looks like it eats up the extra whitespace, but it should still work.
Save this as convert.bat or whatever and throw it in a folder with test.exe and ffmpeg.exe (and all necessary dlls) then drag and drop a files/folders/both onto convert.bat .

@ECHO OFF
SETLOCAL EnableDelayedExpansion

SET pan="pan=stereo^|c0^<c0+c2+c4+c6+c8+c10^|c1^<c1+c3+c5+c7+c9+c11"
REM | For stereo mixing for up to 12 channels, use pan="pan=stereo^|c0^<c0+c2+c4+c6+c8+c10^|c1^<c1+c3+c5+c7+c9+c11"
REM | Determine and set pan (mixing) per file. You don't always want all channels.
REM | ChannelReport.txt will try to tell you if the stream has more than 2 channels or doesn't match your pan settings.
REM | Use this report to quickly find the files (in temp) which need manual mixing, then set pan and reprocess those files.

SET LOG=0
REM | Set to 1 to enable more logging in ChannelReport.txt . Set to 0 for quieter output.

SET ALERT=0

SET pancounter=-1
set pansplit=!pan!
:COUNTPAN
FOR /F "usebackq tokens=1* delims=|+" %%a IN ('!pansplit!') DO (
if ["%%a"] NEQ [""] SET /A pancounter+=1
if ["%%b"] NEQ [""] (
SET pansplit=%%b
GOTO :COUNTPAN
)
)

CD %~dp0%
IF NOT EXIST temp\ (MD temp)
IF NOT EXIST encoded\ (MD encoded)

ECHO ---------------JOB START %DATE% %TIME%--------------->> ChannelReport.txt

:LOOP
IF NOT EXIST "%~1\" (
CALL :FFMPEG "%~1" %pan% !pancounter!
) ELSE FOR /F "usebackq delims=" %%A IN (`DIR %1 /B /S`) DO IF NOT EXIST %%A\ CALL :FFMPEG "%%~A" %pan% !pancounter!
SHIFT
IF ["%~1"] NEQ [""] GOTO :LOOP

ECHO ----------------JOB END %DATE% %TIME%---------------->> ChannelReport.txt
ECHO.>> ChannelReport.txt
DEL /F tmp.txt
REM | RD /S /Q temp - disabled so you can check the files for mixing purposes
START NOTEPAD ChannelReport.txt
PAUSE
EXIT

:FFMPEG
@ECHO ON
test -m "%~1" > tmp.txt & TYPE tmp.txt
@ECHO OFF

FOR /F "eol=- usebackq tokens=1,2 delims=: " %%q IN (`find "channels:" tmp.txt`) DO (
SET usepan="%~2"
IF %%r EQU 1 (
SET usepan="pan=stereo|c0<c0|c1<c0"
ECHO INFO: Source is mono - converting to stereo for compatibility. %1>> ChannelReport.txt
)
IF %%r EQU 2 (
IF %LOG%==1 ECHO LOG: Source is stereo. %1>> ChannelReport.txt
)
IF %%r GTR 2 (
ECHO.
test -o "temp\%~n1.wav" "%~1"
ECHO WARNING: Source has %%r channels - see temp directory. %1>> ChannelReport.txt
)
IF %%r GTR %~3 (
ECHO.
test -o "temp\%~n1.wav" "%~1"
ECHO WARNING: Source has %%r channels but your pan only maps %~3 channels. %1>> ChannelReport.txt
)
)

ECHO.
@ECHO ON
test -p "%~1" | ffmpeg -i pipe:0 -af %usepan% -acodec libopus -compression_level 10 -b:a 128k -vbr on "encoded\%~n1.opus" -y
@ECHO OFF
ECHO.
IF ERRORLEVEL 1 (
ECHO ERROR: Failed to process %1.>> ChannelReport.txt
) ELSE IF %LOG%==1 ECHO LOG: Successfully processed %1.>> ChannelReport.txt

EXIT /B

edited 9:25 PM EST December 4, 2014
by Blazingflare at 6:29 PM EST on December 7, 2014
Is there any word on Captain Toad's Treasure tracker? In addition to remixed 3D World tracks, it also has some nice original music as well.
by Kurausukun at 6:49 PM EST on December 7, 2014
We're not supposed to request music in here. It's the same situation as Smash--it'll happen when it happens.
by TwinkTickler at 8:59 PM EST on December 7, 2014
I'm not surprised smash hasn't been ripped yet.

I mean, for a title that big. Nintendo will try their damn hardest to encrypt the baby.

But determined users will find many wonderful ways to crack open the baby! and take the goods that are sealed inside the baby, then we can all FEAST on the baby!
by bxaimc at 3:17 AM EST on December 8, 2014
Uhh.....ok.

Anyway, it's not that it's encrypted so heavily. It just hasn't been dumped yet.
by Segtendo at 6:57 AM EST on December 8, 2014
I'm surprised myself that it hasn't been ripped it.
by TheUltimateKoopa at 3:00 PM EST on December 8, 2014
I'm not requesting Captain Toad, but I'd still download it. I could say "I'd like a rip of the game", but then... how can you "not request something, but want it anyway"?
by soneek at 4:58 PM EST on December 8, 2014
Speculation doesn't really belong here either, generally speaking. If something is ripped, it'll be in the linked directory in the first post.

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source