微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在ffmpeg中剪切视频的一部分会创建损坏的输出文件

如何解决在ffmpeg中剪切视频的一部分会创建损坏的输出文件

我目前对ffmpeg有问题。我正在尝试剪切视频的一部分(例如,从00:10:00到00:10:30)。

我使用此命令ffmpeg -ss 600 -to 630 -i not_working.mp4 not_working_part.mp4

我尝试对视频进行重新编码,但是它仍然损坏(仅前几帧有效,视频长达数小时,但是如果您尝试跳过,则会跳到结尾)。

我在-ss参数之前使用-to-i参数,因为我想切出例如就在视频结尾处将-i参数移到其他参数的前面可以解决此问题,但对于视频后期的剪切效果确实很差。对于我的其他许多视频,两种方法都可以正常工作。

以下是有关ffmpeg视频的一些元数据:

Input #0,mov,mp4,m4a,3gp,3g2,mj2,from 'media\not_working.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2020-09-22T06:20:53.000000Z
  Duration: 03:03:40.04,start: 0.000000,bitrate: 537 kb/s
    Chapter #0:0: start 0.000000,end 204.120000
    Metadata:
      title           : Recording Started
    Chapter #0:1: start 204.120000,end 2045.200000
    Metadata:
      title           : Sharing Started
    Chapter #0:2: start 2045.200000,end 2056.880000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:3: start 2056.880000,end 4018.280000
    Metadata:
      title           : Sharing Started
    Chapter #0:4: start 4018.280000,end 4024.760000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:5: start 4024.760000,end 4096.000000
    Metadata:
      title           : Sharing Started
    Chapter #0:6: start 4096.000000,end 4101.800000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:7: start 4101.800000,end 4481.920000
    Metadata:
      title           : Sharing Started
    Chapter #0:8: start 4481.920000,end 4624.480000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:9: start 4624.480000,end 6902.000000
    Metadata:
      title           : Sharing Started
    Chapter #0:10: start 6902.000000,end 6906.760000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:11: start 6906.760000,end 6922.880000
    Metadata:
      title           : Sharing Started
    Chapter #0:12: start 6922.880000,end 6936.800000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:13: start 6936.800000,end 9140.840000
    Metadata:
      title           : Sharing Started
    Chapter #0:14: start 9140.840000,end 9145.680000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:15: start 9145.680000,end 9297.600000
    Metadata:
      title           : Sharing Started
    Chapter #0:16: start 9297.600000,end 9306.040000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:17: start 9306.040000,end 9572.480000
    Metadata:
      title           : Sharing Started
    Chapter #0:18: start 9572.480000,end 9620.680000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:19: start 9620.680000,end 10020.760000
    Metadata:
      title           : Sharing Started
    Chapter #0:20: start 10020.760000,end 10085.480000
    Metadata:
      title           : Sharing Stopped
    Chapter #0:21: start 10085.480000,end 10781.920000
    Metadata:
      title           : Sharing Started
    Chapter #0:22: start 10781.920000,end 11020.040000
    Metadata:
      title           : Sharing Stopped
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D),32000 Hz,mono,fltp,53 kb/s (default)
    Metadata:
      creation_time   : 2020-09-22T06:20:53.000000Z
      handler_name    : AAC audio
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661),yuv420p,1920x1080,481 kb/s,25 fps,25 tbr,30k tbn,60k tbc (default)
    Metadata:
      creation_time   : 2020-09-22T06:20:53.000000Z
      handler_name    : H.264/AVC video
      encoder         : AVC Coding
    Stream #0:2(und): Data: bin_data (text / 0x74786574)
    Metadata:
      creation_time   : 2020-09-22T06:20:53.000000Z
      handler_name    : Text

这是ffmpeg(在pastebin上)指向-report日志文件链接https://pastebin.com/i9ix3GsC

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。