这个问题已经在这里有了答案:
- 文件剪切时视频文件开头的黑框 2回答
因此,在将mkv文件转换为mp4之后,音频会在正确的时间播放,但视频会提前结束。这意味着视频的起始位已被截断,因此视频在下一帧开始播放,并在结束时,视频仅停留在同一帧上,导致音频/视频不同步问题...我该如何解决这个?这是我的命令:
ffmpeg -i "input.mkv" -codec copy -ss 00:15:20 -t 00:00:17 "output.mp4"
并输出:
ffmpeg version N-88804-g3af2bf0af0 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 56. 0.100 / 56. 0.100
libavcodec 58. 2.100 / 58. 2.100
libavformat 58. 2.100 / 58. 2.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 0.101 / 7. 0.101
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, matroska,webm, from 'input.mkv':
Metadata:
CREATION_TIME : 2018-05-02T15:19:05Z
ENCODER : Lavf57.7.2
Duration: 01:33:57.65, start: 0.000000, bitrate: 13042 kb/s
Chapter #0:0: start 0.000000, end 58.458000
Metadata:
title : Chapter 1
Chapter #0:1: start 58.458000, end 245.312000
Metadata:
title : Chapter 2
Chapter #0:2: start 245.312000, end 527.160000
Metadata:
title : Chapter 3
Chapter #0:3: start 527.160000, end 819.786000
Metadata:
title : Chapter 4
Chapter #0:4: start 819.786000, end 1772.704000
Metadata:
title : Chapter 5
Chapter #0:5: start 1772.704000, end 2106.037000
Metadata:
title : Chapter 6
Chapter #0:6: start 2106.037000, end 2181.212000
Metadata:
title : Chapter 7
Chapter #0:7: start 2181.212000, end 2440.939000
Metadata:
title : Chapter 8
Chapter #0:8: start 2440.939000, end 2725.089000
Metadata:
title : Chapter 9
Chapter #0:9: start 2725.089000, end 3018.282000
Metadata:
title : Chapter 10
Chapter #0:10: start 3018.282000, end 3352.182000
Metadata:
title : Chapter 11
Chapter #0:11: start 3352.182000, end 3964.427000
Metadata:
title : Chapter 12
Chapter #0:12: start 3964.427000, end 4318.181000
Metadata:
title : Chapter 13
Chapter #0:13: start 4318.181000, end 4644.140000
Metadata:
title : Chapter 14
Chapter #0:14: start 4644.140000, end 5062.057000
Metadata:
title : Chapter 15
Chapter #0:15: start 5062.057000, end 5361.089000
Metadata:
title : Chapter 16
Chapter #0:16: start 5361.089000, end 5636.631000
Metadata:
title : Chapter 17
Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 180k tbc (default)
Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Stereo
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf58.2.100
Chapter #0:0: start 0.000000, end 17.000000
Metadata:
title : Chapter 5
Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 16k tbn, 1k tbc (default)
Stream #0:1(jpn): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (default)
Metadata:
title : Stereo
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 395 fps= 24 q=-1.0 Lsize= 30997kB time=00:00:16.99 bitrate=14938.1kbits/s speed=1.02x
video:30645kB audio:333kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.061779%
音频和视频实际上是不同步的,还是只是在不同的时间开始和结束?您正在使用哪个播放器来播放视频?
—
slhck
@slhck现在您提到了它,我尝试在VLC中播放视频,视频的开始只是一个黑屏,但之后它开始与音频同步播放...就像开始部分被切断一样...
—
user902222 '18