use metadata from ffmpeg2theora if available
This commit is contained in:
parent
2f129c4766
commit
25c203e981
1 changed files with 14 additions and 8 deletions
|
@ -178,6 +178,12 @@ def avinfo(filename, cached=True):
|
|||
v['display_aspect_ratio'] = '%d:%d' % (v['width'], v['height'])
|
||||
v['pixel_aspect_ratio'] = '1:1'
|
||||
if len(info.get('audio', [])) > 1:
|
||||
if 'metadata' in info['audio'][0]:
|
||||
for stream in info['audio']:
|
||||
language = stream.get('metadata', {}).get('language')
|
||||
if language and language != 'und':
|
||||
stream['language'] = language[0]
|
||||
else:
|
||||
ffmpeg = cmd('ffmpeg')
|
||||
p = subprocess.Popen([ffmpeg, '-i', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
|
|
Loading…
Reference in a new issue