作者:举报处冫__理大厅_283 | 来源:互联网 | 2023-09-18 09:01
我正在尝试通过以下命令使用FFmpeg连接两个m4a(aac)文件:
ffmpeg -f concat -i input.txt -codec copy output.m4a
在macOS上使用afinfo的第一个文件帧数:
File type ID: m4af
Data format: 1 ch,44100 Hz,'aac ' (0x00000000) 0 bits/channel,0 bytes/packet,1024 frames/packet,0 bytes/frame
no channel layout.
estimated duration: 8.473832 sec
audio bytes: 68931
audio packets: 367
bit rate: 64710 bits per second
packet size upper bound: 391
maximum packet size: 391
audio data file offset: 44
not optimized
audio 373696 valid frames + 2112 priming + 0 remainder = 375808
format list:
[ 0] format: 1 ch,0 bytes/frame
Channel layout: Mono
第二个文件元数据:
File type ID: m4af
Num Tracks: 1
Data format: 1 ch,0 bytes/frame
no channel layout.
estimated duration: 5.594558 sec
audio bytes: 46077
audio packets: 243
bit rate: 65329 bits per second
packet size upper bound: 340
maximum packet size: 340
audio data file offset: 44
not optimized
audio 246720 valid frames + 2112 priming + 0 remainder = 248832
format list:
[ 0] format: 1 ch,0 bytes/frame
Channel layout: Mono
生成的音频文件元数据:
File type ID: m4af
Num Tracks: 1
Data format: 1 ch,0 bytes/frame
no channel layout.
estimated duration: 14.070998 sec
audio bytes: 122792
audio packets: 607
bit rate: 69696 bits per second
packet size upper bound: 293
maximum packet size: 293
audio data file offset: 40
not optimized
audio 620531 valid frames + 1024 priming + 13 remainder = 621568
format list:
[ 0] format: 1 ch,0 bytes/frame
Channel layout: Mono
问题在于帧总数应为367 + 293 = 610,结果帧数为607。持续时间为14.070998秒,而不是14.06839秒
我在这里做错什么的任何想法吗?我需要精确地串联两个文件,而不会在输入帧中造成任何损失。