Log in

View Full Version : MP4Box Builds with .TS De-muxing


SeeMoreDigital
22nd May 2006, 11:30
To follow on from Kurt's announcement below (which he made over in this thread) (http://forum.doom9.org/showthread.php?p=830556#post830556): -
Heya,

Some infos concerning MP4Box and gpac stuff : vobsub support has been officially integrated into the cvs today. So, great work Falco. ;) Now, a MPEG TS demuxer is on the way. Feel free to test it.

As usual, my MP4Box compiles for win32 are available here (http://kurtnoise.free.fr/mp4tools/).I thought it might not be a bad idea to start a new thread dedicated to MP4Box and its .TS de-muxing capabilities.


Cheers

SeeMoreDigital
22nd May 2006, 17:14
Hi Kurt,

Using MP4Box_20060521.zip (21-May-2006 23:49 576k) build, the only .TS stream I've been able to de-mux elementary streams, is from a BBC_H264_test6.ts source: -

http://img375.imageshack.us/img375/2382/yambtstesting3mp.png

Unfortunately the de-muxed RAW AVC could not be muxed into the MP4 container because YAMB/MP4Box reports "Bitstrean Not Compliant" :(

Anybody else had any more luck?

Kurtnoise
22nd May 2006, 17:51
Could you post some infos of this raw AVC stream ?

MP4Box -info my_raw_file.264

SeeMoreDigital
22nd May 2006, 18:06
Could you post some infos of this raw AVC stream ?

MP4Box -info my_raw_file.264

All I seem to be able to obtain "Information" wise, is this: -
Import probing results for track D:\Documents and Settings\SeeMoreDigital\Desktop\MP4Box TS Tests\RAW Video.264#1:
Track type: Video (....)
Source: ....

Import Capabilities:
Can override source frame rate


When importing the BBC_H264_test6.ts source I see the following "Information": -
Import probing results for track D:\Documents and Settings\SeeMoreDigital\Desktop\MP4Box TS Tests\BBC_H264_test6.ts#2318:
Track type: Video (H264) - Program
Source: H264

Import Capabilities:

EDIT: Here's a link to the BBC_H264_test6.ts source (http://www.giusberto.ch/hdtv/) I've been using...


Cheers

Kurtnoise
22nd May 2006, 22:25
Indeed...did you try with mpeg-2 video streams ?

btw, there is an update (http://kurtnoise.free.fr/mp4tools/MP4Box_20060522.zip). With your sample, I'm able to import audio stream now but with the video stream MP4Box crashes :

MP4Box -add your_sample.ts#2320 output.mp4

SeeMoreDigital
22nd May 2006, 22:33
Same here...

By-the-way, how come the extracted RAW video stream carries an ".264" file extension and not an ".h264" file extension?


Cheers

Kurtnoise
22nd May 2006, 22:39
By-the-way, how come the extracted RAW video stream carries an ".264" file extension and not an "h.264" file extension?
h.264 refers to the AVC Part 10 standardization and almost files extension have only 3 characters (for windows plateform at least). Don't know why you care about extension...


I'm trying with an MPEG-2 video stream (http://download.videolan.org/pub/videolan/streams/), and it seems to work. (import & demux)

MP4Box -raw 68 my_sample.ts
MP4Box -add my_sample.ts#68 output.mp4

SeeMoreDigital
22nd May 2006, 22:48
h.264 refers to the AVC Part 10 standardization and almost files extension have only 3 characters (for windows plateform at least). Don't know why you care about extension...It's simply a consistency observation. Because when you extract RAW AVC streams from out of the MP4 container, they have an ".h264" file extension, not ".264".



I'm trying with an MPEG-2 video stream (http://download.videolan.org/pub/videolan/streams/), and it seems to work. (import & demux)

MP4Box -raw 68 my_sample.ts
MP4Box -add my_sample.ts#68 output.mp4That's encoraging.... I'll give this MPEG-2 sample (and some others I've got), a try tomorrow and report back ;)


Cheers

SeeMoreDigital
23rd May 2006, 18:47
Using the MPEG-2 within .TS sample (you provided a link to) I too have been able to extract the RAW MPEG-2 stream, albeit by editing via the command line box.

During the "extracting" process however I noticed it says "Extracting MPEG-2 Visual stream to "m1v" and not "m2v": -

http://img376.imageshack.us/img376/1427/yambtsextract1wx.png

And although the extracted file actually carries the correct ".m2v" file extension, the elementary stream can't be played (until you run it thru' DGIndex).

Just about every other MPEG-2 within .TS sample I've tried reports: -Skipping 68 bytes of garbage in section
Skipping 68 bytes of garbage in section
Skipping 68 bytes of garbage in section
Skipping 68 bytes of garbage in sectionOver and over again :(


Cheers

Kurtnoise
10th June 2006, 11:11
Using MP4Box_20060521.zip (21-May-2006 23:49 576k) build, the only .TS stream I've been able to de-mux elementary streams, is from a BBC_H264_test6.ts source: -

Unfortunately the de-muxed RAW AVC could not be muxed into the MP4 container because YAMB/MP4Box reports "Bitstrean Not Compliant" :(

Although there are some warnings, it seems to be ok now with the last CVS entry (http://kurtnoise.free.fr/mp4tools/MP4Box_20060610.zip).

But there is a problem regarding direct import&mux from avc video streams within ts files...But I've made only one test.

SeeMoreDigital
10th June 2006, 12:27
Yep... I've managed to de-mux and mux the BBC source into MP4... But like you say there are "errors": -

Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
Waring: Error parsing NAL unit
AVC-H264 import - frame size 1440 x 1088 at 25.0000 FPS
Adjusting AVC SizeLength to 16 bits
Adjusting AVC SizeLength to 24 bits
Saving to D:\Documents and Settings\SeeMoreDigital\Desktop\BBC_H264_test6 (1440x1088)_pid2318.mp4: 0.500 secs Interleaving


I managed to de-mux a couple of MPEG-2 with MP2 and AAC audio too..... However MP4Box still has trouble detecting the PID stream data the majority of .TS sources.

It's certainly getting there though :D

bond
10th June 2006, 13:38
avc in ts streams dont start with keyframes and the required pps/sps headers normally being at the start of the stream
i assume mp4box drops all the frames/nal info till the first keyframe and thats what those error messages are

i sent jeanlf this bbc sample for making interlaced importing work, cause till now mp4box didnt get the height info right on interlaced streams (judging from smd's post it seems it works now):
http://sourceforge.net/tracker/index.php?func=detail&aid=1492115&group_id=84101&atid=571738

SeeMoreDigital
10th June 2006, 13:54
I sent jeanlf this bbc sample for making interlaced importing work, cause till now mp4box didnt get the height info right on interlaced streams (judging from smd's post it seems it works now):Indeed it does work.... but unlike the .TS source there's a fair bit of lag before the MP4 begins to play in Media Player Classic (and CoreAVC 1.1).

Any idea what could be causing this lag?

bond
10th June 2006, 14:09
Indeed it does work.... but unlike the .TS source there's a fair bit of lag before the MP4 begins to play in Media Player Classic (and CoreAVC 1.1).

Any idea what could be causing this lag?mp4box maybe did set a lag and its propably good it did this, because imagine you merge the audio you get from the ts (reencoded to aac or mp3) into the mp4 too. if there wouldnt be a lag you would get desync

just guessing

SeeMoreDigital
10th June 2006, 14:27
mp4box maybe did set a lag and its propably good it did this, because imagine you merge the audio you get from the ts (reencoded to aac or mp3) into the mp4 too. if there wouldnt be a lag you would get desyncActually no... the lag is with an video only in MP4 stream!

But here's something rather bizarre, when you mux the RAW .264 stream into the .AVI container using Sharktooth's newest build of AVC2AVI Muxer, you get an AVI with a resolution of just 1440x544 - ie: half the vertical resolution!

It does play without any lag though.... LOL


Cheers

bond
10th June 2006, 14:32
Actually no... the lag is with an video only in MP4 stream!yes, but this doesnt change what i said ;)

if you demux the raw stream from the mp4 and remux again you will propably get a mp4 without the lag

maybe its also a bug, you might want to ask jeanlf about it

But here's something rather bizarre, when you mux the RAW .264 stream into the .AVI container using Sharktooth's newest build of AVC2AVI Muxer, you get an AVI with a resolution of just 1440x544 - ie: half the vertical resolution!propably a bug in avc2avi

It does play without any lag though.... LOLobvious, same as when remuxing the raw stream to mp4 i assume

SeeMoreDigital
10th June 2006, 14:58
yes, but this doesnt change what i said ;)

if you demux the raw stream from the mp4 and remux again you will propably get a mp4 without the lag Sadly no it doesn't.... You still get some lag... It's around "8" seconds before the file starts to play.


Cheers

bond
10th June 2006, 15:05
Sadly no it doesn't.... You still get some lag... It's around "8" seconds before the file starts to play.


Cheersvery strange, i guess its more a bug then