ffmpeg查看音频文件信息

查看音频文件的信息(基于本地路径)

import json
import subprocess
command = ["ffprobe.exe", "-loglevel", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-i",
           r'D:\learn\audio\2.aac']
result = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out = result.stdout.read()
temp = str(out.decode('utf-8'))
print(json.loads(temp))

也可以把本地路径换成文件的url地址

command = ["ffprobe.exe", "-loglevel", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-i",
           r'https://imglive.ehafo.com/course/temp/2019/02/ZlliRoa7fPPgofrGP2okVVBjgh3k43P518sw1AUd.aac']

猜你喜欢

转载自www.cnblogs.com/li1992/p/10437101.html