ffprobe-python icon indicating copy to clipboard operation
ffprobe-python copied to clipboard

Would like duration in milliseconds rather than rounded seconds.

Open thomergil opened this issue 4 years ago • 0 comments

I would like FFProbe to tell me the duration in milliseconds. I created a workaround as follows, but would like native support:

mp4_data = FFProbe(mp4_file)
duration_s = mp4_data.__dict__['metadata']['Duration']

# convert to duration by pretending it's a time since 00:00:00.00
zero = datetime.datetime.strptime('00:00:00.00', '%H:%M:%S.%f')
duration = datetime.datetime.strptime(duration_s, '%H:%M:%S.%f') - zero
total_duration += duration.seconds * 1000 + duration.microseconds / 1000

thomergil avatar Jan 09 '21 13:01 thomergil