Добавляя немного зерна, это скрипт Python, который я придумал, чтобы разделить на несколько глав. Номер извлекается автоматически.
Обратите внимание, что:
- Вам нужен CLI Handbrake (в настоящее время доступен по этому адресу: https://handbrake.fr/downloads2.php)
 
- У вас должна быть папка установки CLI Handbrake в вашем PATH
 
Вам просто нужно вызвать следующий скрипт Python с расположением DVD в качестве аргумента скрипта.
#!python
import os
import subprocess
import re
import sys
# Ugly but simple way to get first argument = folder with DVD
# We will get DVD name by removing all / and \
dvd = sys.argv[1]
dvd_name = re.sub(r'.*[/\\]', r'', dvd).rstrip('/').rstrip('\\')
s = subprocess.Popen(
        f'HandBrakeCLI -i "{dvd}" -t 0', stdout=subprocess.PIPE, stderr=subprocess.STDOUT
    )
count = 0
for line in s.stdout:
    if re.search(rb"\+ title [0-9]+:", line):
        count += 1
print(f'==Extracting {count} chapters from "{dvd}"==')
for i in range(1,count+1):
    output = f"{dvd_name}_{i}.mp4"
    cmd = f'HandBrakeCLI --input {dvd} --title {i} --preset Normal --output "{output}"'
    log = f"encoding_{output}.log"
    with open(log, 'wb') as f:
        s = subprocess.Popen(cmd, stdout=f, stderr=subprocess.STDOUT)
        s.communicate()
    if not os.path.isfile(output):
        print(f'ERROR during extraction of "{output}"!')
    else:
        print(f'Successfully extracted Chapter #{i} to "{output}"')