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

查看:715
本文介绍了使用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中,视频时标,时基或时间戳是什么?

    The setpts filter expression generates smooth timestamps for a video at FRAME_RATE FPS. See an explanation for timestamps at What is video timescale, timebase, or timestamp in ffmpeg?

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

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