bpwhelan / GameSentenceMiner

This is (was) a simple project, that watchdogs a folder for a recording (I use OBS with "Replay Buffer"), converts it to audio, trims it according to clipboard and a Local Language Model before adding it to a flashcard.
7 stars 1 forks source link

Random stacktrace, OBS issue? not sure #25

Closed bpwhelan closed 2 days ago

bpwhelan commented 6 days ago

Traceback (most recent call last): File "C:\Users\Beangate\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "C:\Users\Beangate\Dev\Pycharm\venv\autoConvertGameReplayToAudio\Lib\site-packages\watchdog\observers\api.py", line 213, in run self.dispatch_events(self.event_queue) File "C:\Users\Beangate\Dev\Pycharm\venv\autoConvertGameReplayToAudio\Lib\site-packages\watchdog\observers\api.py", line 391, in dispatchevents handler.dispatch(event) File "C:\Users\Beangate\Dev\Pycharm\venv\autoConvertGameReplayToAudio\Lib\site-packages\watchdog\events.py", line 217, in dispatch getattr(self, f"on{event.event_type}")(event) File "C:\Users\Beangate\PycharmProjects\TrimJapaneseGameAudioV2\main.py", line 26, in on_created self.convert_to_audio(event.src_path) File "C:\Users\Beangate\PycharmProjects\TrimJapaneseGameAudioV2\main.py", line 34, in convert_to_audio trimmed_audio = get_audio_and_trim(video_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Beangate\PycharmProjects\TrimJapaneseGameAudioV2\ffmpeg.py", line 86, in get_audio_and_trim return trim_audio_based_on_clipboard(untrimmed_audio, video_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Beangate\PycharmProjects\TrimJapaneseGameAudioV2\ffmpeg.py", line 105, in trim_audio_based_on_clipboard file_length = get_video_duration(video_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Beangate\PycharmProjects\TrimJapaneseGameAudioV2\ffmpeg.py", line 99, in get_video_duration return float(duration_info["format"]["duration"]) # Return the duration in seconds


KeyError: 'duration'
bpwhelan commented 6 days ago

This is just to log it, not sure if it's a fix angle cause idk what even happened tbh

Maybe the file was still being written and we tried to extract it? maybe just a retry would suffice