From b49acd47dc9d8da00226ba7f7eef712f2c5fdae2 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 1 Aug 2019 16:28:00 +0200 Subject: [PATCH] load subtitle info --- ox/file.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ox/file.py b/ox/file.py index ab789a3..58f2a49 100644 --- a/ox/file.py +++ b/ox/file.py @@ -293,6 +293,18 @@ def ffprobe(filename): 'sample_aspect_ratio': 'pixel_aspect_ratio', }.get(key, key)] = fix_value(key, s[key]) info[s['codec_type']].append(stream) + elif s.get('codec_type') == 'subtitle': + info['subtitles'] = info.get('subtitles', []) + stream = {} + for key in ( + 'codec_name', 'language' + ): + if key in s: + stream[{ + 'codec_name': 'codec', + + }.get(key, key)] = s[key] + info['subtitles'].append(stream) else: pass # print s