I am trying to determine the duration of an MP4 video using ffmpeg, which is possible of course, except that when the data is streamed in via stdin (a requirement in my case) the duration is reported to be smaller than it actually is. I have the same problem with ffprobe.
The video's actual length is ~13 seconds.
Examples below of the output I receive using ffprobe.
Reading file from disk (correct duration):
$ ffprobe video.mp4
...
Duration: 00:00:13.05, start: 0.000000, bitrate: 736 kb/s
...
Streaming in the file (incorrect duration):
$ cat video.mp4 | ffprobe -i -
...
Duration: 00:00:08.40, start: 0.080000, bitrate: N/A
...
How can I get ffprobe to report the correct duration whilst also streaming in the file via stdin?