首先執行 mp4box -info 檔案.mp4 檢視 mp4 檔案的資訊。直接看最後兩段都是以 Track # 開頭,就會知曉這裡 Track # 1 是 H264 視訊、Track # 2 是 AC3 音訊。

R:\>mp4box -info file.mp4
* Movie Info *
        Timescale 600 - Duration 00:04:03.583
        Fragmented File no - 2 track(s)
        File Brand isom - version 1
        Created: GMT Wed Jul 27 04:44:43 2011

File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x15)
Audio PL: No audio capability required (0xff)
No streams included in root OD

Track # 1 Info - TrackID 1 - TimeScale 24000 - Duration 00:04:03.576
Media Info: Language "Undetermined" - Type "vide:avc1" - 5840 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 720 x 480 - Profile High @ Level 4.1
NAL Unit length bits: 32
Pixel Aspect Ratio 1:1 - Indicated track size 720 x 480
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:04:03.584
Media Info: Language "Undetermined" - Type "soun:ac-3" - 7612 samples
        AC3 stream - Sample Rate 48000 - 2 channel(s) 16 bits per samples



若要提取這裡的 Track # 1 也就是 H264 視訊,就執行 mp4box -raw 1 檔案.mp4

R:\>mp4box -raw 1 file.mp4
Extracting MPEG-4 AVC-H264 stream to h264

提出來的檔案是 file_track1.h264。


若要提取這裡的 Track # 2 也就是 AC3 音訊,就執行 mp4box -raw 2 檔案.mp4

R:\>mp4box -raw 2 file.mp4
Extracting AC3 Audio

提出來的檔案是 file_track2.ac3。


-raw 1-raw 2
-raw 表示直接提取 raw 格式;-raw 後面的數字 1、2 分別對應提取 mp4 檔案的 track 1、track 2。

創作者介紹

呆丸北拜已搬家至 Blogger

呆丸北拜 發表在 痞客邦 PIXNET 留言(0) 人氣()