gpt4 book ai didi

ffmpeg 连接导致第二个输入文件的输出错误/乱码

转载 作者:行者123 更新时间:2023-12-04 23:27:00 49 4
gpt4 key购买 nike

我正在尝试使用 ffmpeg concat demuxer 将两个视频连接在一起:一个 5 秒的介绍启动画面和一个 60 秒的主要/正文视频。我知道两个文件的编码必须相同才能正常工作。我认为它们是,但结果输出显示介绍很好,然后是完全乱码的正文。我错过了什么?

ffmpeg -f concat -i concat.txt -c copy output.mp4
concat.txt的内容:
file 'intro.mp4'
file 'body.mp4'

ffprobe 的输出对于两个输入文件:

介绍.mp4
ffprobe version 3.2.4 Copyright (c) 2007-2017 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'intro.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:00:05.04, start: 0.000000, bitrate: 73 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720 [SAR 1:1 DAR 4:3], 69 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler

正文.mp​​4
ffprobe version 3.2.4 Copyright (c) 2007-2017 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'body.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:00:36.84, start: 0.000000, bitrate: 5615 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720 [SAR 1:1 DAR 4:3], 5613 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler

ffmpeg 的输出:
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fdda3018000] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'concat.txt':
Duration: N/A, start: 0.000000, bitrate: 69 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x720 [SAR 1:1 DAR 4:3], 69 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Metadata:
handler_name : VideoHandler
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf57.56.101
Stream #0:0(eng): Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p, 960x720 [SAR 1:1 DAR 4:3], q=2-31, 69 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fdda3800000] Auto-inserting h264_mp4toannexb bitstream filter
frame= 1047 fps=973 q=-1.0 Lsize= 25299kB time=00:00:41.76 bitrate=4962.8kbits/s speed=38.8x
video:25286kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.050621%

据我所知,除了比特率和语言之外,一切都是相同的。设置语言似乎没有什么区别。我已经尝试将介绍转码为更高的介绍比特率,但无法让它留在输出中。我可以对其中一个文件(最好是介绍)进行转码,但不知道还要尝试更改什么。想法?

最佳答案

感谢@Mulvya 的建议,我使用了mediainfo检查文件并注意到两者已使用不同的 crf 进行编码设置。使用相同的 crf 重新编码简介产生了一个有效的连接文件。

关于ffmpeg 连接导致第二个输入文件的输出错误/乱码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42513727/

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