gpt4 book ai didi

ubuntu - 合并视频后时长过长 - ffmpeg

转载 作者:行者123 更新时间:2023-12-04 12:48:20 26 4
gpt4 key购买 nike

我有包含内容的文件txt

file intro.mp4
file video.mp4
file outtro.mp4

持续时间 10s178s13s

我使用 ffmpeg 通过以下命令将 3 个文件合并为一个:

ffmpeg -f concat -i "file.txt" -vcodec copy -acodec copy "endfile.mp4"

endfile.mp4 的持续时间更长11 分钟(660s)。

我有一个问题,哪些视频参数会影响合并? 以及 哪些常见参数会影响其他视频的合并?

我的英文真的太烂了。对不起:)
本周工作顺利!

P/S 文件详细信息:

介绍.mp4:

ffprobe version N-82885-g6d09d6e Copyright (c) 2007-2016 the FFmpeg developers<br>
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)<br>
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --<br>bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame<br> --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265<br>
libavutil 55. 43.100 / 55. 43.100<br>
libavcodec 57. 68.100 / 57. 68.100<br>
libavformat 57. 61.100 / 57. 61.100<br>
libavdevice 57. 2.100 / 57. 2.100<br>
libavfilter 6. 68.100 / 6. 68.100<br>
libswscale 4. 3.101 / 4. 3.101<br>
libswresample 2. 4.100 / 2. 4.100<br>
libpostproc 54. 2.100 / 54. 2.100<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/path/to/intro.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomiso2avc1mp41<br>
encoder : Lavf56.23.100<br>
Duration: 00:00:10.08, start: -0.013061, bitrate: 701 kb/s<br>
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)<br>
Metadata:<br>
handler_name : SoundHandler<br>
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 853 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)<br>
Metadata:<br>
handler_name : VideoHandler<br>

outtro.mp4:

ffprobe version N-82885-g6d09d6e Copyright (c) 2007-2016 the FFmpeg developers<br>
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)<br>
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --<br>bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame<br> --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265<br>
libavutil 55. 43.100 / 55. 43.100<br>
libavcodec 57. 68.100 / 57. 68.100<br>
libavformat 57. 61.100 / 57. 61.100<br>
libavdevice 57. 2.100 / 57. 2.100<br>
libavfilter 6. 68.100 / 6. 68.100<br>
libswscale 4. 3.101 / 4. 3.101<br>
libswresample 2. 4.100 / 2. 4.100<br>
libpostproc 54. 2.100 / 54. 2.100<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/path/to/outtro.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomiso2avc1mp41<br>
encoder : Lavf56.23.100<br>
Duration: 00:00:13.08, start: -0.013061, bitrate: 481 kb/s<br>
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)<br>
Metadata:<br>
handler_name : SoundHandler<br>
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 392 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)<br>
Metadata:<br>
handler_name : VideoHandler<br>

video.mp4

ffprobe version N-82885-g6d09d6e Copyright (c) 2007-2016 the FFmpeg developers<br>
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)<br>
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --<br>bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame<br> --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265<br>
libavutil 55. 43.100 / 55. 43.100<br><br>
libavcodec 57. 68.100 / 57. 68.100<br><br>
libavformat 57. 61.100 / 57. 61.100<br><br>
libavdevice 57. 2.100 / 57. 2.100<br><br>
libavfilter 6. 68.100 / 6. 68.100<br><br>
libswscale 4. 3.101 / 4. 3.101<br><br>
libswresample 2. 4.100 / 2. 4.100<br><br>
libpostproc 54. 2.100 / 54. 2.100<br><br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'path/to/video.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomiso2avc1mp41<br>
encoder : Lavf57.61.100<br>
Duration: 00:02:58.38, start: 0.000000, bitrate: 922 kb/s<br>
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 782 kb/s, 29.97 fps, 29.97 tbr, 30k <br>tbn, 59.94 tbc (default)<br>
Metadata:<br>
handler_name : VideoHandler<br>
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 130 kb/s (default)<br>
Metadata:<br>
handler_name : SoundHandler<br>

最佳答案

介绍/结尾和主要视频的分辨率、帧速率和时基不匹配。

像这样转换你的前奏/结尾,然后连接:

ffmpeg -i intro.mp4 -s hd720 -r 30000/1001 -video_track_timescale 30k -c:a copy newintro.mp4

关于ubuntu - 合并视频后时长过长 - ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42336195/

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