Compare commits
2 Commits
0932bb7019
...
4f347e930d
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f347e930d | |||
| 349265dee2 |
@@ -32,7 +32,7 @@ class Tee:
|
|||||||
|
|
||||||
def check_tools():
|
def check_tools():
|
||||||
"""Checks if all required command-line tools are in the system's PATH."""
|
"""Checks if all required command-line tools are in the system's PATH."""
|
||||||
required_tools = ["ffmpeg", "ffprobe", "mkvmerge", "sox", "opusenc", "mediainfo"]
|
required_tools = ["ffmpeg", "ffprobe", "mkvmerge", "sox_ng", "opusenc", "mediainfo"]
|
||||||
print("--- Prerequisite Check ---")
|
print("--- Prerequisite Check ---")
|
||||||
all_found = True
|
all_found = True
|
||||||
for tool in required_tools:
|
for tool in required_tools:
|
||||||
@@ -80,7 +80,7 @@ def convert_audio_track(stream_index, channels, temp_dir, source_file, should_do
|
|||||||
|
|
||||||
# Step 2: Normalize the track with SoX
|
# Step 2: Normalize the track with SoX
|
||||||
print(" - Normalizing with SoX...")
|
print(" - Normalizing with SoX...")
|
||||||
run_cmd(["sox", str(temp_extracted), str(temp_normalized), "--temp", str(temp_dir), "loudness", "-18"])
|
run_cmd(["sox_ng", "--show-progress", str(temp_extracted), str(temp_normalized), "--temp", str(temp_dir), "loudness", "-18"])
|
||||||
|
|
||||||
# Step 3: Encode to Opus with the correct bitrate
|
# Step 3: Encode to Opus with the correct bitrate
|
||||||
bitrate = "192k" # Fallback
|
bitrate = "192k" # Fallback
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The following command-line tools must be installed and available in your system'
|
|||||||
* `ffmpeg`
|
* `ffmpeg`
|
||||||
* `ffprobe`
|
* `ffprobe`
|
||||||
* `mkvmerge`
|
* `mkvmerge`
|
||||||
* `sox`
|
* `sox_ng`
|
||||||
* `opusenc`
|
* `opusenc`
|
||||||
* `mediainfo`
|
* `mediainfo`
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ The following command-line tools must be installed and available in your system'
|
|||||||
* `ffprobe`
|
* `ffprobe`
|
||||||
* `mkvmerge`
|
* `mkvmerge`
|
||||||
* `mkvpropedit`
|
* `mkvpropedit`
|
||||||
* `sox`
|
* `sox_ng`
|
||||||
* `opusenc`
|
* `opusenc`
|
||||||
* `mediainfo`
|
* `mediainfo`
|
||||||
* `alabamaEncoder`
|
* `alabamaEncoder`
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ The following command-line tools must be installed and available in your system'
|
|||||||
* `ffprobe`
|
* `ffprobe`
|
||||||
* `mkvmerge`
|
* `mkvmerge`
|
||||||
* `mkvpropedit`
|
* `mkvpropedit`
|
||||||
* `sox` (or `sox-ng`)
|
* `sox_ng`
|
||||||
* `opusenc`
|
* `opusenc`
|
||||||
* `mediainfo`
|
* `mediainfo`
|
||||||
* `av1an`
|
* `av1an`
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
REQUIRED_TOOLS = [
|
REQUIRED_TOOLS = [
|
||||||
"ffmpeg", "ffprobe", "mkvmerge", "mkvpropedit",
|
"ffmpeg", "ffprobe", "mkvmerge", "mkvpropedit",
|
||||||
"sox", "opusenc", "mediainfo", "av1an", "HandBrakeCLI" # Added HandBrakeCLI
|
"sox_ng", "opusenc", "mediainfo", "av1an", "HandBrakeCLI" # Added HandBrakeCLI
|
||||||
]
|
]
|
||||||
DIR_COMPLETED = Path("completed")
|
DIR_COMPLETED = Path("completed")
|
||||||
DIR_ORIGINAL = Path("original")
|
DIR_ORIGINAL = Path("original")
|
||||||
@@ -69,7 +69,7 @@ def convert_audio_track(index, ch, lang, audio_temp_dir, source_file, should_dow
|
|||||||
|
|
||||||
print(f" - Normalizing Audio Track #{index} with SoX...")
|
print(f" - Normalizing Audio Track #{index} with SoX...")
|
||||||
run_cmd([
|
run_cmd([
|
||||||
"sox", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
"sox_ng", "--show-progress", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
||||||
])
|
])
|
||||||
|
|
||||||
# Set bitrate based on the final channel count of the Opus file.
|
# Set bitrate based on the final channel count of the Opus file.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
REQUIRED_TOOLS = [
|
REQUIRED_TOOLS = [
|
||||||
"ffmpeg", "ffprobe", "mkvmerge", "mkvpropedit",
|
"ffmpeg", "ffprobe", "mkvmerge", "mkvpropedit",
|
||||||
"sox", "opusenc", "mediainfo", "av1an", "HandBrakeCLI" # Added HandBrakeCLI
|
"sox_ng", "opusenc", "mediainfo", "av1an", "HandBrakeCLI" # Added HandBrakeCLI
|
||||||
]
|
]
|
||||||
DIR_COMPLETED = Path("completed")
|
DIR_COMPLETED = Path("completed")
|
||||||
DIR_ORIGINAL = Path("original")
|
DIR_ORIGINAL = Path("original")
|
||||||
@@ -69,7 +69,7 @@ def convert_audio_track(index, ch, lang, audio_temp_dir, source_file, should_dow
|
|||||||
|
|
||||||
print(f" - Normalizing Audio Track #{index} with SoX...")
|
print(f" - Normalizing Audio Track #{index} with SoX...")
|
||||||
run_cmd([
|
run_cmd([
|
||||||
"sox", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
"sox_ng", "--show-progress", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
||||||
])
|
])
|
||||||
|
|
||||||
# Set bitrate based on the final channel count of the Opus file.
|
# Set bitrate based on the final channel count of the Opus file.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ REQUIRED_TOOLS_MAP = {
|
|||||||
"ffprobe": "extra/ffmpeg", # Part of ffmpeg package
|
"ffprobe": "extra/ffmpeg", # Part of ffmpeg package
|
||||||
"mkvmerge": "extra/mkvtoolnix-cli",
|
"mkvmerge": "extra/mkvtoolnix-cli",
|
||||||
"mkvpropedit": "extra/mkvtoolnix-cli", # Part of mkvtoolnix-cli
|
"mkvpropedit": "extra/mkvtoolnix-cli", # Part of mkvtoolnix-cli
|
||||||
"sox": "extra/sox",
|
"sox_ng": "extra/sox-ng",
|
||||||
"opusenc": "extra/opus-tools",
|
"opusenc": "extra/opus-tools",
|
||||||
"mediainfo": "extra/mediainfo",
|
"mediainfo": "extra/mediainfo",
|
||||||
"alabamaEncoder": "pipx install alabamaEncoder"
|
"alabamaEncoder": "pipx install alabamaEncoder"
|
||||||
@@ -76,7 +76,7 @@ def convert_audio_track(index, ch, lang, audio_temp_dir, source_file, should_dow
|
|||||||
|
|
||||||
print(f" - Normalizing Audio Track #{index} with SoX...")
|
print(f" - Normalizing Audio Track #{index} with SoX...")
|
||||||
run_cmd([
|
run_cmd([
|
||||||
"sox", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
"sox_ng", "--show-progress", str(temp_extracted), str(temp_normalized), "--temp", str(audio_temp_path), "loudness", "-18"
|
||||||
])
|
])
|
||||||
|
|
||||||
# Set bitrate based on the final channel count of the Opus file.
|
# Set bitrate based on the final channel count of the Opus file.
|
||||||
|
|||||||
Reference in New Issue
Block a user