Opened 4 years ago

Last modified 3 years ago

#8726 new enhancement

Inaccurate length display / detection (m4a files)

Reported by: sandreas Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: mov duration
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg seems not to be able to show / dump the accurate length of a file in milliseconds. The example file has an accurate length of 15.832 seconds (15832ms) and now i would like to find out the exact length with ffmpeg, but it always cuts it down to 15.83 seconds (15830ms). I think it might have to do something with the time format always truncated to two decimal places for milliseconds.

Is there a way to come across this?

How to reproduce:

wget -c https://dl.espressif.com/dl/audio/gs-16b-2c-44100hz.m4a 
 
ffmpeg -hide_banner -i gs-16b-2c-44100hz.m4a -f null -

#...
#  Duration: 00:00:15.83, start: 0.000000, bitrate: 690 kb/s
#...   
#size=N/A time=00:00:15.83 bitrate=N/A speed= 346x    


ffmpeg -hide_banner -i gs-16b-2c-44100hz.m4a -f ffmetadata -

#...
#  Duration: 00:00:15.83, start: 0.000000, bitrate: 690 kb/s
#...
#size=       0kB time=-577014:32:22.77 bitrate=N/A speed=N/A    


mp4info gs-16b-2c-44100hz.m4a 

#mp4info version 2.0.0
#gs-16b-2c-44100hz.m4a:
#1	audio	alac, 15.832 secs, 690 kbps, 44100 Hz

Change History (3)

comment:1 by Carl Eugen Hoyos, 4 years ago

Keywords: mov duration added; inaccurate length time display removed
Priority: normalwish
Type: defectenhancement
Version: unspecifiedgit-master

comment:2 by Balling, 3 years ago

First of all this file is 15 s 833 ms, because editlist says:

Track duration: 15833 (0x00003DD9) - 15833 (0x3DD9) ms

mdhd also confirms that:
14D793 Duration: 698194 (0x000AA752) - 15832 (0x3DD8) ms

since mdhd says the duration before applying the editlist, so it is not some mistake. f37e66b3937a914e16d89a9050f042ad89567245

tkhd

14D70F Duration: 15833 (0x00003DD9) - 15833 (0x3DD9) ms

Same in mvhd

14D697 Duration: 15833 (0x00003DD9) - 15833 ms

(Those two are after editlist, so again correct.)

Last edited 3 years ago by Balling (previous) (diff)

in reply to:  2 comment:3 by sandreas, 3 years ago

Thanks for taking a look. Maybe it would be possible to get both values ("before edit" list value and "after edit list" value).

I would also like to point out, that even with the ffmetadata there is no way to get the exact duration in milliseconds from a command line.

Is there a workaround, that I'm not aware of?

Replying to Balling:

First of all this file is 15 s 833 ms, because editlist says:

Track duration: 15833 (0x00003DD9) - 15833 (0x3DD9) ms

mdhd also confirms that:
14D793 Duration: 698194 (0x000AA752) - 15832 (0x3DD8) ms

since mdhd says the duration before applying the editlist, so it is not some mistake. f37e66b3937a914e16d89a9050f042ad89567245

tkhd

14D70F Duration: 15833 (0x00003DD9) - 15833 (0x3DD9) ms

Same in mvhd

14D697 Duration: 15833 (0x00003DD9) - 15833 ms

(Those two are after editlist, so again correct.)

Note: See TracTickets for help on using tickets.