jiaaro / pydub

Manipulate audio with a simple and easy high level interface
http://pydub.com
MIT License
8.86k stars 1.04k forks source link

Bug with the new version of mediainfo #230

Open maelp opened 6 years ago

maelp commented 6 years ago

Steps to reproduce

Getting the duration of an opus-encoded file with avprobe

Expected behavior

Should show the duration

Actual behavior

Returns 'N/A'

Your System configuration

Is there an audio file you can include to help us reproduce?

The duration seems to be correctly returned in the [FORMAT], but is then overwritten by the [STREAM]

avprobe -v quiet -show_format -show_streams -of old k_GdFTIrV4s.webm
[FORMAT]
filename=k_GdFTIrV4s.webm
nb_streams=1
format_name=matroska,webm
format_long_name=Matroska / WebM
start_time=0.000000
duration=880.001000
size=12407933.000000
bit_rate=0.000000
[/FORMAT]

[STREAM]
index=0
codec_name=opus
codec_long_name=Opus (Opus Interactive Audio Codec)
codec_type=audio
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_rate=48000.000000
channels=1
bits_per_sample=0
avg_frame_rate=0/0
time_base=1/1000
start_time=0.000000
duration=N/A
TAG:language=eng
[/STREAM]
maelp commented 6 years ago

Also it would be nice to have an option to force to select avprobe or ffprobe, it could be mediainfo(filename, prefer_ffmpeg=True)