1. 程式人生 > >ffmpeg查看音頻文件信息

ffmpeg查看音頻文件信息

RoCE span open exe level streams str stdout course

查看音頻文件的信息(基於本地路徑)

import json
import subprocess
command = ["ffprobe.exe", "-loglevel", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-i",
           rD:\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",
           rhttps://imglive.ehafo.com/course/temp/2019/02/ZlliRoa7fPPgofrGP2okVVBjgh3k43P518sw1AUd.aac
]

ffmpeg查看音頻文件信息