使用 FFmpeg 时删除顺序重复的帧 [英] Remove sequentially duplicate frames when using FFmpeg

查看:70
本文介绍了使用 FFmpeg 时删除顺序重复的帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 ffmpeg 检测视频中的重复帧?

Is there any way to detect duplicate frames within the video using ffmpeg?

我尝试使用 -vf 标志和 select=gt(scene,0.xxx) 进行场景更改.但是,它不适用于我的情况.

I tried -vf flag with select=gt(scene,0.xxx) for scene change. But, it did not work for my case.

推荐答案

使用 mpdecimate 过滤器,其目的是丢弃与前一帧差别不大的帧以降低帧速率."

Use the mpdecimate filter, whose purpose is to "Drop frames that do not differ greatly from the previous frame in order to reduce frame rate."

  • 这将生成一个控制台读数,显示过滤器认为哪些帧是重复的.

  • This will generate a console readout showing which frames the filter thinks are duplicates.

ffmpeg -i input.mp4 -vf mpdecimate -loglevel debug -f null -

  • 生成删除重复的视频

  • To generate a video with the duplicates removed

    ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4
    

  • setpts 过滤器表达式为 FRAME_RATE<的视频生成平滑的时间戳/代码> FPS.在 什么是 ffmpeg 中的视频时间刻度、时基或时间戳?

    这篇关于使用 FFmpeg 时删除顺序重复的帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆