我有一个包含多个音轨的.mp4文件。音频轨道使用ALAC编解码器进行编码。我想使用mp4box提取那些。
到目前为止,我为提取曲目所做的尝试是:
mp4box -single 1 "inputfile.mp4" -out "outputfile.m4a"
发生的事情是,它就像创建了
outputfile.m4a
一样起作用,但是带有 header /编解码器/文件信息的内容似乎格式错误。我可以在VLC中打开并播放该文件,但无法使用Windows Media Player / Windows Media Foundation(需要)打开该文件。因此,在提取过程中我做错了什么,或者mp4box将文件放入了奇怪的格式。mp4box -info -v "outputfile.mp4"
的输出如下所示:[iso file] Current top box start before parsing 0
[iso file] Read Box type ftyp size 20 start 0
[iso file] Current top box start before parsing 20
[iso file] Read Box type mdat size 8555577 start 20
[iso file] Current top box start before parsing 8555597
[iso file] Read Box type free size 75 start 8555597
[iso file] Current top box start before parsing 8555672
[iso file] Read Box type moov size 4895 start 8555672
[iso file] Read Box type mvhd size 108 start 8555680
[iso file] Read Box type trak size 4779 start 8555788
[iso file] Read Box type tkhd size 92 start 8555796
[iso file] Read Box type mdia size 4679 start 8555888
[iso file] Read Box type mdhd size 32 start 8555896
[iso file] Read Box type hdlr size 55 start 8555928
[iso file] Read Box type minf size 4584 start 8555983
[iso file] Read Box type smhd size 16 start 8555991
[iso file] Read Box type dinf size 36 start 8556007
[iso file] Read Box type dref size 28 start 8556015
[iso file] Read Box type url size 12 start 8556031
[iso file] Read Box type stbl size 4524 start 8556043
[iso file] Read Box type stsd size 108 start 8556051
[iso file] Read Box type alac size 92 start 8556067
[iso file] Read Box type stts size 24 start 8556159
[iso file] Read Box type stsc size 40 start 8556183
[iso file] Read Box type stsz size 3936 start 8556223
[iso file] Read Box type stco size 408 start 8560159
[iso file] Read Box type alac size 36 start 28
[iso file] Read Box type btrt size 20 start 64
* Movie Info *
Timescale 600 - 1 track
Computed Duration 00:01:30.928 - Indicated Duration 00:01:30.928
Fragmented File: no
File Brand isom - version 1
Created: GMT Thu Dec 17 14:35:48 2015
Modified: GMT Thu Dec 17 14:35:48 2015
File has no MPEG4 IOD/OD
Track # 1 Info - TrackID 1 - TimeScale 44100
Media Duration 00:01:30.929 - Indicated Duration 00:01:30.929
Media Info: Language "und (und)" - Type "soun:alac" - 979 samples
Audio Track - Sample Rate 44100 - 2 channel(s)
[ISOM Tools] codec parameters not known - setting codecs string to default value "alac"
RFC6381 Codec Parameters: alac
All samples are sync
我还尝试使用
-raw
标志提取音频轨道,如下所示:mp4box -raw 1 "inputfile.mp4"
它创建了一个
inputfile.mp4_track1.alac
文件,我无法在任何播放器(甚至VLC)中打开该文件。在HEX编辑器中查看它看起来像原始数据段(我想这很有意义),但我无法让mp4box放回我可以播放的.m4a中。所以我想问题是有人对mp4box有经验吗?提取时可能会丢失一些标志吗?还是mp4box只是产生错误的结果?我希望有人能指出我正确的方向。提前致谢!
最佳答案
mp4box已将原始音频流提取到文件inputfile.mp4_track1.alac。
我可以看到Windows Media Player无法播放而VLC可以播放的两个原因:
-WMP不支持原始流,并且只能播放封装/混合到文件容器中的音频流(例如:.MP4,.MKV,.AVI);
和/或
-WMP不支持本地ALAC格式,并且您的计算机上未安装此音频编解码器(尝试FFDShow)。
关于audio - 使用mp4box从.mp4中解混音频轨道,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34337545/