
我有一個這樣的過程:
我有N個輸入影片;我使用以下程式碼對它們進行剪切和轉碼:
ffmpeg.exe -c:v h264_cuvid -resize 1920x1080 -noaccurate_seek -ss 00:00:04.000 -to 00:00:44.240 -i "input_N.MP4" -v error -filter: fps> h264_nvenc -預設中等-輪廓高-b:v 8000k -bufsize 8000k -maxrate 10000k -qmin 0 -g 250 -bf 2 -i_qfactor 0.75 -b_qfactor 1.1“output_N.4”
我按以下格式建立 videoArrayFile.txt:
文件“myFilePath\output_N.mp4” 文件“myFilePath\output_N.mp4” 文件“myFilePath\output_N.mp4” ...
我使用以下命令連接 videoArrayFile.txt 中的檔案:
ffmpeg.exe -f concat -v error -safe 0 -i "myPath\videoArrayFile.txt" -filter:a "volume=1" -c:v copy -c:a aac "myPath\outputConcat.mp4"
這是我執行上述命令時的 ffmpeg 日誌:
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
該過程正在運行,但是使用一些輸入文件,我面臨著一些FPS 和音頻音調問題: 輸出檔案是可變幀速率且音訊速度錯誤。
“output_N”上的 Ffprobe 產生以下結果:
file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\introEncoded.mp4'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'introEncoded.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.100 Duration: 00:00:04.60, start: 0.000000, bitrate: 2707 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2575 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : Core Media Video
Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 131 kb/s (default)
Metadata:
handler_name : Core Media Audio
file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_0.mp4'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_0.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.100 Duration: 00:00:40.27, start: 0.000000, bitrate: 8142 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 8221 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : GoPro AVC
timecode : 12:52:03:24
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
Metadata:
handler_name : GoPro AAC
Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : GoPro AVC
timecode : 12:52:03:24 Unsupported codec with id 0 for input stream 2
file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_1.mp4'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_1.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.100 Duration: 00:00:05.03, start: 0.000000, bitrate: 8460 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 10239 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : GoPro AVC
timecode : 13:22:01:01
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
Metadata:
handler_name : GoPro AAC
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
handler_name : GoPro AVC
timecode : 13:22:01:01 Unsupported codec with id 0 for input stream 2
file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_2.mp4'
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_2.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.100 Duration: 00:00:08.03, start: 0.000000, bitrate: 8926 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 9303 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : GoPro AVC
timecode : 13:22:01:01
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
Metadata:
handler_name : GoPro AAC
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
handler_name : GoPro AVC
timecode : 13:22:01:01 Unsupported codec with id 0 for input stream 2
當 ffprobe 對 outputConcat.mp4 產生
outputConcat.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outputConcat.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.42.100
Duration: 00:00:57.54, start: 0.000000, bitrate: 7900 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 7820 kb/s, 24.28 fps, 25 tbr, 15360 tbn, 50 tbc (default)
Metadata:
handler_name : Core Media Video
Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 111 kb/s (default)
Metadata:
handler_name : Core Media Audio
outputConcat.mp4 中的時基與其他時基發生了變化:這種行為是否與音訊串流的不同取樣率有關(我在輸入檔案中可以注意到的唯一區別)?
從第 1 點可以看出,輸入 FPS 設定為 25,並且所有輸入影片都具有完全相同的編解碼器和解析度。
如何連接視訊以使輸出具有與輸入相同的 FPS 並且沒有音訊音調問題?會不會是時基的問題?
謝謝,馬可
答案1
我找到了問題的部分解決方案:問題是輸入的音訊取樣率不一致,並且我在第一次轉換期間沒有管理這個問題。添加-ar 32000
到所有初始轉換字串中我解決了音頻音調問題。我仍然試圖理解為什麼 fps 會改變