ffmpeg查看音频文件信息


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

import subprocess
import json
path = r'D:\learn\download\NosVJ60QCIs0b8PVHMPomZJsrFU2b8eRnuiZp9yz.aac'
command = (r'ffprobe -print_format json -loglevel quiet -show_streams %s'%path)
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']

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM