mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
Added threshold option
This commit is contained in:
parent
b410f576a7
commit
51c16b6d8b
1 changed files with 6 additions and 2 deletions
8
av1an.py
8
av1an.py
|
@ -69,6 +69,8 @@ class Av1an:
|
||||||
self.workers = 0
|
self.workers = 0
|
||||||
self.encoder = 'aomenc'
|
self.encoder = 'aomenc'
|
||||||
self.args = None
|
self.args = None
|
||||||
|
self.audio = None
|
||||||
|
self.threshold = 20
|
||||||
|
|
||||||
def arg_parsing(self):
|
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('--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('--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('--workers', '-t', type=int, default=0, help='Number of workers')
|
||||||
parser.add_argument('--audio_params', '-a', type=str, default=default_audio,
|
parser.add_argument('--audio_params', '-a', type=str, default=default_audio, help='FFmpeg audio settings')
|
||||||
help='ffmpeg audio encode settings')
|
parser.add_argument('--threshold', '-tr', type=int, default=default_audio, help='PySceneDetect Threshold')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@ -129,6 +131,8 @@ class Av1an:
|
||||||
Encoding audio if needed
|
Encoding audio if needed
|
||||||
"""
|
"""
|
||||||
cmd = f'{FFMPEG} -i {join(os.getcwd(),input_vid)} -vn {audio_params} {join(os.getcwd(),".temp","audio.mkv")}'
|
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()
|
Popen(cmd, shell=True).wait()
|
||||||
|
|
||||||
def split_video(self, input_vid):
|
def split_video(self, input_vid):
|
||||||
|
|
Loading…
Reference in a new issue