gpt4 book ai didi

ffmpeg:-copyts 使 -t 停止在时间戳,而不是持续时间

转载 作者:行者123 更新时间:2023-12-04 22:55:43 24 4
gpt4 key购买 nike



-t duration (input/output)

When used as an input option (before -i), limit the duration of data read from the input file.

When used as an output option (before an output url), stop writing the output after its duration reaches duration.



所以这应该产生一个 1 分钟的文件,时间戳从 1:49 开始,对吧?
ffmpeg -y -copyts -ss 1:49 -i ~/Videos/input.mkv -c copy -t 1:00 timing-1m49s.mkv 
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-netcdf --enable-vaapi --enable-vdpau --enable-libfdk_aac --enable-nonfree --enable-libmp3lame --enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
Input #0, matroska,webm, from '/home/ariel/Videos/input.mkv':
Metadata:
encoder : libebml v0.7.7 + libmatroska v0.8.0
creation_time : 2006-07-20T03:07:03.000000Z
Duration: 00:23:57.06, start: 0.000000, bitrate: 1983 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x480, SAR 37:30 DAR 37:20, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
Stream #0:2(jpn): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3(eng): Subtitle: dvd_subtitle, 720x480 (default)
Metadata:
title : English Audio
Stream #0:4(eng): Subtitle: dvd_subtitle, 720x480
Metadata:
title : Japanese Audio
Output #0, matroska, to 'timing-1m49s.mkv':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 720x480 [SAR 37:30 DAR 37:20], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

错误的。它输出一个没有帧的文件:
-rwxrwx--- 1 root users 805 Jul 30 01:36 timing-1m49s.mkv

我必须指定 -t 1:49或更多,例如 -t 1:55生成一个从 0:00 开始的 6 秒文件,根据元数据应该持续 1:55。

我到了这一点,试图在同一命令中提取剪辑并添加字幕,但这种最小的情况在我看来与文档相反。

最佳答案

是的,-t用作输出选项查看通常从零开始的时间戳。除了 -copyts 时这样的情况。用来。使用-t作为输入选项:

ffmpeg -y -copyts -ss 1:49 -t 1:00 -i ~/Videos/input.mkv -c copy timing-1m49s.mkv 

关于ffmpeg:-copyts 使 -t 停止在时间戳,而不是持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45396813/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com