load subtitle info
This commit is contained in:
parent
d632cd3803
commit
b49acd47dc
1 changed files with 12 additions and 0 deletions
12
ox/file.py
12
ox/file.py
|
@ -293,6 +293,18 @@ def ffprobe(filename):
|
||||||
'sample_aspect_ratio': 'pixel_aspect_ratio',
|
'sample_aspect_ratio': 'pixel_aspect_ratio',
|
||||||
}.get(key, key)] = fix_value(key, s[key])
|
}.get(key, key)] = fix_value(key, s[key])
|
||||||
info[s['codec_type']].append(stream)
|
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:
|
else:
|
||||||
pass
|
pass
|
||||||
# print s
|
# print s
|
||||||
|
|
Loading…
Reference in a new issue