diff --git a/ox/file.py b/ox/file.py index 081cda3..2b0bd2d 100644 --- a/ox/file.py +++ b/ox/file.py @@ -264,17 +264,20 @@ def ffprobe(filename): 'r_frame_rate': 'framerate', 'sample_rate': 'samplerate', 'pix_fmt': 'pixel_format', + 'sample_aspect_ratio': 'pixel_aspect_ratio', }.get(key, key)] = fix_value(key, s[key]) info[s['codec_type']].append(stream) else: pass #print s for v in info['video']: - if not 'display_aspect_ratio' in v and 'width' in v: - v['display_aspect_ratio'] = '%d:%d' % (v['width'], v['height']) + k = 'display_aspect_ratio' + if not k in v and 'width' in v \ + or (k in v and v[k] == '0:1'): + v[k] = '%d:%d' % (v['width'], v['height']) v['pixel_aspect_ratio'] = '1:1' info['oshash'] = oshash(filename) - info['path'] = os.path.basename(filename) + info['path'] = filename return info def makedirs(path):