I need to determine the duration of the video without relying on ffmpeg/ffprobe. To accomplish this, I created a program that searches for the mvhd box, reads its timescale and duration, and calculates the duration in seconds by dividing the duration by the timescale.
To validate my approach, I compared the calculated duration with the result obtained from ffprobe. However, there was a slight discrepancy. For instance, the calculated duration was 26.031 seconds (26031/1000), whereas ffprobe reported it as 25.98 seconds.
I'm curious about the reason behind this inconsistency. Is it possible that the video metadata stored in the mvhd box differs from the actual length of the video?