2023-09-04, 12:19 AM
(2023-09-03, 03:59 PM)bitmap Wrote: Without getting into the weeds, even release group can come in handy, so stream title changes should definitely reflect your preferences, but eliminating all of the extra info for aesthetic sake may not be entirely desirable.
That's why I keep that information in the filename (Thanks Sonarr!), and use MKVtoolsnix to clean up the track labels and make them uniform. Some groups leave them blank or fill them with superfluous information, so I created a batch file (started mostly for Dual Audio anime BDs but I use it for most things).
Code:
@echo off
set nix="C:\Program Files\MKVToolNix\mkvmerge.exe"
:: Sets English Audio Track
Set EnglishAudio=1
Set ENau="English Audio"
:: Sets Japanese Audio
Set JapaneseAudio=2
Set JPau="Japanese Audio"
:: Sets Signs & Song Subtype
Set Signs=3
Set JPSub="Signs & Songs"
:: Sets Full Dialogue Subtype
Set Full=4
Set Fullsubs="Full Subtitles"
If not exist "%cd%\Output\.ignore" (
md "%cd%\Output\"
Type nul >"%cd%\Output\.ignore"
Type nul >"%cd%\.ignore"
)
:Processing
FOR /F "delims=*" %%A IN ('dir /b ^*.MKV') DO (
Title %%~nA
%nix% -o ^"Output\%%A^" ^
--title "%%~nA" ^
--track-name 0:"%%~nA" ^
--language 0:en ^
--default-track 0:yes ^
--track-name %EnglishAudio%:%ENau% ^
--default-track %EnglishAudio%:yes ^
--language %EnglishAudio%:en ^
--track-name %JapaneseAudio%:%JPau% ^
--default-track %JapaneseAudio%:no ^
--language %JapaneseAudio%:ja ^
--default-track %Signs%:no ^
--forced-track %Signs%:no ^
--track-name %Signs%:%JPSub% ^
--language %Signs%:en ^
--default-track %Full%:yes ^
--forced-track %Full%:no ^
--track-name %Full%:%Fullsubs% ^
--language %Full%:ja ^
--track-order 0:0,0:%EnglishAudio%,0:%JapaneseAudio%,0:%Signs%,0:%Full% ^
"^%%A"
cls
)
If the OP returns (or anyone else stumbling on this thread), they might find it useful. Just set the track numbers at the top. If the files don't have 2 audio and/or subtitle tracks, just set the second one to a track number that doesn't exist in the file. MKVMerge just skips "missing" tracks.
Note:
The code above could be modified (or rewritten) to work with FFmpeg, which comes bundled with Jellyfin, instead, but it seems a little more involved. You'd have to use the -metadata
Example:
Code:
-metadata:s:a:0 title="One"
sets title One to audio 0.
-metadata:s:a:1 title="Two"
sets title Two to audio 1.
-metadata:s:a:0 language=eng
sets English language for audio 0.
-metadata:s:a:1 language=spa
sets Spanish language for audio 1.