使用此命令创建两个文件:
ffmpeg -y -i input.webm -c:v copy -c:a libmp3lame -b:a 128k -strict -2 -f mp4 rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp4 -vn -acodec libmp3lame -b:a 128k -f mp3 rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp3
- rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp4
- rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp3
MP3 文件与说话者标签一起发送给第三方,然后用于生成与 MP4 文件一起在 UI 中呈现的成绩单。
观察:
转录文本和 mp4 之间存在同步延迟,从视频开始时的 0 秒延迟开始增加,并随着时间的推移逐渐增加(视频变慢)
mp4 的时长比 mp3 的时长要长
即使确保 mp4 音频和 mp3 音频的比特率相同,仍会出现同步问题
mp4 的音频和 mp3 文件之间没有延迟
成绩单和 mp3 文件之间没有同步问题。
仅当将 mp4 与成绩单进行比较时才会出现问题。
mediainfo rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp4
General
Complete name : rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 148 MiB
Duration : 23 min 57 s
Overall bit rate : 864 kb/s
Frame rate : 17.677 FPS
Writing application : Lavf59.27.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Constrained [email protected]
Format settings : 1 Ref Frames
Format settings, CABAC : No
Format settings, Reference frames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 23 min 57 s
Source duration : 23 min 55 s
Bit rate : 734 kb/s
Width : 1 280 pixels
Height : 960 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 17.677 FPS
Minimum frame rate : 1.176 FPS
Maximum frame rate : 62.500 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.034
Stream size : 126 MiB (85%)
Source stream size : 126 MiB (85%)
Language : English
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
Audio
ID : 2
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Format settings : Joint stereo / MS Stereo
Codec ID : mp4a-6B
Duration : 23 min 57 s
Source duration : 23 min 57 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Compression mode : Lossy
Stream size : 21.8 MiB (15%)
Source stream size : 21.8 MiB (15%)
Writing library : LAME3.100
Language : English
Default : Yes
Alternate group : 1
mediainfo rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp3
General
Complete name : rec_50ae1a2a3da64cf1a5f46c53de757d6e-1692704540213.mp3
Format : MPEG Audio
File size : 22.3 MiB
Duration : 24 min 20 s
Overall bit rate mode : Constant
Overall bit rate : 128 kb/s
Writing library : LAME3.100
Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Format settings : Joint stereo / MS Stereo
Duration : 24 min 20 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 41.667 FPS (1152 SPF)
Compression mode : Lossy
Stream size : 22.3 MiB (100%)
Writing library : LAME3.100
我该如何解决 ?