Skip to content

Commit 250db2f

Browse files
authored
Version 5.12.4 (#680)
1 parent 93e3a5a commit 250db2f

File tree

13 files changed

+306
-39
lines changed

13 files changed

+306
-39
lines changed

CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Version 5.12.4
4+
5+
* Fixing #675 "Default Source Folder" not used when adding Complete Folders (thanks to Krawk)
6+
* Fixing #678 Cannot copy the cover (thanks to danielly2020)
7+
* Fixing #679 Subtitle extraction (thanks to danielly2020)
8+
* Fixing adding subtitle track would fail if video has a title (thanks to The_Donn)
9+
10+
311
## Version 5.12.3
412

513
* Fixing #673 changing subtitle langauge in the UI did not take effect in the command (thanks to danielly2020)

fastflix/data/languages.yaml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11101,3 +11101,174 @@ Could not extract subtitle track:
1110111101
ukr: Не вдалося витягти доріжку субтитрів
1110211102
kor: 자막 트랙을 추출할 수 없습니다.
1110311103
ron: Nu s-a putut extrage pista de subtitrare
11104+
Select Subtitle Track:
11105+
eng: Select Subtitle Track
11106+
deu: Untertitelspur auswählen
11107+
fra: Sélectionner la piste des sous-titres
11108+
ita: Selezionare la traccia dei sottotitoli
11109+
spa: Seleccionar pista de subtítulos
11110+
jpn: 字幕トラックを選択
11111+
rus: Выберите дорожку субтитров
11112+
por: Selecionar a faixa de legendas
11113+
swe: Välj undertextspår
11114+
pol: Wybór ścieżki napisów
11115+
chs: 选择字幕轨道
11116+
ukr: Виберіть доріжку субтитрів
11117+
kor: 자막 트랙 선택
11118+
ron: Selectați pista de subtitrare
11119+
Subtitle Track:
11120+
eng: Subtitle Track
11121+
deu: Untertitel Spur
11122+
fra: Piste de sous-titres
11123+
ita: Traccia dei sottotitoli
11124+
spa: Pista de subtítulos
11125+
jpn: 字幕トラック
11126+
rus: Дорожка субтитров
11127+
por: Faixa de legendas
11128+
swe: Spår för undertexter
11129+
pol: Ścieżka napisów
11130+
chs: 字幕轨道
11131+
ukr: Доріжка з субтитрами
11132+
kor: 자막 트랙
11133+
ron: Track subtitrare
11134+
Subtitle Files (*.srt *.ass *.vtt *.ssa);;All Files (*):
11135+
eng: Subtitle Files (*.srt *.ass *.vtt *.ssa);;All Files (*)
11136+
deu: Untertiteldateien (*.srt *.ass *.vtt *.ssa);;Alle Dateien (*)
11137+
fra: Fichiers de sous-titres (*.srt *.ass *.vtt *.ssa);;Tous les fichiers (*)
11138+
ita: File dei sottotitoli (*.srt *.ass *.vtt *.ssa);;Tutti i file (*)
11139+
spa: Archivos de subtítulos (*.srt *.ass *.vtt *.ssa);;Todos los archivos (*)
11140+
jpn: 字幕ファイル (*.srt *.ass *.vtt *.ssa);;すべてのファイル (*)
11141+
rus: Файлы субтитров (*.srt *.ass *.vtt *.ssa);;Все файлы (*)
11142+
por: Ficheiros de legendas (*.srt *.ass *.vtt *.ssa);;Todos os ficheiros (*)
11143+
swe: Undertextfiler (*.srt *.ass *.vtt *.ssa);;Alla filer (*)
11144+
pol: Pliki napisów (*.srt *.ass *.vtt *.ssa);;Wszystkie pliki (*)
11145+
chs: 字幕文件 (*.srt *.ass *.vtt *.ssa);;All Files (*)
11146+
ukr: Файли субтитрів (*.srt *.ass *.vtt *.ssa);;Всі файли (*)
11147+
kor: 자막 파일 (*.srt *.ass *.vtt *.ssa);;모든 파일 (*)
11148+
ron: Fișiere subtitrare (*.srt *.ass *.vtt *.ssa);;Toate fișierele (*)
11149+
Select Audio Track:
11150+
eng: Select Audio Track
11151+
deu: Audiospur auswählen
11152+
fra: Sélectionner la piste audio
11153+
ita: Selezionare la traccia audio
11154+
spa: Seleccionar pista de audio
11155+
jpn: オーディオトラックを選択
11156+
rus: Выберите аудиодорожку
11157+
por: Selecionar faixa de áudio
11158+
swe: Välj ljudspår
11159+
pol: Wybierz ścieżkę audio
11160+
chs: 选择音轨
11161+
ukr: Виберіть аудіодоріжку
11162+
kor: 오디오 트랙 선택
11163+
ron: Selectați pista audio
11164+
Audio Files (*.mp3 *.aac *.wav *.flac);;All Files (*):
11165+
eng: Audio Files (*.mp3 *.aac *.wav *.flac);;All Files (*)
11166+
deu: Audio-Dateien (*.mp3 *.aac *.wav *.flac);;Alle Dateien (*)
11167+
fra: Fichiers audio (*.mp3 *.aac *.wav *.flac);;Tous les fichiers (*)
11168+
ita: File audio (*.mp3 *.aac *.wav *.flac);;Tutti i file (*)
11169+
spa: Archivos de audio (*.mp3 *.aac *.wav *.flac);;Todos los archivos (*)
11170+
jpn: オーディオファイル (*.mp3 *.aac *.wav *.flac);;すべてのファイル (*)
11171+
rus: Аудиофайлы (*.mp3 *.aac *.wav *.flac);;Все файлы (*)
11172+
por: Ficheiros de áudio (*.mp3 *.aac *.wav *.flac);;Todos os ficheiros (*)
11173+
swe: Ljudfiler (*.mp3 *.aac *.wav *.flac);;Alla filer (*)
11174+
pol: Pliki audio (*.mp3 *.aac *.wav *.flac);;Wszystkie pliki (*)
11175+
chs: 音频文件 (*.mp3 *.aac *.wav *.flac);;All Files (*)
11176+
ukr: Аудіофайли (*.mp3 *.aac *.wav *.flac);;Всі файли (*)
11177+
kor: 오디오 파일(*.mp3 *.aac *.wav *.flac);;모든 파일(*)
11178+
ron: Fișiere audio (*.mp3 *.aac *.wav *.flac);;Toate fișierele (*)
11179+
is not in supported format (SRT, ASS, SSA, PGS), skipping extraction:
11180+
eng: is not in supported format (SRT, ASS, SSA, PGS), skipping extraction
11181+
deu: nicht im unterstützten Format ist (SRT, ASS, SSA, PGS), wird die
11182+
Extraktion übersprungen
11183+
fra: n'est pas dans un format supporté (SRT, ASS, SSA, PGS), l'extraction est
11184+
ignorée.
11185+
ita: non è in un formato supportato (SRT, ASS, SSA, PGS), si salta
11186+
l'estrazione.
11187+
spa: no está en un formato compatible (SRT, ASS, SSA, PGS), se omite la
11188+
extracción
11189+
jpn: がサポートされているフォーマット(SRT、ASS、SSA、PGS)でない場合、抽出をスキップする。
11190+
rus: не в поддерживаемом формате (SRT, ASS, SSA, PGS), пропуск извлечения
11191+
por: não está num formato suportado (SRT, ASS, SSA, PGS), saltando a extração
11192+
swe: inte är i ett format som stöds (SRT, ASS, SSA, PGS), hoppa över
11193+
extraktionen
11194+
pol: nie jest w obsługiwanym formacie (SRT, ASS, SSA, PGS), pomijanie
11195+
ekstrakcji
11196+
chs: 不支持的格式(SRT、ASS、SSA、PGS),跳过提取
11197+
ukr: не у підтримуваному форматі (SRT, ASS, SSA, PGS), пропускається вилучення
11198+
kor: 가 지원되지 않는 형식(SRT, ASS, SSA, PGS)이므로 추출 건너뛰기
11199+
ron: nu este în format acceptat (SRT, ASS, SSA, PGS), extragerea este ignorată
11200+
Could not determine subtitle format for track:
11201+
eng: Could not determine subtitle format for track
11202+
deu: Das Untertitelformat für die Spur konnte nicht ermittelt werden
11203+
fra: Impossible de déterminer le format des sous-titres pour la piste
11204+
ita: Impossibile determinare il formato dei sottotitoli per la traccia
11205+
spa: No se ha podido determinar el formato de subtítulos de la pista
11206+
jpn: トラックの字幕フォーマットを決定できませんでした
11207+
rus: Не удалось определить формат субтитров для дорожки
11208+
por: Não foi possível determinar o formato das legendas para a faixa
11209+
swe: Kunde inte fastställa undertextformat för spår
11210+
pol: Nie można określić formatu napisów dla ścieżki
11211+
chs: 无法确定轨道的字幕格式
11212+
ukr: Не вдалося визначити формат субтитрів для доріжки
11213+
kor: 트랙의 자막 형식을 결정할 수 없습니다.
11214+
ron: Nu s-a putut determina formatul subtitrărilor pentru pistă
11215+
skipping extraction:
11216+
eng: skipping extraction
11217+
deu: Überspringen der Extraktion
11218+
fra: Sauter l'extraction
11219+
ita: saltare l'estrazione
11220+
spa: omitir la extracción
11221+
jpn: スキップ抽出
11222+
rus: пропуск добычи
11223+
por: saltar a extração
11224+
swe: hoppa över extraktion
11225+
pol: pomijanie ekstrakcji
11226+
chs: 跳转提取
11227+
ukr: пропуск видобутку
11228+
kor: 추출 건너뛰기
11229+
ron: omiterea extracției
11230+
Could not probe subtitle track:
11231+
eng: Could not probe subtitle track
11232+
deu: Untertitelspur konnte nicht geprüft werden
11233+
fra: Impossible de sonder la piste de sous-titres
11234+
ita: Impossibile sondare la traccia dei sottotitoli
11235+
spa: No se ha podido sondear la pista de subtítulos
11236+
jpn: 字幕トラックをプローブできませんでした
11237+
rus: Не удалось обнаружить дорожку субтитров
11238+
por: Não foi possível sondar a faixa de legendas
11239+
swe: Kunde inte undersöka undertextspåret
11240+
pol: Nie można sondować ścieżki napisów
11241+
chs: 无法探测字幕轨道
11242+
ukr: Не вдалося дослідити доріжку субтитрів
11243+
kor: 자막 트랙을 조사할 수 없습니다.
11244+
ron: Nu s-a putut sonda pista de subtitrare
11245+
Error checking subtitle format for track:
11246+
eng: Error checking subtitle format for track
11247+
deu: Fehler bei der Überprüfung des Untertitelformats für die Spur
11248+
fra: Erreur de vérification du format des sous-titres pour la piste
11249+
ita: Errore nella verifica del formato dei sottotitoli per la traccia
11250+
spa: Error al comprobar el formato de subtítulos de la pista
11251+
jpn: トラックの字幕フォーマットのチェックエラー
11252+
rus: Ошибка при проверке формата субтитров для дорожки
11253+
por: Erro ao verificar o formato da legenda para a faixa
11254+
swe: Fel vid kontroll av undertextformat för spår
11255+
pol: Błąd sprawdzania formatu napisów dla ścieżki
11256+
chs: 错误检查轨道的字幕格式
11257+
ukr: Помилка перевірки формату субтитрів для доріжки
11258+
kor: 트랙의 자막 형식 확인 중 오류 발생
11259+
ron: Eroare la verificarea formatului subtitrărilor pentru pistă
11260+
'Note: start and end time will be ignored':
11261+
eng: 'Note: start and end time will be ignored'
11262+
deu: 'Hinweis: Start- und Endzeit werden ignoriert.'
11263+
fra: 'Note : les heures de début et de fin seront ignorées.'
11264+
ita: "Nota: l'ora di inizio e di fine viene ignorata."
11265+
spa: 'Nota: se ignorarán las horas de inicio y fin.'
11266+
jpn: 注:開始時間と終了時間は無視されます
11267+
rus: 'Примечание: время начала и окончания будет игнорироваться'
11268+
por: 'Nota: as horas de início e de fim serão ignoradas'
11269+
swe: 'Obs: start- och sluttid kommer att ignoreras'
11270+
pol: 'Uwaga: czas rozpoczęcia i zakończenia będzie ignorowany.'
11271+
chs: 注意:开始和结束时间将被忽略
11272+
ukr: 'Примітка: час початку та закінчення ігнорується'
11273+
kor: '참고: 시작 및 종료 시간은 무시됩니다.'
11274+
ron: 'Notă: ora de început și de sfârșit vor fi ignorate'

fastflix/encoders/modify/command_builder.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@
66

77
def build(fastflix: FastFlix):
88
beginning, ending, output_fps = generate_all(fastflix, "copy", disable_filters=True, audio=False, subs=False)
9-
start_time = fastflix.current_video.video_settings.start_time
10-
fast_seek = fastflix.current_video.video_settings.fast_seek
11-
end_time = fastflix.current_video.video_settings.end_time
129
video_title = fastflix.current_video.video_settings.video_title
1310
video_track_title = fastflix.current_video.video_settings.video_track_title
1411
ffmpeg = fastflix.config.ffmpeg
1512
source = fastflix.current_video.source
1613

17-
time_settings = f"{f'-ss {start_time}' if start_time else ''} {f'-to {end_time}' if end_time else ''} "
18-
time_one = time_settings if fast_seek else ""
19-
time_two = time_settings if not fast_seek else ""
20-
2114
if video_title:
2215
video_title = video_title.replace('"', '\\"')
2316
title = f'-metadata title="{video_title}"' if video_title else ""
@@ -31,11 +24,7 @@ def build(fastflix: FastFlix):
3124
[
3225
f'"{ffmpeg}"',
3326
"-y",
34-
time_one,
3527
f'-i "{source}"',
36-
time_two,
37-
title,
38-
f"{track_title if video_track_title else ''}",
3928
" ", # Leave space after commands
4029
]
4130
)
@@ -48,7 +37,7 @@ def build(fastflix: FastFlix):
4837
subs_path_clean = clean_file_string(subs)
4938
return [
5039
Command(
51-
command=f'{beginning} -i "{audio_path_clean}" -i "{subs_path_clean}" -map 0 -map 1:a -map 2:s -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
40+
command=f'{beginning} -i "{audio_path_clean}" -i "{subs_path_clean}" -map 0 -map 1:a -map 2:s {title} {track_title if video_track_title else ""} -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
5241
name="Add audio and subtitle track",
5342
exe="ffmpeg",
5443
)
@@ -58,7 +47,7 @@ def build(fastflix: FastFlix):
5847
audio_path_clean = clean_file_string(audio)
5948
return [
6049
Command(
61-
command=f'{beginning} -i "{audio_path_clean}" -map 0 -map 1:a -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
50+
command=f'{beginning} -i "{audio_path_clean}" -map 0 -map 1:a {title} {track_title if video_track_title else ""} -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
6251
name="Add audio track",
6352
exe="ffmpeg",
6453
)
@@ -68,7 +57,7 @@ def build(fastflix: FastFlix):
6857
subs_path_clean = clean_file_string(subs)
6958
return [
7059
Command(
71-
command=f'{beginning} -i "{subs_path_clean}" -map 0 -map 1:s -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
60+
command=f'{beginning} -i "{subs_path_clean}" -map 0 -map 1:s {title} {track_title if video_track_title else ""} -c copy {fastflix.current_video.video_settings.video_encoder_settings.extra} {ending}',
7261
name="Add subtitle track",
7362
exe="ffmpeg",
7463
)

fastflix/encoders/modify/settings_panel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def __init__(self, parent, main, app: FastFlixApp):
5555
grid.addWidget(add_sub_track, 4, 0, 1, 1)
5656
grid.addWidget(self.add_sub_track_file_path, 4, 1, 1, 2)
5757

58+
grid.addWidget(QtWidgets.QLabel(t("Note: start and end time will be ignored")), 5, 0)
59+
5860
grid.addWidget(QtWidgets.QWidget(), 6, 0, 6, 1)
5961
grid.addLayout(self._add_custom(disable_both_passes=True), 11, 0, 1, 6)
6062
self.setLayout(grid)

fastflix/ff_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def update_conversion_command(vid, old_path: str, new_path: str):
107107
if not Path(track["file_path"]).exists():
108108
logger.exception("Could not save cover to queue recovery location, removing cover")
109109
continue
110-
new_file = queue_covers / f"{uuid.uuid4().hex}_{track['file_path'].name}"
110+
new_file = queue_covers / f"{uuid.uuid4().hex}_{Path(track['file_path']).name}"
111111
try:
112112
shutil.copy(track["file_path"], new_file)
113113
except OSError:

fastflix/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
__version__ = "5.12.3"
3+
__version__ = "5.12.4"
44
__author__ = "Chris Griffith"

fastflix/widgets/background_tasks.py

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,38 @@ def __init__(self, app: FastFlixApp, main, index, signal, language):
5555
self.language = language
5656

5757
def run(self):
58+
subtitle_format = self._get_subtitle_format()
59+
if subtitle_format is None:
60+
self.main.thread_logging_signal.emit(
61+
f"WARNING:{t('Could not determine subtitle format for track')} {self.index}, {t('skipping extraction')}"
62+
)
63+
self.signal.emit()
64+
return
65+
66+
if subtitle_format == "srt":
67+
extension = "srt"
68+
output_args = ["-c", "srt", "-f", "srt"]
69+
elif subtitle_format == "ass":
70+
extension = "ass"
71+
output_args = ["-c", "copy"]
72+
elif subtitle_format == "ssa":
73+
extension = "ssa"
74+
output_args = ["-c", "copy"]
75+
elif subtitle_format == "pgs":
76+
extension = "sup"
77+
output_args = ["-c", "copy"]
78+
else:
79+
self.main.thread_logging_signal.emit(
80+
f"WARNING:{t('Subtitle Track')} {self.index} {t('is not in supported format (SRT, ASS, SSA, PGS), skipping extraction')}: {subtitle_format}"
81+
)
82+
self.signal.emit()
83+
return
84+
85+
# filename = str(
86+
# Path(self.main.output_video).parent / f"{self.main.output_video}.{self.index}.{self.language}.srt"
87+
# ).replace("\\", "/")
5888
filename = str(
59-
Path(self.main.output_video).parent / f"{self.main.output_video}.{self.index}.{self.language}.srt"
89+
Path(self.main.output_video).parent / f"{self.main.output_video}.{self.index}.{self.language}.{extension}"
6090
).replace("\\", "/")
6191
self.main.thread_logging_signal.emit(f"INFO:{t('Extracting subtitles to')} {filename}")
6292

@@ -69,10 +99,7 @@ def run(self):
6999
self.main.input_video,
70100
"-map",
71101
f"0:s:{self.index}",
72-
"-c",
73-
"srt",
74-
"-f",
75-
"srt",
102+
*output_args,
76103
filename,
77104
],
78105
stdout=PIPE,
@@ -90,6 +117,53 @@ def run(self):
90117
self.main.thread_logging_signal.emit(f"INFO:{t('Extracted subtitles successfully')}")
91118
self.signal.emit()
92119

120+
def _get_subtitle_format(self):
121+
try:
122+
result = run(
123+
[
124+
self.app.fastflix.config.ffprobe,
125+
"-v",
126+
"error",
127+
"-select_streams",
128+
f"s:{self.index}",
129+
"-show_entries",
130+
"stream=codec_name",
131+
"-of",
132+
"default=noprint_wrappers=1:nokey=1",
133+
self.main.input_video,
134+
],
135+
stdout=PIPE,
136+
stderr=STDOUT,
137+
text=True,
138+
)
139+
140+
if result.returncode != 0:
141+
self.main.thread_logging_signal.emit(
142+
f"WARNING:{t('Could not probe subtitle track')} {self.index}: {result.stdout}"
143+
)
144+
return None
145+
146+
codec_name = result.stdout.strip().lower()
147+
if codec_name in ["subrip", "xsub", "webvtt", "mov_text"]:
148+
return "srt"
149+
elif codec_name == "ass":
150+
return "ass"
151+
elif codec_name == "ssa":
152+
return "ssa"
153+
elif codec_name == "hdmv_pgs_subtitle":
154+
return "pgs"
155+
else:
156+
self.main.thread_logging_signal.emit(
157+
f"WARNING:{t('Subtitle Track')} {self.index} {t('is not in supported format (SRT, ASS, SSA, PGS), skipping extraction')}: {codec_name}"
158+
)
159+
return None
160+
161+
except Exception as err:
162+
self.main.thread_logging_signal.emit(
163+
f"WARNING:{t('Error checking subtitle format for track')} {self.index} - {err}"
164+
)
165+
return None
166+
93167

94168
class AudioNoramlize(QtCore.QThread):
95169
def __init__(self, app: FastFlixApp, main, audio_type, signal):

fastflix/widgets/panels/audio_panel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def dup_me(self):
253253
def del_me(self):
254254
self.parent.remove_track(self)
255255
del self.app.fastflix.current_video.audio_tracks[self.index]
256+
self.parent.reorder(update=True)
256257

257258
def set_outdex(self, outdex):
258259
self.app.fastflix.current_video.audio_tracks[self.index].outdex = outdex

0 commit comments

Comments
 (0)