Add NVIDIA support for FFmpeg in Docker and enhance chat rendering functionality
All checks were successful
Publish Twitch Archive Container / publish (push) Successful in 7m36s

- Introduced a new docker-compose.nvidia.yml for NVIDIA GPU support.
- Updated dockerstart.bat to allow optional NVIDIA runtime.
- Enhanced ContentDownloader to manage chat rendering status and font settings.
- Improved hardware acceleration detection in utils.py.
- Added tests for hardware acceleration and chat rendering behavior.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
MaddoScientisto 2026-04-25 12:28:59 +02:00
commit ec44981a9d
8 changed files with 226 additions and 18 deletions

View file

@ -425,6 +425,7 @@ class TwitchArchive:
# Process the raw stream file
processing_succeeded = self.processor.process_raw_stream(live_raw_path, live_proc_path)
self.downloader.reset_chat_render_status()
# Wait for live chat download if it was started
live_chat_downloaded = False
@ -585,7 +586,14 @@ class TwitchArchive:
print(f'{Fore.YELLOW}⚠ No matching VOD found for this stream{Style.RESET_ALL}')
# Clean up raw files if configured
if processing_succeeded:
chat_render_retry_needed = (
self.downloader.last_chat_render_attempted and
not self.downloader.last_chat_render_succeeded
)
if chat_render_retry_needed:
print(f'{Fore.YELLOW}⚠ Preserving local files because chat rendering failed and can be retried later{Style.RESET_ALL}')
elif processing_succeeded:
self.file_manager.clean_raw_file(live_raw_path)
elif os.path.exists(live_raw_path):
print(f'{Fore.YELLOW}⚠ Keeping raw file because conversion did not complete successfully{Style.RESET_ALL}')
@ -597,7 +605,7 @@ class TwitchArchive:
)
# Delete local files if configured and upload succeeded
if self.deleteFiles and self.uploadCloud and upload_success:
if self.deleteFiles and self.uploadCloud and upload_success and not chat_render_retry_needed:
self.file_manager.delete_local_files(
filename_base,
live_raw_path,
@ -1204,6 +1212,7 @@ class TwitchArchiveManager:
processing_succeeded = False
if not archiver.onlyRaw:
processing_succeeded = archiver.processor.process_raw_stream(live_raw_path, live_proc_path)
archiver.downloader.reset_chat_render_status()
# Wait for live chat download if it was started
live_chat_downloaded = False
@ -1396,7 +1405,14 @@ class TwitchArchiveManager:
archiver.file_manager.save_metadata(stream_info, filename_base)
# Clean up raw file if configured
if processing_succeeded:
chat_render_retry_needed = (
archiver.downloader.last_chat_render_attempted and
not archiver.downloader.last_chat_render_succeeded
)
if chat_render_retry_needed:
print(f'{Fore.YELLOW}⚠ Preserving local files because chat rendering failed and can be retried later{Style.RESET_ALL}')
elif processing_succeeded:
archiver.file_manager.clean_raw_file(live_raw_path)
elif os.path.exists(live_raw_path):
print(f'{Fore.YELLOW}⚠ Keeping raw file because conversion did not complete successfully{Style.RESET_ALL}')
@ -1408,7 +1424,7 @@ class TwitchArchiveManager:
)
# Delete files if configured
if archiver.deleteFiles and archiver.uploadCloud and upload_success:
if archiver.deleteFiles and archiver.uploadCloud and upload_success and not chat_render_retry_needed:
archiver.file_manager.delete_local_files(
filename_base,
live_raw_path,