Thumbnail Generation Refactoring (#16)

* Fix file_list and convert save_first_frame to use FFMPEG directly

* All thumbnail generation now uses FFMPEG engine
This commit is contained in:
2023-06-15 13:06:46 -05:00
committed by GitHub
parent cae5dbb41c
commit 0a0a228731
4 changed files with 13 additions and 58 deletions

View File

@@ -1,13 +1,9 @@
import json
import logging
import os
import subprocess
import threading
import requests
from .ffmpeg_helper import generate_thumbnail, save_first_frame
from lib.workers.base_worker import RenderStatus
logger = logging.getLogger()
@@ -21,8 +17,8 @@ def generate_thumbnail_for_job(job, thumb_video_path, thumb_image_path, max_widt
try:
logger.debug(f"Generating video thumbnail for {source}")
generate_thumbnail(source_path=source, dest_path=thumb_video_path, max_width=max_width)
except Exception as e:
logger.error(f"Error generating thumbnail for {source}: {e}")
except subprocess.CalledProcessError as e:
logger.error(f"Error generating video thumbnail for {source}: {e}")
try:
os.remove(in_progress_path)