disable interlaced check; speedest detection
This commit is contained in:
13
vid_convert.py
Normal file → Executable file
13
vid_convert.py
Normal file → Executable file
@@ -110,9 +110,13 @@ def cropping(file, infos):
|
|||||||
'''
|
'''
|
||||||
logging.info("Détection de la taille de l'image...")
|
logging.info("Détection de la taille de l'image...")
|
||||||
duration_tier = int(infos['duration'] / 3)
|
duration_tier = int(infos['duration'] / 3)
|
||||||
command = f"ffmpeg -loglevel info -i {file} -ss {duration_tier} -t {duration_tier} -an -f null -vf cropdetect -y /dev/null"
|
command = f"ffmpeg -loglevel info -i {file} -ss {duration_tier} -t {int(duration_tier / 10)} -an -f null -vf cropdetect -y /dev/null"
|
||||||
logging.debug(command)
|
logging.debug(command)
|
||||||
cropsize = subprocess.getoutput(command).splitlines()[-3].split()[-1]
|
line = -3
|
||||||
|
cropsize = "times"
|
||||||
|
while cropsize == "times" or ":" not in cropsize:
|
||||||
|
cropsize = subprocess.getoutput(command).splitlines()[line].split()[-1]
|
||||||
|
line -= 1
|
||||||
logging.debug(f"Paramètre de découpe : {cropsize}")
|
logging.debug(f"Paramètre de découpe : {cropsize}")
|
||||||
return cropsize
|
return cropsize
|
||||||
|
|
||||||
@@ -301,7 +305,8 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
logging.basicConfig(format='[%(asctime)s]\n%(message)s', level=logging.INFO, datefmt='%d/%m/%Y %H:%M:%S')
|
logging.basicConfig(format='[%(asctime)s]\n%(message)s', level=logging.INFO, datefmt='%d/%m/%Y %H:%M:%S')
|
||||||
file = args.f_input
|
file = args.f_input
|
||||||
infos = get_infos(file)
|
# infos = get_infos(file)
|
||||||
|
interlaced = False
|
||||||
interlaced = is_interlaced(file, infos)
|
interlaced = is_interlaced(file, infos)
|
||||||
cropsize = cropping(file, infos)
|
cropsize = cropping(file, infos)
|
||||||
volumes = volume_audio(file, infos)
|
volumes = volume_audio(file, infos)
|
||||||
@@ -321,7 +326,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
vid_part_time = 0
|
vid_part_time = 0
|
||||||
while vid_part_time < infos['duration']:
|
while vid_part_time < infos['duration']:
|
||||||
crf = 19
|
crf = 20
|
||||||
convert_video(file, infos, vid_part_time, cropsize, crf, animation, interlaced, args.vhs)
|
convert_video(file, infos, vid_part_time, cropsize, crf, animation, interlaced, args.vhs)
|
||||||
vid_part_time += 300
|
vid_part_time += 300
|
||||||
create_mkv(file)
|
create_mkv(file)
|
||||||
|
|||||||
Reference in New Issue
Block a user