summaryrefslogtreecommitdiff
path: root/hacks/check_packets.py
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-02-13 17:29:47 +0100
committerCarl Hetherington <cth@carlh.net>2020-02-13 17:30:54 +0100
commita6ca3acafbfb6a868f10a9e9e1e7c61008643e72 (patch)
treeb6b4c1137ec4b7959b592cda6ff949b123fffad5 /hacks/check_packets.py
parent9d87639be7c1f108f249944632273d15afaed70b (diff)
Rename and extend check_packets.py
Diffstat (limited to 'hacks/check_packets.py')
-rw-r--r--hacks/check_packets.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/hacks/check_packets.py b/hacks/check_packets.py
deleted file mode 100644
index 22d2aa434..000000000
--- a/hacks/check_packets.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-
-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 (%d) is same as or behind %f (%d)' % (frame['pkt_pts_time'], frame['pkt_pts'], last_video_pts, last_video)
- elif last_video_pts is not None:
- print 'OK frame %f %f %f' % (frame['pkt_pts_time'], frame['pkt_pts_time'] - last_video_pts, 1 / (frame['pkt_pts_time'] - last_video_pts))
- 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)
-frame = dict()
-while True:
- l = p.stdout.readline()
- if l == '':
- break
-
- l = l.strip()
-
- if l == '[/FRAME]':
- handle(frame)
- frame = dict()
- elif l != '[FRAME]' and l != '[SIDE_DATA]' and l != '[/SIDE_DATA]':
- s = l.split('=')
- if s[0] == 'pkt_pts_time':
- frame[s[0]] = float(s[1])
- elif s[0] == 'pkt_pts':
- frame[s[0]] = float(s[1])
- elif len(s) > 1:
- frame[s[0]] = s[1]