0
votes

I have a camera stream which gives a video at 10 fps, resolution with 800x600 with h264 encoding. I like to split the video into 10 min clips and save it with the system time as its name.
I use the following code to do so.

ffmpeg -i $URL -c copy -map 0 -f segment -strftime 1 -segment_atclocktime 1 -reset_timestamps 1 -segment_time 600 -segment_format mp4 %Y%m%d_%H%M%S.mp4

But when I'm running the code, it is giving me the following warning.

[segment @ 0x55968f393e80] 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

[segment @ 0x55968f393e80] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.

And the videos its saving are not exactly 10 minutes in length.

How I can fix those warnings and save the videos with length equals exactly 10 minutes.

Thank You!!

1
This question appears to be off-topic because it is not within the bounds of discussion as described in the help center.user1228
@Will I have seen similar type of questions in stackoverflow before. May be you try to close them first..Ramesh-X
I'm back from combing through the 6m+ questions here, having cast approximately 874k close votes. This is still off topic.user1228
@Will Yeah.. I just read the information of the topic FFMPEG and realized this question is off the topic. Sorry for being rude :)Ramesh-X
NP, and cheers.user1228

1 Answers

-1
votes

Ignore the timestamp warnings. H264 streams don't have timestamps so ffmpeg will have to generate them.

Due to keyframe placement, you can't get exact segment length without re-encoding.