2020-01-08 00:39:49 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
"""
|
|
|
|
mkvmerge required (python-pymkv)
|
|
|
|
"""
|
|
|
|
|
|
|
|
import sys
|
2020-01-08 00:20:18 +00:00
|
|
|
import os
|
|
|
|
import subprocess
|
2020-01-08 00:39:49 +00:00
|
|
|
import scenedetect
|
2020-01-08 00:20:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
def get_cpu_count():
|
|
|
|
return os.cpu_count()
|
|
|
|
|
|
|
|
|
|
|
|
def get_ram():
|
|
|
|
return round((os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')) / (1024. ** 3), 3)
|
|
|
|
|
|
|
|
|
2020-01-08 00:39:49 +00:00
|
|
|
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)
|
2020-01-08 00:20:18 +00:00
|
|
|
|