Added threshold option

This commit is contained in:
Zen 2020-01-13 06:46:14 +02:00
parent b410f576a7
commit 51c16b6d8b

View file

@ -69,6 +69,8 @@ class Av1an:
self.workers = 0
self.encoder = 'aomenc'
self.args = None
self.audio = None
self.threshold = 20
def arg_parsing(self):
"""
@ -84,8 +86,8 @@ class Av1an:
parser.add_argument('--file_path', '-i', type=str, default='bruh.mp4', help='Input File', required=True)
parser.add_argument('--encoder', '-enc', type=str, default='aomenc', help='Choosing encoder')
parser.add_argument('--workers', '-t', type=int, default=0, help='Number of workers')
parser.add_argument('--audio_params', '-a', type=str, default=default_audio,
help='ffmpeg audio encode settings')
parser.add_argument('--audio_params', '-a', type=str, default=default_audio, help='FFmpeg audio settings')
parser.add_argument('--threshold', '-tr', type=int, default=default_audio, help='PySceneDetect Threshold')
args = parser.parse_args()
return args
@ -129,6 +131,8 @@ class Av1an:
Encoding audio if needed
"""
cmd = f'{FFMPEG} -i {join(os.getcwd(),input_vid)} -vn {audio_params} {join(os.getcwd(),".temp","audio.mkv")}'
check = fr'ffprobe -hide_banner -loglevel error -i {join(self.here,input_vid)} -show_streams -select_streams a'
os.system(check)
Popen(cmd, shell=True).wait()
def split_video(self, input_vid):