View Full Version : MP4Box - No Data Size
mac8394
21st October 2009, 08:01
Hola. I've been testing MP4Box (GPAC version 0.4.6-DEV for Mac). It seems that somebody unofficially compiled the source for Mac.
Anyway, I like MP4Box because it's easy to use, but... As suggested by an older post (http://forum.doom9.org/archive/index.php/t-137010.html), final movies may not show the data size. If so, they cannot be edited/exported with QuickTime or MPEG Streamclip. The above-mentioned post says it's solved, but I do see a solution or solutions.
Has anybody figured figured out a solution to this problem? I've read MP4 FAQ, by the way. And my example syntax is
MP4Box -add /MyScratch/video3.h264 -fps 23.976 -add /MyScratch/audio10.aac -new /Volumes/SD\ MEMORY/Video.mp4
Thanks a lot.
b66pak
21st October 2009, 19:30
here is your answer:
http://forum.doom9.org/showthread.php?p=1298320#post1298320
_
mac8394
21st October 2009, 20:22
here is your answer:
http://forum.doom9.org/showthread.php?p=1298320#post1298320
_
Thanks for a replay. I went through three dozen pages of posts quickly. People appear mostly to talk about Yamb. I didn't spot a single post where people talk about MP4Box's data size or issue. If you are suggesting that I use Yamb, I can't. I'm on Mac, and I'm only looking for a command-line tool.
Thanks,
Tom
b66pak
22nd October 2009, 18:12
http://kurtnoise.free.fr/index.php?dir=mp4tools/&file=MP4Box-0.4.6-dev_20090619.zip
using this command line :
MP4Box -brand mp42:1 -add input.h264#1:delay=1:fps=23.976:lang=en -new output.m4v
the required field is #1:delay=1. fps=xx is required too if not equals to 25.000. The rest is optional...
Or an alternative command which works fine too:
MP4Box -delay 1=1 -fps=23.976 -add input.h264 output.mp4
In this pattern, the required field is delay 1=1.
and I get this:
http://uppix.net/2/2/d/4de7b8e81dfc8e8cce12c6dffeffat.jpg (http://uppix.net/2/2/d/4de7b8e81dfc8e8cce12c6dffeffa.html)
There is a drift of 4ms comparing to the original file. I'll try to improve that.
is all about mp4box man!
_
mac8394
22nd October 2009, 22:09
Thanks. I'll try the delay thing.
mac8394
23rd October 2009, 01:48
You seem to know quite a lot about MP4Box and MPEG4IP. As long as I see your screenshot, I can believe that you don't have the same data size problem. Unfortunately, the delay thing doesn't help me. The data size is still 0. I wish somebody compiled MP4Creator for Macs.
MP4Box -delay 1=1 -add /MyScratch/video3.h264 /Volumes/SD\ MEMORY/Kim.mp4
I'm making a Mac GUI app that would allow the user to pack raw stream files out of MKV and export a MOV container movie. For now, this is going nowhere.
Thanks for your time and help anyway.
Tom
http://www.mhvt.net/zzzzz/qt_nodatasize.jpg
Ritsuka
23rd October 2009, 08:45
The trick is to add an edit list to compensate the offset delay. Mov doesn't have this problem as it can used negative ctts values and got an additional atom to store the max and min offset value.
I wrote a little gui app for mac os x to mux mp4 in this way: http://code.google.com/p/subler/
mac8394
23rd October 2009, 08:53
Thanks for the response.
to compensate the offset delay.
Umm... I don't quite understand what you mean. What does that have to do with the data rate problem?
Thanks.
Ritsuka
23rd October 2009, 09:04
Because what you are experiencing is a QuickTime bug (or better, an behavior that depends on how quicktime work). A track in a mov file must always have the first sample at pts = 0. With mp4 and b-frames, the first pts is: 0 + composition offset. And that won't ever be 0 if you have a b-frame and if you can't use negative values in the ctts table. And QuickTime doesn't know what to do in this case.
Well, that's my guess.
mac8394
23rd October 2009, 09:17
Because what you are experiencing is a QuickTime bug
Whoa... Okay. You sound quite knowledgeable about MPEG-4. Somebody did in fact mention before that this data size problem occurs if the B-frame function is enabled, which goes with your theory.
Your app doesn't seem to use any command-line tools. Impressive... But it doesn't lets you read raw stream files (example, .h264, .264...), does it?
Ritsuka
23rd October 2009, 09:37
It does let you mux them into mp4.
crypto
23rd October 2009, 09:42
I have fixed the data size problem last year in mp4creator (http://sourceforge.net/projects/mp4creator/). There is currently no pre-built Mac binary, but you can get the src archive.
mac8394
23rd October 2009, 09:53
It does let you mux them into mp4.
Okay. But with all due respect, the openfile window doesn't let me select those raw stream files. I can select .mp4 and .m4a, but not even .aiff, .aac or .mp3. I know your Google project page says it does.
mac8394
23rd October 2009, 09:55
I have fixed the data size problem last year in mp4creator (http://sourceforge.net/projects/mp4creator/). There is currently no pre-built Mac binary, but you can get the src archive.
Grrr... I understand. Thanks. I don't think I can successfully compile it. I've tried, though.
Ritsuka
23rd October 2009, 12:26
Okay. But with all due respect, the openfile window doesn't let me select those raw stream files. I can select .mp4 and .m4a, but not even .aiff, .aac or .mp3. I know your Google project page says it does.
Because you need to create a new document first and then use the import function. It's a document based app. I know it should do it automatically…
mac8394
23rd October 2009, 13:00
Because you need to create a new document first and then use the import function. It's a document based app. I know it should do it automatically…
Ahh...
Ritsuka, your app is super impressive! This is the kind of command-line app that I'm looking for. Well, since I'm also developing a GUI app, I can't use it. I'm very impressed. You must be a genius software developer.
mac8394
23rd October 2009, 20:58
Oh, my gosh... You even have a command-line tool version. You are a God.
Muchas gracias.
Ritsuka
23rd October 2009, 21:11
Hopefully you will never look at the source code. The cli only useful to add subtitles tracks. Feel free to expand it.
mac8394
23rd October 2009, 21:25
Thanks. I thought it might allow me to import raw media clips to create MP4 container movies. I guess that would be too good to be true. I don't do C, C+ or C++. I don't even use XCode, which you seem to use. Maybe, some day...
chaynik
7th November 2009, 13:17
The trick is to add an edit list to compensate the offset delay. Mov doesn't have this problem as it can used negative ctts values and got an additional atom to store the max and min offset value.
I wrote a little gui app for mac os x to mux mp4 in this way: http://code.google.com/p/subler/
The 0 data size has been haunting me for quite over a year now. I've overcome it by passing all my encodes through ffmpeg (ffmpeg input.mp4 -vcodec copy -acodec copy output.mp4). Now that I've read your explanation, I'm curious, how does ffmpeg overcome this problem?
Ritsuka, your app is super impressive! This is the kind of command-line app that I'm looking for. Well, since I'm also developing a GUI app, I can't use it. I'm very impressed. You must be a genius software developer.
I have to second mac8394, this app is most excellent. I am amazed that you have SCC support, it's like a dream come true! I wasn't even aware CC could be muxed in the MP4 container.
Are subtitles saved as MPEG-4 Timed Text ISO/IEC 14496-17? I've noticed that while the subtitles play perfect in QuickTime Player on both Mac and Windows, they fail on an older version of VLC (0.8.6) but play on VLC 1.0+. Since timed text has been around for quite a while, I thought I'd ask. Timed text muxed with mp4box play fine in the older VLC as well as QT (albeit only if they have the .m4v extension while files muxed with your app display CC/subtitles in QT even if named .mp4) Also worthy of note is that subtitles do not render in Media Player Classic on Windows, while files with subtitles muxed with mp4box do.
I would also love a CLI interface as it would allow your app to be seamlessly plugged into various script chains. Also, is a Windows version possible?
Thank you Ritsuka for such an amazing app!
Ritsuka
7th November 2009, 13:39
The subtitles tracks are MPEG-4 Timed Text ISO/IEC 14496-17 , but the handler subtype is "sbtl", that's what apples uses in their "M4V " brand. CC are also an Apple addition. I wouldn't expect any support for them outside of apple players/devices.
ffmpeg doesn't have that problem in the first place, it works in a different way from quicktime.
chaynik
7th November 2009, 22:20
Ah, that makes sense. Since I've verified that quicktime plays subtitles muxed with mp4box, are there any advantages of using the proprietary "sbtl" handler?
But the 0 data size is a playback problem, no? What I meant by using ffmpeg was that it's the same file, just remuxed by ffmpeg. If let's say a video were to start on a B frame, QT would have an issue regardless. no? How does a different muxing engine solve it?
One more little thing, I noticed that QT reports the Format as "JVT/AVC Coding" in its Inspector for files muxed with Subler. While I realize it's just another way of saying H.264, why does it show that and not the latter, which is more recognizable?
Thanks.
Ritsuka
8th November 2009, 13:26
- The advantages is subtitles in every apple devices (ipod classic, nano, touch, iphone, appletv, itunes, quicktime). With the "text" handler you won't see them, and quicktime player will fall back to some very old and slow compositing path.
- The Quicktime issue can be resolved with an edit list.
- It shows that because mp4v2 write it as the codec name. I plan to remove it.
chaynik
10th November 2009, 23:24
Is it possible to include both the text handler (for compatibility with VLC and other players) as well as the sbtl handler for Apple products?
Ritsuka
11th November 2009, 08:55
You could include two separate tracks. But it would probably takes two lines of code to support the sbtl handler to a player with tx3g support. FFmpeg, mplayer and VLC already support it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.