It generates a malformed video file which I can transform into a well-formed one with ffmpeg tool:
ffmpeg -i input.mp4 -vcodec copy test.mp4
The tool prints the following warnings:
[mp4 @ 00000208ce831240] 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
[mp4 @ 00000208ce831240] pts has no value
I really want to get a well-formed file in one pass using only c++ code.
I work on Windows 10 and use FFMPEG C headers and .lib files from here: