I have a ffmpeg command that allows me to drop duplicate frames and speed up the video and works well. I use it with hundreds of video recordings from a surveillance ip camera that does not have motion detection feature.

But, the files still have 1 frame per each second still because the video has a timestamp at the top, so I want to know if I could drop those still frames too somehow.

This is my current command:

ffmpeg -n -threads 2 -i input.mp4 -vf "mpdecimate,setpts=N/(25*TB)" -preset superfast -crf 30.0 -vcodec libx264 -movflags +faststart ouput.mp4

This is a sample screenshot showing the timestamp embedded on the video: enter image description here There is some way to achieve this ?

  • Can you show screenshots of these frames - the two with only the changing timestamp and one before and after those ones?
    – Gyan
    May 2, 2019 at 6:29
  • I've added a screenshot, with the command above the video run fast, about one minute each 3 seconds (since the source video is near realtime and the command catchs up 25fps so I could se the seconds running realy fast when the image is still but there is no "jumps" in seconds or minutes... I want to add those "jumps" on those many minutes when the image is still and there is no motion. Thanks.
    – Braian
    May 2, 2019 at 21:31
  • I tried to use dvr-scan too (written in python) but I saw that it reencode the video and I dont trust much on that, I prefer to leave to ffmpeg the re-encoding task. It would be great if dvr-scan could export the timestamp in a ready to use format or even if I could use an image as a mask to mark which regions to watch and which to ignore. But to much hassle.
    – Braian
    May 2, 2019 at 21:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.