From 7c6120bae3ed4e7cdd015b536a53bb2724967013 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sat, 2 Jan 2016 02:09:32 +0100 Subject: set initial segment size to 20, replace test data, handle missing pkt_duration_time --- mediabrowser/ffmpeg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mediabrowser') diff --git a/mediabrowser/ffmpeg.py b/mediabrowser/ffmpeg.py index b174b59..d8d40f5 100644 --- a/mediabrowser/ffmpeg.py +++ b/mediabrowser/ffmpeg.py @@ -72,7 +72,7 @@ def find_next_keyframe(ospath, start, max_offset): data[name] = value - if 'pkt_duration_time' in data: + if 'pkt_duration_time' in data and data['pkt_duration_time'][1:-1] != "N/A": prev_duration = float(data['pkt_duration_time'][1:-1]) if 'key_frame' in data and data['key_frame'] == '1' and prev_duration is not None: @@ -103,7 +103,7 @@ def calculate_splittimes(ospath, chunk_duration): """ def calculate_points(media_duration): - pos = 10 + pos = min(20, media_duration) while pos < media_duration: yield pos pos += chunk_duration @@ -140,4 +140,4 @@ def thumbnail_video(ospath, width, height): command += shlex.split("-c:v libvpx -deadline realtime -f webm pipe:") encoder = LoggedPopen(command, stdout=PIPE) - return encoder.stdout \ No newline at end of file + return encoder.stdout -- cgit v1.2.1