map track language to track
This commit is contained in:
parent
2bd1c7d657
commit
bc9c3c8944
1 changed files with 7 additions and 1 deletions
|
@ -215,10 +215,16 @@ def ffprobe(filename):
|
||||||
info['metadata'] = ffinfo['format'].get('tags', {})
|
info['metadata'] = ffinfo['format'].get('tags', {})
|
||||||
for s in ffinfo['streams']:
|
for s in ffinfo['streams']:
|
||||||
tags = s.pop('tags', {})
|
tags = s.pop('tags', {})
|
||||||
|
language = None
|
||||||
for t in tags:
|
for t in tags:
|
||||||
info['metadata'][t] = tags[t]
|
if t == 'language':
|
||||||
|
language = tags[t]
|
||||||
|
else:
|
||||||
|
info['metadata'][t] = tags[t]
|
||||||
if s.get('codec_type') in ('audio', 'video'):
|
if s.get('codec_type') in ('audio', 'video'):
|
||||||
stream = {}
|
stream = {}
|
||||||
|
if language and language != 'und':
|
||||||
|
stream['language'] = language
|
||||||
keys = [
|
keys = [
|
||||||
'codec_name',
|
'codec_name',
|
||||||
'width',
|
'width',
|
||||||
|
|
Loading…
Reference in a new issue