From bc9c3c894481db247587bbb43a1b74898a52a234 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 20 Jul 2014 11:20:43 +0200 Subject: [PATCH] map track language to track --- ox/file.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ox/file.py b/ox/file.py index 466f68d..06bbbfa 100644 --- a/ox/file.py +++ b/ox/file.py @@ -215,10 +215,16 @@ def ffprobe(filename): info['metadata'] = ffinfo['format'].get('tags', {}) for s in ffinfo['streams']: tags = s.pop('tags', {}) + language = None 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'): stream = {} + if language and language != 'und': + stream['language'] = language keys = [ 'codec_name', 'width',