Bound per-input decoder and scene detection threads
This commit is contained in:
parent
9b78fbc9f7
commit
41e2db9ca7
@ -88,7 +88,7 @@ export async function renderEditPlan(
|
||||
audio = `a${i}`;
|
||||
}
|
||||
await ffmpeg([
|
||||
...normalized.flatMap((file) => ["-i", file]),
|
||||
...normalized.flatMap((file) => ["-threads", "2", "-i", file]),
|
||||
"-filter_complex",
|
||||
filters.join(";"),
|
||||
"-map",
|
||||
|
||||
@ -41,6 +41,8 @@ def analyze(data):
|
||||
result={'scenes':[], 'active':[], 'subtitles':[], 'beats':[], 'warnings':[]}
|
||||
duration=data.get('duration',0)
|
||||
if data.get('video'):
|
||||
import cv2
|
||||
cv2.setNumThreads(2)
|
||||
from scenedetect import detect,AdaptiveDetector
|
||||
result['scenes']=[[round(a.get_seconds()*1e6),round(b.get_seconds()*1e6)] for a,b in detect(data['video'],AdaptiveDetector(min_scene_len=15),start_in_scene=True)] or [[0,duration]]
|
||||
if data.get('audio'):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user