【问题标题】:How to get the frame numbers that are dropped when changing the frame rate using ffmpeg如何获取使用 ffmpeg 更改帧速率时丢弃的帧数
【发布时间】:2021-03-10 02:26:27
【问题描述】:

我有一个以 30fps 的速度播放的视频。我使用命令将帧速率更改为 20fps ffmpeg -i lamp02_20210212_060804-compressed.mp4 -filter:v fps=20 xx.mp4。但我想获得丢帧的帧数。我在这里看到Which frame does ffmpeg get when reducing the frame rate 可以得到框架,但我只需要框架号。是否有可能做到这一点,如果可以,怎么做?任何指向正确方向的指针都会有所帮助!

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    您可以转储调试日志并检查它们。

    ffmpeg -i input -vf fps=20 -an -f null - -v debug 2>&1 | grep Parsed_fps
    

    输出将有表格的行,

    [Parsed_fps_0 @ 000002619a56bd40] Read frame with in pts 11264, out pts 15
    [Parsed_fps_0 @ 000002619a56bd40] Writing frame with pts 14 to pts 14
    [Parsed_fps_0 @ 000002619a56bd40] Read frame with in pts 11776, out pts 15
    [Parsed_fps_0 @ 000002619a56bd40] Dropping frame with pts 15
    [Parsed_fps_0 @ 000002619a56bd40] Read frame with in pts 12288, out pts 16
    [Parsed_fps_0 @ 000002619a56bd40] Writing frame with pts 15 to pts 15
    

    所有的点都以timebase 命名。 in pts 的时基是输入流的 tbn 值的倒数。 out pts 的时基是滤波器输出 fps 的倒数。

    跟踪显示Dropping frame with pts .. 的帧的in pts 并获取它们的时间戳值。

    【讨论】:

      猜你喜欢
      • 2020-05-27
      • 2013-08-19
      • 2017-10-28
      • 2018-03-16
      • 2018-01-09
      • 1970-01-01
      • 2018-03-25
      • 2011-01-02
      • 2021-02-09
      相关资源
      最近更新 更多