我正在尝试使用 mp4box 将两个 m4v 视频文件合并为一个,但失败了 :(
以下是 mp4box -info 对第一个文件的报告
* Movie Info *
Timescale 90000 - Duration 01:06:18.836
Fragmented File no - 2 track(s)
File Brand mp42 - version 0
Created: GMT Thu Jun 24 13:13:14 2010
File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: ISO Reserved Profile (0x7f)
Audio PL: High Quality Audio Profile @ Level 2 (0x0f)
No streams included in root OD
iTunes Info:
Encoder Software: HandBrake 0.9.4 2009112300
Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 01:06:18.836
Media Info: Language "Undetermined" - Type "vide:avc1" - 132682 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 480 x 270 - Profile Baseline @ Level 2.1
NAL Unit length bits: 32
Self-synchronized
Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 01:06:18.709
Media Info: Language "Undetermined" - Type "soun:mp4a" - 186502 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 48000
Synchronized on stream 1
这是第二个文件
* Movie Info *
Timescale 90000 - Duration 01:34:12.652
Fragmented File no - 2 track(s)
File Brand mp42 - version 0
Created: GMT Thu Jun 24 13:35:44 2010
File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: ISO Reserved Profile (0x7f)
Audio PL: High Quality Audio Profile @ Level 2 (0x0f)
No streams included in root OD
iTunes Info:
Encoder Software: HandBrake 0.9.4 2009112300
Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 01:34:12.652
Media Info: Language "Undetermined" - Type "vide:avc1" - 156175 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 480 x 270 - Profile Baseline @ Level 2.1
NAL Unit length bits: 32
Self-synchronized
Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 01:34:12.458
Media Info: Language "Undetermined" - Type "soun:mp4a" - 264959 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 48000
Synchronized on stream 1
我尝试过简单地用 add 来加入它们
mp4box -add file1.m4v -add file2.m4v output.m4v
我还提取了每个流,然后使用 -add 将它们合并在一起。我从来没有得到匹配的视频和音频(我不是说几毫秒的差距,我是说没有音频,或者视频 1 与音频 2 一起播放!)
有什么指示告诉我我哪里做错了吗?
更新:我使用 avidemux 取得了更多成功 - 它给了我一个包含所有视频和音频的视频,但音频逐渐不同步。
这可能与 h.264 视频的可变帧速率有关吗?avidemux 似乎为整个连接视频提供了平均帧速率。
相关问题:如何合并 MP4 文件且音频不同步?
答案1
最后我通过在编码之前合并源材料解决了这个问题。我的源文件是 .flv 文件,我将它们合并在一起绑定