This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:scripts:audiostreamconvert [2023/05/28 23:22] – lunetikk | linux:scripts:audiostreamconvert [2023/06/05 22:49] (current) – lunetikk | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Convert .mkv Audio ====== | ====== Convert .mkv Audio ====== | ||
| - | Currently this script will convert any audiostream of a .mkv file to EAC3 764k with the same channels (via ffmpeg), then remux these audiostreams to a new .mkv (via mkvmerge) | + | Currently this script will convert any audiostream of a .mkv file to EAC3 768k with the same channels (via ffmpeg), then remux these audiostreams to a new .mkv (via mkvmerge) |
| ===== Prerequisites ===== | ===== Prerequisites ===== | ||
| - | mkvtoolnix - Matroska tools | + | mkvtoolnix - Matroska tools\\ |
| ffmpeg - Audio conversion tool | ffmpeg - Audio conversion tool | ||
| Line 27: | Line 27: | ||
| # Set new bitrate\\ | # Set new bitrate\\ | ||
| - | newbitrate=" | + | new_bitrate=" |
| If you run the script, it will convert all files inside the " | If you run the script, it will convert all files inside the " | ||
| Line 94: | Line 94: | ||
| echo " | echo " | ||
| - | | + | |
| if [ " | if [ " | ||
| channels=" | channels=" | ||
| fi | fi | ||
| - | | + | |
| if [ -z " | if [ -z " | ||
| lang1="" | lang1="" | ||
| Line 129: | Line 129: | ||
| # Set language metadata for the new audio streams using mkvpropedit | # Set language metadata for the new audio streams using mkvpropedit | ||
| - | mkvpropedit " | + | mkvpropedit " |
| echo " | echo " | ||
| echo " | echo " | ||
| + | | ||
| + | # Clean up temporary directory files | ||
| + | rm $temp_dir/* | ||
| + | |||
| fi | fi | ||
| done | done | ||