Update main.py

This commit is contained in:
Zen 2020-01-08 02:39:49 +02:00
parent 1adf9e4aca
commit d1184b123d

13
main.py
View file

@ -1,5 +1,12 @@
#!/usr/bin/python3
"""
mkvmerge required (python-pymkv)
"""
import sys
import os
import subprocess
import scenedetect
def get_cpu_count():
@ -10,7 +17,7 @@ def get_ram():
return round((os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')) / (1024. ** 3), 3)
cmd = 'scenedetect --input my_video.mp4 --output my_video_scenes --stats my_video.stats.csv detect-content list-scenes'
d = subprocess.call(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def split_video(input_vid):
cmd2 = f'scenedetect -i {input_vid} --output output detect-content list-scenes split-video -c'
subprocess.call(cmd2, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)