bit_rate 是码率
average_rate 是帧率
import av
video_file_path='/Volumes/SanDisk128G/标准视频/XiaoShengKeDeJiuShu_4-1080P.mp4'
with av.open(str(video_file_path), metadata_encoding='utf-8', metadata_errors='ignore') as container:
stream = container.streams.video[0]
print(stream.average_rate)
print(stream.bit_rate)
输出结果:
╰─➤ python -u "/Users/ponponon/Desktop/code/me/pyav_example/1.py" 1 ↵
30
2631562