Plus d'informations audio

This commit is contained in:
Antoine Van Elstraete 2021-06-20 01:27:05 +02:00
parent 85e830e7af
commit b049d8a6a0

View File

@ -39,7 +39,9 @@ def get_infos(file):
for a_stream in full_a_infos['streams']:
a_stream_infos = {
'index': a_stream['index'],
'channels': a_stream['channels']}
'channels': a_stream['channels'],
'language': a_stream['tags']['language'],
'title': a_stream['tags']['title']}
a_infos.append(a_stream_infos)
duration = subprocess.getoutput(f"ffprobe -v quiet -print_format json -show_format {file}")
duration = json.loads(duration)
@ -47,10 +49,8 @@ def get_infos(file):
hdr10_v_cmd = f'ffmpeg -loglevel panic -i {file} -c:v copy -vbsf hevc_mp4toannexb -f hevc - | ./hdr10plus_parser -o metadata.json --verify -'
hdr10_v_raw = subprocess.getoutput(hdr10_v_cmd)
logging.debug(hdr10_v_raw)
import pdb; pdb.set_trace()
if 'metadata detected' in hdr10_v_raw:
hdr10_cmd = f'ffmpeg -loglevel panic -i {file} -c:v copy -vbsf hevc_mp4toannexb -f hevc - | ./hdr10plus_parser -o /tmp/{file}_hdr10_metadata.json -'
hdr10_raw = subprocess.getoutput(hdr10_cmd)
v_infos.update({'hdr10': True, 'hdr10_metdata': f'/tmp/{file}_hdr10_metadata.json'})
infos = {'duration': duration, 'video': v_infos, 'audio': a_infos}
logging.debug("Informations du film : \n" + json.dumps(infos, indent=True))
@ -136,5 +136,6 @@ if __name__ == '__main__':
interlaced = is_interlaced(args.f_input, infos)
cropsize = cropping(args.f_input, infos)
volumes = volume_audio(args.f_input, infos)
if args.stab:
stabilization(args.f_input)