You are recording at 30fps, but a raw H264 elementary stream (what's in test.h264) has no timestamp information. MP4Box is assuming 25fps in the absence of any other information.
The fact that you recorded for 10seconds and got 295 frames gives you 29.5fps. (It takes a few 100ms to get going at the start).
There is a mode for raspivid where it will write out all the timestamps to a second file, and mkvmerge can use that when putting the H264 stream into the container.
Code: Select all
raspivid -w 1280 -h 1024 -fps 30 -t 10000 -o test.h264 -pts timestamps.txt
mkvmerge -o bb.mkv --timecodes 0:timestamps.txt test.h264
That does produce an mkv file instead of mp4, but almost all players support mkv as well.
Alternatively you can just add "-fps 30" to your MP4Box line and it'll assume the H264 ES is at 30fps.
(Location within the command may be important. It'll either be "MP4Box -fps 30 -add ...", or "MP4Box -add test.h264 -fps 30 ...")
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.