如何从 pts 和 time_base 或 duration 获取视频或 rtmp 流中帧的时间戳?非常感谢!
import av
def init_input(file_name):
global a
container = av.open(file_name)
a = container.duration
return container.decode(video=0)
url = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"
stream1 = init_input(url)
for frame1 in stream1:
print(frame1.pts)
print(frame1.time_base)
PS:frame.time 与实际时间不符