map track language to track

This commit is contained in:
j 2014-07-20 11:20:43 +02:00
parent 2bd1c7d657
commit bc9c3c8944

View file

@ -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:
if t == 'language':
language = tags[t]
else:
info['metadata'][t] = tags[t] 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',