You've already forked FrameTour-RenderWorker
Compare commits
2 Commits
ca9093504f
...
9158854411
| Author | SHA1 | Date | |
|---|---|---|---|
| 9158854411 | |||
| 634dc6c855 |
@@ -127,9 +127,9 @@ class FinalizeMp4Handler(BaseHandler):
|
||||
concat_file = os.path.join(work_dir, 'concat.txt')
|
||||
with open(concat_file, 'w', encoding='utf-8') as f:
|
||||
for ts_file in ts_files:
|
||||
# 路径中的反斜杠需要转义或使用正斜杠
|
||||
ts_path = ts_file.replace('\\', '/')
|
||||
f.write(f"file '{ts_path}'\n")
|
||||
# FFmpeg concat 路径相对于 concat.txt 所在目录,只需写文件名
|
||||
ts_filename = os.path.basename(ts_file)
|
||||
f.write(f"file '{ts_filename}'\n")
|
||||
|
||||
# 3. 构建合并命令(remux,不重编码)
|
||||
cmd = [
|
||||
|
||||
@@ -292,6 +292,14 @@ class MaterialCache:
|
||||
for file_info in cache_files:
|
||||
if total_size <= target_size:
|
||||
break
|
||||
# 从文件名提取 cache_key,检查是否有锁(说明正在被使用)
|
||||
filename = os.path.basename(file_info['path'])
|
||||
cache_key = os.path.splitext(filename)[0]
|
||||
lock_path = self._get_lock_path(cache_key)
|
||||
if os.path.exists(lock_path):
|
||||
# 该文件正在被其他任务使用,跳过删除
|
||||
logger.debug(f"Cache cleanup: skipping locked file {filename}")
|
||||
continue
|
||||
try:
|
||||
os.remove(file_info['path'])
|
||||
total_size -= file_info['size']
|
||||
|
||||
Reference in New Issue
Block a user