我試圖從 MP4 影片中獲取長度為 6 秒的剪輯(大小:1.44 GB,長度:02:23:38)。但視訊串流在 1 秒後停止,而音訊串流繼續正常播放直到 6 秒。
我正在使用這個命令來進行剪輯:
ffmpeg -i myvid.mp4 -ss 00:50:40.0 -c:v copy -c:a copy -t 00:00:06.0 -async 1 clip.mp4
有人可以幫我解決這個問題嗎?
謝謝
更新1: 這是命令的輸出:
ffmpeg version N-69530-g52f2adc-Sherpya Copyright (c) 2000-2015 the FFmpeg devel
opers
built with gcc 4.9.2 (GCC)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'myvid.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2013-02-22 12:22:10
Duration: 02:23:38.07, start: 0.000000, bitrate: 1437 kb/s
Chapter #0:0: start 0.000000, end 354.125000
Metadata:
title : 00:00:00.000
Chapter #0:1: start 354.125000, end 2339.125000
Metadata:
title : 00:05:54.125
Chapter #0:2: start 2339.125000, end 2573.125000
Metadata:
title : 00:38:59.125
Chapter #0:3: start 2573.125000, end 3504.750000
Metadata:
title : 00:42:53.125
Chapter #0:4: start 3504.750000, end 3854.458000
Metadata:
title : 00:58:24.750
Chapter #0:5: start 3854.458000, end 4364.125000
Metadata:
title : 01:04:14.458
Chapter #0:6: start 4364.125000, end 5029.125000
Metadata:
title : 01:12:44.125
Chapter #0:7: start 5029.125000, end 5526.750000
Metadata:
title : 01:23:49.125
Chapter #0:8: start 5526.750000, end 5796.958000
Metadata:
title : 01:32:06.750
Chapter #0:9: start 5796.958000, end 6084.416000
Metadata:
title : 01:36:36.958
Chapter #0:10: start 6084.416000, end 8316.416000
Metadata:
title : 01:41:24.416
Chapter #0:11: start 8316.416000, end 8618.068333
Metadata:
title : 02:18:36.416
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x544
[SAR 1:1 DAR 40:17], 1242 kb/s, 24 fps, 24 tbr, 96 tbn, 48 tbc (default)
Metadata:
creation_time : 2013-02-22 12:22:10
handler_name : Jab We Met (2009) BRRip 1080P DTS ESub Chapters [DDR]
Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fl
tp, 192 kb/s (default)
Metadata:
creation_time : 2013-02-22 12:22:23
handler_name : på.
Output #0, mp4, to 'clip.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
encoder : Lavf56.19.100
Chapter #0:0: start 0.000000, end 6.000000
Metadata:
title : 00:42:53.125
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x544 [S
AR 1:1 DAR 40:17], q=2-31, 1242 kb/s, 24 fps, 24 tbr, 12288 tbn, 96 tbc (default
)
Metadata:
creation_time : 2013-02-22 12:22:10
handler_name : Jab We Met (2009) BRRip 1080P DTS ESub Chapters [DDR]
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, 192 kb
/s (default)
Metadata:
creation_time : 2013-02-22 12:22:23
handler_name : på.
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 25 fps=6.4 q=-1.0 Lsize= 226kB time=00:00:06.01 bitrate= 307.1kbits
/s
video:82kB audio:141kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 1.334416%
答案1
當您的目標只是編碼流的一部分時,您不應該真正複製編碼流。您可以將-ss
&-t
選項放置在輸入檔案之前,但隨後剪切將在關鍵影格上完成,或者將它們放置在輸出檔案之前,就像您為精確剪切所做的那樣,但您必須對視訊進行轉碼,即是,刪除-c:v copy -c:a copy
從您的命令中。詳細的解釋可以在這個答案。