我想对 2 小时视频文件中的 1 分钟部分进行编码。我使用-ss
来定位到我想要的点,使用 来-t
指定时长,两者都用作输入选项。然后我用 播放输出mpv
,它报告视频时长仍为 2 小时,尽管它在成功播放编码序列后 1 分钟后确实终止。ffprobe
仍然报告视频长度为 1 分钟。我是否需要担心这种行为?
ffmpeg
编码命令:
ffmpeg -ss $(bc -l <<< 1768*1001/24000) -t $(bc -l <<< (1798-1768)*1001/24000) -i input.mkv -c:v libx265 -crf 21 -an -preset slower -x265-params "bframes=6:pools=4" 0.mkv
MPV截图:
ffprobe
输出:
ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, matroska,webm, from '0.mkv':
Metadata:
ENCODER : Lavf58.29.100
Duration: 01:37:09.02, start: 0.000000, bitrate: 66 kb/s
Chapter #0:0: start 0.000000, end 0.792000
Metadata:
title : 00:00:00.000
Chapter #0:1: start 0.792000, end 30.572000
Metadata:
title : 00:00:00.792
Chapter #0:2: start 30.572000, end 332.207000
Metadata:
title : 00:00:30.572
Chapter #0:3: start 332.207000, end 548.423000
Metadata:
title : 00:05:32.207
Chapter #0:4: start 548.423000, end 842.675000
Metadata:
title : 00:09:08.423
Chapter #0:5: start 842.675000, end 1142.850000
Metadata:
title : 00:14:02.675
Chapter #0:6: start 1142.850000, end 1416.832000
Metadata:
title : 00:19:02.850
Chapter #0:7: start 1416.832000, end 1655.112000
Metadata:
title : 00:23:36.832
Chapter #0:8: start 1655.112000, end 1788.745000
Metadata:
title : 00:27:35.112
Chapter #0:9: start 1788.745000, end 1968.758000
Metadata:
title : 00:29:48.745
Chapter #0:10: start 1968.758000, end 2238.695000
Metadata:
title : 00:32:48.758
Chapter #0:11: start 2238.695000, end 2966.005000
Metadata:
title : 00:37:18.695
Chapter #0:12: start 2966.005000, end 3386.425000
Metadata:
title : 00:49:26.005
Chapter #0:13: start 3386.425000, end 3967.213000
Metadata:
title : 00:56:26.425
Chapter #0:14: start 3967.213000, end 4405.985000
Metadata:
title : 01:06:07.213
Chapter #0:15: start 4405.985000, end 4863.025000
Metadata:
title : 01:13:25.985
Chapter #0:16: start 4863.025000, end 5359.354000
Metadata:
title : 01:21:03.025
Chapter #0:17: start 5359.354000, end 6086.560000
Metadata:
title : 01:29:19.354
Stream #0:0(eng): Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
ENCODER : Lavc58.54.100 libx265
DURATION : 00:01:13.741000000
Stream #0:1(rus): Subtitle: ass
Metadata:
title : Licence West Video
ENCODER : Lavc58.54.100 ssa
DURATION : 01:37:09.020000000
编辑:更新转换日志。原始-report
日志是一个庞大的 78 MB 文本文件。我删除了中间的重复行,这是结果。