I’m writing the output of NVENC to a raw file on disc. So that regular apps can play it I’m embedding it in a mp4 container with ffmpeg:
ffmpeg -i “output.h264” -c:v copy -f mp4 “output.mp4” -y
Now when I play the mp4 file with the built in video player in Windows, it plays back at the wrong speed (too fast).
I’ve tried setting NV_ENC_PIC_PARAMS::inputTimeStamp but nothing I’ve tried seems to affect playback speed. I’m not sure what kind of value is expected. I’ve tried the QuadPart of the struct returned by QueryPerformanceTimer, and also the current frame counter.
What am I missing?
During the ffmpeg conversion, it reports:
[mp4 @ 000002722202e7c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
Maybe this is a clue?