View Full Version : MP4Box and Sony Vegas problem
vlada
7th November 2006, 16:23
Hello,
I have a problem with opening of MP4 files created by MP4Box (YAMB) in Vegas 7. I did some tests and here are the results:
MeGUI, x264 encoder, MP4 output, I tried 3 different profiles - Baseline, Main and High. All files can be opened in Vegas.
I remuxed on of the MP4 in YAMB (2.0 preview, MP4Box 4.3.0 - 20061018). The file still can be opened in Vegas.
I extracted the video stream from the MP4 to RAW .h264 file. Of course Vegas cannot open it (as any other RAW video streams).
Then I muxed the RAW stream back to MP4, but this time Vegas won't open it. It says "Video: Stream attributes could not be determined".
I ran across this problem when I tried to open an MKV in Vegas. I remuxed it to MP4, but Vegas won't open it.
How can I check, if an MP4 file is ISO compliant to determine, if it is a problem of Vegas or MP4Box? What makes the difference when muxing a stream contained in MP4 and a RAW h264 stream?
Also I noticed, that an older version of MediaInfo wasn't able to read any information regarding a video stream in the MP4 files Vegas rejects. The latest version doesn't have any problems.
bond
7th November 2006, 21:26
x264 and yamb/mp4box all use the gpac mp4 muxing library for mp4 creation, so there shouldnt be any standard compliancy issues/differences
best would be you run mp4dump from mpeg4ip over both mp4 files (the one that works and the one remuxed that doesnt) and check the differences in both
vlada
7th November 2006, 21:43
O.K., so here are the files.
A working file:
[ftyp] size=8+16
major_brand = avc1
minor_version = 0
compatible_brand = isom
compatible_brand = avc1
[mdat] size=8+10180009
[free] size=8+43
[moov] size=8+32194
[mvhd] size=12+96
timescale = 600
duration = 171047
duration(ms) = 285078
[iods] size=8+13
[trak] size=8+32057
[tkhd] size=12+80
enabled = 1
id = 1
duration = 171047
[mdia] size=8+31957
[mdhd] size=12+20
timescale = 1250000
duration = 356349882
duration(ms) = 285079
language = und
[hdlr] size=12+43
handler_type = vide
handler_name =
[minf] size=8+31862
[vmhd] size=12+8
graphics_mode = 0
op_color = 0000,0000,0000
[dinf] size=8+28
[dref] size=12+16
[url ] size=12+0
location = [local to file]
[stbl] size=8+31798
[stsd] size=12+154
entry-count = 1
[avc1] size=8+142
data_reference_index = 1
width = 320
height = 240
compressor =
[avcC] size=8+36
[btrt] size=8+12
[stts] size=12+12
entry_count = 1
[stss] size=12+164
entry_count = 40
[stsc] size=12+28
entry_count = 2
[stsz] size=12+28512
sample_size = 0
sample_count = 7126
[stco] size=12+2856
entry_count = 713
A not working (remuxed) file:
[ftyp] size=8+12
major_brand = isom
minor_version = 1
compatible_brand = isom
[moov] size=8+75210
[mvhd] size=12+96
timescale = 600
duration = 8211
duration(ms) = 13684
[iods] size=8+13
[trak] size=8+75073
[tkhd] size=12+80
enabled = 1
id = 1
duration = 8211
[mdia] size=8+74973
[mdhd] size=12+20
timescale = 25000
duration = 342144
duration(ms) = 13685
language = und
[hdlr] size=12+43
handler_type = vide
handler_name =
[minf] size=8+74878
[vmhd] size=12+8
graphics_mode = 0
op_color = 0000,0000,0000
[dinf] size=8+28
[dref] size=12+16
[url ] size=12+0
location = [local to file]
[stbl] size=8+74814
[stsd] size=12+158
entry-count = 1
[avc1] size=8+146
data_reference_index = 1
width = 320
height = 240
compressor =
[avcC] size=8+40
[btrt] size=8+12
[stts] size=12+12
entry_count = 1
[ctts] size=12+45716
entry_count = 5714
[stss] size=12+168
entry_count = 41
[stsc] size=12+40
entry_count = 3
[stsz] size=12+28520
sample_size = 0
sample_count = 7128
[stco] size=12+116
entry_count = 28
[mdat] size=8+10155086
[free] size=8+43
I see a difference in the major_brand = avc1 and major_brand = isom. What doese this mean? Unfortunately I don't know too much about MP4 structure.
bond
7th November 2006, 21:50
you can set an own brand by using the -brand option in mp4box
try -brand avc1
vlada
8th November 2006, 03:14
Thanks, I'll try it when I get home.
But why isn't it set automatically by YAMB or MP4Box? Both YAMB and MP4Box recognize the video stream correctly as MPEG-4 AVC. So I would think the correct brand should be set automatically.
CruNcher
8th November 2006, 03:19
oha maybe this could also explain the problems with cyberlinks decoder hmmm :P
vlada
8th November 2006, 17:49
you can set an own brand by using the -brand option in mp4box
try -brand avc1
So here is the dump of the file created using -brand avc1 option:
[ftyp] size=8+16
major_brand = avc1
minor_version = 0
compatible_brand = isom
compatible_brand = avc1
[moov] size=8+75210
[mvhd] size=12+96
timescale = 600
duration = 8211
duration(ms) = 13684
[iods] size=8+13
[trak] size=8+75073
[tkhd] size=12+80
enabled = 1
id = 1
duration = 8211
[mdia] size=8+74973
[mdhd] size=12+20
timescale = 25000
duration = 342144
duration(ms) = 13685
language = und
[hdlr] size=12+43
handler_type = vide
handler_name =
[minf] size=8+74878
[vmhd] size=12+8
graphics_mode = 0
op_color = 0000,0000,0000
[dinf] size=8+28
[dref] size=12+16
[url ] size=12+0
location = [local to file]
[stbl] size=8+74814
[stsd] size=12+158
entry-count = 1
[avc1] size=8+146
data_reference_index = 1
width = 320
height = 240
compressor =
[avcC] size=8+40
[btrt] size=8+12
[stts] size=12+12
entry_count = 1
[ctts] size=12+45716
entry_count = 5714
[stss] size=12+168
entry_count = 41
[stsc] size=12+40
entry_count = 3
[stsz] size=12+28520
sample_size = 0
sample_count = 7128
[stco] size=12+116
entry_count = 28
[mdat] size=8+10155086
[free] size=8+43
Vegas now reads the file, but says it has 100 fps (originally 25). Also instead of a picture only green screen is displayed.
This is what MediaInfo now says about the file:
General #0
Complete name : C:\Program Files\Multimedia\Video\YAMB\pokus3.mp4
Format : 3GPP JVT AVC (MPEG-4) / 3GPP
Family : MPEG-4
File size : 9.76 MiB
PlayTime : 13s 685ms
Bit rate : 5980 Kbps
Video #0
Codec : H.264
Info : H.264 (3GPP)
PlayTime : 13s 685ms
Bit rate : 8036 Kbps
Width : 320
Height : 240
Aspect ratio : 4/3
Frame rate : 520.862 fps
Bits/(Pixel*Frame) : 0.201
Size : 10155086
The same incorrect information about FPS is also in the other files created using YAMB, that Vegas won't open. Only the original MP4 file from x264 shows correct information. And if I try to play the files, they really play as fast as possible.
It seems to me there is a bug in MP4Box, wouldn't you say?
CruNcher
8th November 2006, 18:01
vlada could you try mp4creator please :)
vlada
8th November 2006, 19:12
I only could find Windows binary of version 1.4.1. The results are following:
MP4Creator refused to mux the stream unless I specify a framerate. After that it created a working MP4 file, although it says "Error decoding sei message".
The resulting MP4 file plays fine, but in Vegas it again has only green picture. Well in fact there is a part of first frame, but that's all. The rest is just green. The green picture is most likely an incompatibility with AVC high profile.
I tried a baseline profile file and that worked fine. So please ignore the information regarding green picture.
Another interesting thing is, that if I mux any of the AVC streams in AVI (using AVC2AVI), it works fine. Vegas says the format is ffdshow, probably because ffdshow VfW codec is used. So the are no profile compatibility issues.
I can see 2 main problems:
1) MP4Box writes a wrong brand information for AVC streams.
2) There is a problem reading FPS from AVC stream. The same problem have evidently also MediaInfo and MP4Creator.
MediaInfo displays only these information about the AVC stream:
General #0
Complete name : C:\Program Files\Multimedia\Video\YAMB\track1.h264
Format : AVC
Info : Advanced Video Codec
Family : MPEG-4
File size : 9.71 MiB
Video #0
Codec : AVC
Family : MPEG-4 AVC
Codec profile : Baseline@L5.1
CruNcher
8th November 2006, 19:22
Sony Vegas uses Mainconcepts Parser/Decoder (for native .mp4) most probably an older buggy (or no High Profile support) version (and maybe to strict with standard files and doesn't like the mp4box created files with the wrong brand and seems it's not the only software that does reject such mp4 files now it doesn't suprises me that mp4creator worked) that could explain the green problem with the High Profile Stream.
Mp4box allways uses as standard FPS 25 Pal if you don't chose it yourself i dunno what MediaInfo is showing their Frame rate : 520.862 fps seems completly wrong to me did you checked the fps with other parser like the ones in Mplayer and VideoLanClient i never used MediaInfo so i can absolutely not say anything about it.
but vlada this doesn't say alot yet also the structure from the working to the remuxed file is completly different maybe this couses problems with picky parsers i dunno, also it would be better to test this finaly big scale with different vendor solutions and find those interoperability problems but therfore it would also be needed to test the latest CVS version of Mp4box and Mp4creator and not some old windows builds. Maybe even a Vegas Update could fix this what seems to be (correct parsing) problems.
The only thing i know is that Mainconcept/Elecard are working very near @ the Standard sure bugs are still possible but i fear gpac and co are more buggy then those (Professional Solutions) on the other Hand Sony Vegas is no Professional Video Editing Solution it's one stage before that so even such parsing bugs could be possible. One thing for sure Interoperability is still a big problem and we can't still be sure that something we create with mp4box will be able to be playbacked flawlessy by every vendor parser/decoder.
vlada
8th November 2006, 19:50
I tried also VLC with the same result - 520 fps. Anyway I think everybody can try to reproduce it by himself. Just create an MP4 with x264, demux it and mux again.
If anyone can provide latest CVS builds of MP4Box and MP4Creator, I'd be happy to try them out. Unfortunately I don't know how to build them on Windows and my Linux installation is currently broken.
Drachir
8th November 2006, 20:23
The only thing i know is that Mainconcept/Elecard are working very near @ the Standard sure bugs are still possible but i fear gpac and co are more buggy then those (Professional Solutions) on the other Hand Sony Vegas is no Professional Video Editing Solution it's one stage before that so even such parsing bugs could be possible. One thing for sure Interoperability is still a big problem and we can't still be sure that something we create with mp4box will be able to be playbacked flawlessy by every vendor parser/decoder.
I fear there are to many so called professional solutions, that are not close to the standard.
Tools from GPAC should be standard conformance(bugs can happen).
Drachir
8th November 2006, 20:34
@vlada can you use mp4dump with verbose? At the monent you can't see what is inside the [stts],[ctts],[stss],[stsc][stsz][stco]. Attach the output of remuxed and orginal in a text file.
If you remux the RAW H.264 file with MP4Box you have to set the framerate:
MP4Box -add video.h264:fps=enterFrameRate video.mp4
Did you used x264 to create a file with a high frame rate?
bond
8th November 2006, 22:22
do you get the green picture even with a baseline profile file?
But why isn't it set automatically by YAMB or MP4Box? Both YAMB and MP4Box recognize the video stream correctly as MPEG-4 AVC. So I would think the correct brand should be set automatically.well, mp4box sets the correct brand automatically
if vegas doesnt support it, its vegas fault, not mp4box'
vlada
8th November 2006, 22:37
bond
As I already said, the problem with green picture only appears if I use high profile - most likely a bug of Vegas' AVC decoder.
But the incorrect brand is there because of MP4Box. So I guess it is MP4Box's fault. Because if I set it manually and also set manually FPS, then there are no more problems. You can see from the dumps, that there really is incorrect info in the MP4 files created by MP4Box.
bond
8th November 2006, 22:41
the brand set by mp4box automatically (aka isom) is not incorrect. period
send a bug report to the vegas guys to make them fix their tool
vlada
9th November 2006, 04:28
the brand set by mp4box automatically (aka isom) is not incorrect. period
Sorry, I didn't get that from your previou posts. Btw. what is the difference between ISOM and AVC1? If I understand it correctly, then "brand" is something like FourCC in AVI files. Or am I completely wrong?
And now to the second problem - framerate. Is it then really true, there is no framerate information in .h264 streams? I tried again with the latest MP4Box (20061018) to demux and mux a main profile MP4/AVC. I got again a completely wrong framerate (I haven't specify any in command line). The resulting file has 0,075 FPS (confirmed by VLC and MediaInfo, ffdshow says 25 FPS, but plays at 0.075).
So I guess I'll contact Kurtnoise and ask him to add 2 options to YAMB (MP4Box GUI):
1) Use -brand avc1 as default for AVC streams because of compatibility reasons (I hope it won't do any harm).
2) If adding an AVC stream, ask for framerate and always specify it for MP4Box.
Currently YAMB 2.0 ignores brand and framerate information I entered when creating MP4 file.
CruNcher
Please find attached the 2 dumps from an original and remuxed file.
Kurtnoise
9th November 2006, 09:44
So I guess I'll contact Kurtnoise and ask him to add 2 options to YAMB (MP4Box GUI):
1) Use -brand avc1 as default for AVC streams because of compatibility reasons (I hope it won't do any harm).
2) If adding an AVC stream, ask for framerate and always specify it for MP4Box.
Already exists....select your file and go to Properties. Then, put your framerate in the right box and choose "Other..." in the Brand Name drop down list and overwrite it by avc1. Ok to validate. That's all.
vlada
9th November 2006, 15:09
Kurtnoise13
I tried it on 2 different computers, but unfortunately the options do not work for me. Do you have any idea what might be wrong?
Kurtnoise
9th November 2006, 15:41
What do you mean by "do not work" ? Is it disabled or you're able to write something ? Could be great to have the Yamb.log file also...
btw, post your reply directly in Yamb's thread.
ncatt
15th November 2006, 08:35
Hi vlada, for edit mp4 in vegas 7 mux in 3gp, nor mp4. The generated file open and edit just fine. For edit avc high profile in vegas: buy and install the full version of mainconcept h264 encoder (version 2.0.15 and up) and copy the files mch264dec.000, mch264dec.001, mch264dec.002, mch264dec.003 and mch264dec.004 in the mcmp4 folder (the path is sony\shared plug-ins\file formats) and overwrite all them. PS: Just insane profile is problematic in vegas (green noise here) and if your video is raw, set the framerate.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.