diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-08 23:55:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-11-08 23:55:32 +0100 |
| commit | 7e355e7f3518eddbf544f299e9e4ab9c9cf482ac (patch) | |
| tree | 6bb00f0b0eb81066bfccb0e43d09c9e763ca92e1 | |
| parent | bb285dedfb798ddaada80fdfdddf5873cb990289 (diff) | |
check_packets.py hack tweaks.
| -rw-r--r-- | hacks/check_packets.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hacks/check_packets.py b/hacks/check_packets.py index 916813a1f..f8075db47 100644 --- a/hacks/check_packets.py +++ b/hacks/check_packets.py @@ -4,15 +4,18 @@ import subprocess import shlex import sys +last_video = None last_video_pts = None def handle(frame): + global last_video global last_video_pts if frame['media_type'] == 'video': if last_video_pts is not None and frame['pkt_pts_time'] <= last_video_pts: - print 'Out of order video frame %f is ahead of %f' % (frame['pkt_pts_time'], last_video_pts) + print 'Out of order video frame %f (%d) is same as or behind %f (%d)' % (frame['pkt_pts_time'], frame['pkt_pts'], last_video_pts, last_video) else: print 'OK frame %f' % frame['pkt_pts_time'] + last_video = frame['pkt_pts'] last_video_pts = frame['pkt_pts_time'] p = subprocess.Popen(shlex.split('ffprobe -show_frames %s' % sys.argv[1]), stdin=None, stdout=subprocess.PIPE) @@ -31,5 +34,7 @@ while True: s = l.split('=') if s[0] == 'pkt_pts_time': frame[s[0]] = float(s[1]) - else: + elif s[0] == 'pkt_pts': + frame[s[0]] = float(s[1]) + elif len(s) > 1: frame[s[0]] = s[1] |
