You can use the “setpts” filter to reset the timestamps of the input file to 0. The setpts filter takes an expression as an argument, and the expression can be used to modify the timestamps of the frames. To set the timestamps to 0, you can use the expression “PTS-STARTPTS”.

The following command will reset the timestamps of the input file “input.mp4” to 0 and write the output to “output.mp4”:

ffmpeg -i input.mp4 -vf "setpts=PTS-STARTPTS" -c:a copy output.mp4

This command will copy the audio stream and reset the video stream to start at timestamp 0.

Alternatively, you can use the expression “PTS-STARTPTS+0” which will add 0 to the timestamps, effectively resetting the timestamps to 0.

ffmpeg -i input.mp4 -vf "setpts=PTS-STARTPTS+0" -c:a copy output.mp4

It’s worth noting that this will not change the duration of the video, only the time-stamp of the first frame.

 

Thanks for reading

Leave a Reply

Your email address will not be published. Required fields are marked *