使用 ffmpeg 减慢 MKV 文件播放速度后,如何修复 VLC 播放问题

使用 ffmpeg 减慢 MKV 文件播放速度后,如何修复 VLC 播放问题

我从 DVD 中截取了一些附加内容,这些内容基本上是图库,然后将其转换为 MKV。它们的播放速度太快了,所以我使用 ffmpeg 减慢了速度,如下所示:

 ffmpeg -i input.mkv -filter:v "setpts=64*PTS" output.mkv 

生成的视频在 5KPlayer 中播放效果很好但很慢,但在 VLC 中只显示几帧,似乎冻结了,然后文件关闭。

我在一篇较旧的问题有人警告说这种情况会发生:

虽然播放速度似乎因此而改变,但视频时长似乎显示不正确;例如,3 分钟的视频加速 3 倍后仍会显示为 3 分钟。如果您在视频播放器(例如 VLC)中播放,视频将只占用第一分钟,然后在剩余的 2 分钟内冻结在一帧上。– jrh 2018 年 11 月 19 日 21:55

那么,我该如何修复播放问题,以便视频可以在任何播放器(包括 VLC)中正确播放?

ffmpeg的完整日志:

ffmpeg -i ~/Movies/Mac\ Video\ Library/JURASSIC_PARK_III_T51.mkv -an -filter:v "setpts=64*(PTS-STARTPTS)" ~/Movies/Mac\ Video\ Library/JURASSIC_PARK_III_T51-1.mkv
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from '/Users/sphillips/Movies/Mac Video Library/JURASSIC_PARK_III_T51.mkv':
  Metadata:
    CREATION_TIME   : 2021-10-27T00:54:46Z
    ENCODER         : Lavf57.7.2
  Duration: 00:00:01.47, start: 0.000000, bitrate: 2205 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 180k tbc (default)
  Stream #0:1(eng): Subtitle: dvd_subtitle, 720x480
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7fbe32040200] using SAR=8/9
[libx264 @ 0x7fbe32040200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fbe32040200] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x7fbe32040200] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to '/Users/sphillips/Movies/Mac Video Library/JURASSIC_PARK_III_T51-1.mkv':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x480 [SAR 8:9 DAR 4:3], q=2-31, 29.97 fps, 1k tbn (default)
    Metadata:
      encoder         : Lavc58.134.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    1 fps=0.0 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   frame=   44 fps=0.0 q=-1.0 Lsize=     788kB time=00:01:27.55 bitrate=  73.7kbits/s speed= 368x    
video:787kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.152554%
[libx264 @ 0x7fbe32040200] frame I:1     Avg QP:12.94  size: 60994
[libx264 @ 0x7fbe32040200] frame P:32    Avg QP:12.48  size: 18069
[libx264 @ 0x7fbe32040200] frame B:11    Avg QP:16.84  size: 15067
[libx264 @ 0x7fbe32040200] consecutive B-frames: 56.8% 27.3%  6.8%  9.1%
[libx264 @ 0x7fbe32040200] mb I  I16..4:  1.9% 71.0% 27.1%
[libx264 @ 0x7fbe32040200] mb P  I16..4:  6.8% 16.5% 11.8%  P16..4: 15.7%  1.9%  2.1%  0.0%  0.0%    skip:45.2%
[libx264 @ 0x7fbe32040200] mb B  I16..4:  7.2%  9.1% 10.7%  B16..8:  6.0%  2.4%  1.1%  direct: 1.3%  skip:62.2%  L0:61.5% L1:33.4% BI: 5.0%
[libx264 @ 0x7fbe32040200] 8x8 transform intra:46.0% inter:42.9%
[libx264 @ 0x7fbe32040200] coded y,uvDC,uvAC intra: 72.2% 75.2% 58.3% inter: 12.6% 11.0% 6.6%
[libx264 @ 0x7fbe32040200] i16 v,h,dc,p: 71% 23%  2%  4%
[libx264 @ 0x7fbe32040200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 20% 13%  7%  8%  8%  8%  9% 11%
[libx264 @ 0x7fbe32040200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 24% 10%  6%  7%  6%  7%  6%  6%
[libx264 @ 0x7fbe32040200] i8c dc,h,v,p: 45% 25% 20%  9%
[libx264 @ 0x7fbe32040200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fbe32040200] ref P L0: 61.8%  2.5% 25.0% 10.8%
[libx264 @ 0x7fbe32040200] ref B L0: 57.2% 37.9%  4.9%
[libx264 @ 0x7fbe32040200] ref B L1: 94.8%  5.2%
[libx264 @ 0x7fbe32040200] kb/s:68.51

相关内容