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