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