Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th December 2003, 14:07   #1  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
HowTo create DVD-like Menus in MP4 - MP4Menu

ok, as some of you might already know the mpeg-4 standard offers the possibility to put menus, as known from DVDs, into the MP4 file format.
this small guide aims at helping you to be able to create an own menu, as known from dvd, yourself in the MP4 container format, by using the mp4menu script i wrote to make the process easier
with mp4menu you should be able to make a 1:1 copy of a DVD on CDR

proof of concept sample
before you start doing it yourself, you maybe want to see a proof of concept sample kindely provided by OBcecado!
note that only chapter1 and 2 will work (as its not the whole movie of course)


authoring in mpeg-4 systems
till someone writes a nice mpeg-2 systems -> mpeg-4 systems convertor, the menu authoring has to be done "by hand" by using a textual language format, called XMT or BT (based on VRML, like the well known Flash), which than has to be compiled/encoded into mp4 (a free available compiler/encoder is for example mp4box), which creates the so called BIFS track, which carries the menu and controls how the a/v gets played

why mp4menu?
as you can imagine writing a whole BT/XMT scipt from the ground by hand for a dvd-like menu in mp4 is not that easy.
a gui would make this process much easier and there are already some GUI oriented MP4 authoring tools existing, but all not available to the broad public!

now i always wanted to be able to also use menus on my backups, to be able to make a real 1:1 copy of a dvd on a cdr. so i wanted to explore the possibilities of mpeg-4 systems and create a dvd-like menu in mp4. thats why i started to learn the BT/XMT language from the ground.
to share my learned knowledge (and the resulting script) i created the mp4menu project which has the goal to make it easier for you to author such dvd-like menus in mp4 yourself

now you can find the product of this work on sourceforge on the mp4menu page i created there
i hope that i will be able to make mp4menu even better with your suggestions on what to improve

how can i use mp4menu?
mp4menu provides you a BT sample script (XMT will follow) which already offers all the main features you can find on a dvd menu (ie chapter menu, language menu, etc...)
"all" you have to do now is to adopt this sample script to the dvd menu you want to make a backup from (well most dvd menus are similar but not exactly the same)


so lets start with a small guide
before you can start let me tell you something about the "world" we are in:
[hm, as doom9 doesnt allow political discussions here i will leave the most important part out ]
in the current mp4menu script we are in a world that has 2 dimensions (well 3 dimensions are also possible in mpeg-4 systems, but i havent seen a 3D dvd menu till now ) and this world is defined by time (not frames, as mp4 also handles variable framerate) and pixels (not meters or somthing similar)

preparing the source
first of all: i dont allow the usage of mp4menu when it is against the legal situation in your country (in most countries its still allowed to make a backup of dvds you own, but not to break the dvd copy protections etc...)


i expect you to have your vob files, which contain the dvd menu, (or any other source you want to use) on your hd already

1) watch the dvd, learn how it works and note down what happens if you push here and there, where are the intros/outros/transitions between menus, what parts get looped etc...

2) encode/prepare the streams:
a) audio: specified audio formats in mp4 are mp3 and aac, but i think it makes things easier when you first convert your ac3 streams from the vob only into .wav (use besweet for that for example)
i will write later on why this can avoid problems

b) video: i expect you to know how to encode the video from a vob to mpeg-4. to avoid problems i suggest to use a codec which is able to input keyframes at specific points (all menus (chapters, languages, mainmenu) are stored right behind each other in the vob and will also be stored like this in 1 video stream in the mp4)
make sure you have a keyframe at positions where there are changes from 1 menu to the other for example (to find out where this exactly is you can also have a look at the vob (for example with virtualdubmod), cause it also has the keyframes at this points)
you can set keyframes in xvid (and in divx5 by using this ekg tool too afaik)
note that avi files created by divx5 or xvid using b-frames have to be muxed with mp4box or 3ivx to mp4, to get spec compliant mp4 files!

a second thing you have to look for is that the width of your menu video stream has to have the same width as the movie! (to avoid black borders on the sides)

c) convert your subs into the srt format (or hardcode them onto the video stream)

3) cut the video:
often there are different styles of menus stored on a dvd/in a vob, i suggest you to choose only one to keep the final menu size low
a) mux the wav with the whole video, open the video in vdm and cut out all parts you dont want to have/dont need in your final menu
you can do that with the ac3 too, but vdm isnt that good in ac3 cutting imho as you will see if you do it
b) demux the cutted wav and encode it with your favourite encoder to mp3 or aac

the following formats are supported as input in mp4box:
mpeg-4 video in .avi and .mp4
audio: .mp3, cbrmp3 in .avi (not vbrmp3!), aac in .mp4

lets start with the script
grap the mp4menu script
the script might look like a huge beast at first sight but dont be afraid you dont have to change that much in there

if you want to know what each command is for, feel free to ask or have a look a this great guide written by the guys of the gpac project (i think it covers everything i have in my script)

1) define the size of your "world"
search for "pixelWidth" and set it to the width of your videos, set the height in a 4:3 ratio, ie width is 576 than the height is 432 (576*3/4)

2) change the links to your input files

3) adjust the segments:
a) as you can see you can define the chapterpoints with segmentdescriptor, you always have to define the startpoint and the duration (all in seconds)
b) the same method is used to define the different parts of the menuvideo stream (menuintro, transitions, the menus themselves etc...)

4) define the type/position of your buttons:
to make the buttons visible add a "#" before "transparency 1.0" in the buttonappearance proto
a) as known from your mathematics courses we have to define two values to define a point in a 2D world
the first value (x) will move the object horizontally, the second (y) vertically. the point 0 0 is in the middle of the world!
b) you can have all sorts of types for a button, ie rectangle, ellipse aso...
x is the width of the object and y the height (for some styles (ie circle) you need to define a radius)

5) define the appearance and position of the subs
search for MovieSubtitle, there you can define the size, font etc...
guess what you can define under position

6) the moviebuttons
i have added an own menu which you can use during movie playback, which you will not find on a dvd that way

its a little bit difficult to describe here what you need to look for, where to add the buttons, etc.. thats why i added some infos in the script itself

ok, i think these are all basic things everyone has to look for when using mp4menu, of course there are some things you have to change for each dvd seperately (like the number of chapters, the number of languages (audio and subs) aso...
i didnt described now how exactly this works cause it will be different every time, but feel free to ask, i will do my best to help you with your specific backup

convert the script into mp4
to convert the bt script into binary format in mp4 you need a compiler/encoder
jeanlf from gpac has written such a tool, mp4box, which works great
grap it from here
create and execute a .bat file with the following commandline:
Code:
"c:\path to\mp4box.exe" -mp4 "c:\path to\mp4menu_0.1.bt"
and you will get the ready output mp4 file

how can i play these mp4 files?
as these mp4 files are spec compliant to the mpeg-4 systems standard you should be able to play them with every good mpeg-4 systems 2D player
imho the best currently available is the Osmo4 from GPAC!
i dont recommend the usage of enviviotv as it is very limited (doesnt support all the funky features, like mp3, png decoding, chapters, loop...) and is not available for free anymore!

how is the chance that i will be able to playback these menus on hardware players in the future?
if h264 will become the next dvd successor the chance isnt that small imo
you have to know that the mp4 container is the native container of the h264 codec (not avi) as defined in the mpeg-4 standard
well if h264 becomes a success, the industry will ask for a way to create dvd-like menus and the chance is great that they will use the mpeg-4 systems standard for that

TODO
- make the moviebuttons/menu to be placed automatically at the bottom of the world
- design a nicer layout for the moviemenu (perhaps add a jpg/png as background)
- add some "on mouse over" animations
- convert the BT script to XMT
- write a nicer guide add things that might arise in the discussion
- get dshow developers to release better support for mp4menu or at least write a dshow video switcher

hm, anything else i wanted to say? i surely forgot something
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free

Last edited by bond; 21st May 2004 at 15:41.
bond is offline   Reply With Quote
Old 11th December 2003, 14:59   #2  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,191
Wow!

If I may I would like to upload the file to the JovePlayer server.

Hopefully they will be able to make the menu system work with the Xcard.

Now that would be cool!

Cheers

EDIT: It's too bad about MP4 chapters in general though.

I remember many years ago I had an VHS VCR that could simply create (mark) chapters at the push of a button, while you were playing back your recordings. Too bad there isn't something as simple as this for Mpeg4 in an MP4 container....

We live to dream though!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 11th December 2003 at 18:20.
SeeMoreDigital is offline   Reply With Quote
Old 11th December 2003, 15:09   #3  |  Link
filewalker
Registered User
 
filewalker's Avatar
 
Join Date: Mar 2002
Location: Austria
Posts: 329
really impressive!

Works like a charme with the Osmo4 player...

now, I'm speechless...


Cu filewalker
__________________
I 'm ripping waves!...nothing else! \m/
filewalker is offline   Reply With Quote
Old 11th December 2003, 19:13   #4  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally posted by SeeMoreDigital
Wow!
Quote:
Originally posted by filewalker
really impressive!
now, I'm speechless...
great that you guys like it

Quote:
It's too bad about MP4 chapters in general though.
what do you mean? whats the problem with the chapters?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th December 2003, 19:35   #5  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,191
Quote:
Originally posted by bond
what do you mean? whats the problem with the chapters?
Well, I suppose my comment is really related to Recode2. It seems a bit odd that such an obvious facility has been omitted.

But as I've mentioned a few times before... It's early days yet!

Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th December 2003, 21:15   #6  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Now all that awaits is for Gabest to implement displaying MP4 menus in MPC .
mf is offline   Reply With Quote
Old 11th December 2003, 21:32   #7  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,191
Quote:
Originally posted by mf
Now all that awaits is for Gabest to implement displaying MP4 menus in MPC .
Oh yea!

mf, could you get any part of the file to play in MPC. I could not!


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th December 2003, 21:39   #8  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
as i wrote in my guide, you need a systems capable player/filter to decode systems content

the only available dshow filter capable of that is enviviotv, but it is very limited as i described already too...
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th December 2003, 22:05   #9  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,191
Quote:
Originally posted by bond
as i wrote in my guide, you need a systems capable player/filter to decode systems content

the only available dshow filter capable of that is enviviotv, but it is very limited as i described already too...
The file can just about run using the QuickTimePro player... without the interactive content ofcourse.
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th December 2003, 22:13   #10  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by SeeMoreDigital
Oh yea!

mf, could you get any part of the file to play in MPC. I could not!


Cheers
Yes, the main movie plays fine. Which is nice, cause it means these rips will be backwards-compatible.
mf is offline   Reply With Quote
Old 11th December 2003, 22:22   #11  |  Link
RadicalEd
Registered User
 
Join Date: Dec 2001
Posts: 987
Was starting to wonder
I haven't been working on mine :P so lazy am I. I'll get that thing done some day :|

Very nice indeed.
RadicalEd is offline   Reply With Quote
Old 11th December 2003, 22:27   #12  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
quicktime is one of the few players that support video switching already

to be really 100% backwards compatible with all dshow filters/players that dont understand systems we will need something like a video switcher filter or function in these players

but better than a dshow video switcher filter would be a good dshow systems decoder filter
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th December 2003, 22:34   #13  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,191
As an encode, it looks beautiful in hardware. All 1 minute 40.14 seconds of it!

Cheers

EDIT: I don't believe it. This is my 1004th post. I've nearly done as many as bond... but obviously they aren't nearly as informative!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 11th December 2003 at 22:37.
SeeMoreDigital is offline   Reply With Quote
Old 11th December 2003, 23:50   #14  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by SeeMoreDigital
EDIT: I don't believe it. This is my 1004th post. I've nearly done as many as bond... but obviously they aren't nearly as informative!
Wow, I have 1004 too! (Well, now I have 1005 of course, but when I started this post I had 1004) . I wonder between you and me who would have the most informative posts .
mf is offline   Reply With Quote
Old 12th December 2003, 02:02   #15  |  Link
LordIntruder
Registered User
 
Join Date: Jan 2003
Posts: 109
Hi.


Have just been watching the sample of SW II and yes it is great!!

I'm doing similar dvd movies menus by using the old microdvd player which allow to make same things. The only one that don't work properly is when you want to make a bivx, the second audio stream has to be out of the avi and so I look for a better program to avoid that but meanwhile I stay with microdvd.

Well I tried to install things but I don't understand anything . I'm under Windows XP and have no knowledge of any script or stuff like that. Is there a GUI somewhere of GPAC? I'm quite at a lost with all those *.BT files. I see no EXE, no program to be launched, but I see many files extensions I never encounter before! Your small guide is fine but it doesn't help me.

Are there more explanations, step by step, somewhere else? Something like guides here that explain clearly to a newbie how to make a divx, should be fine to have such similar things with your project.

Anyway cheers for your work.
LordIntruder is offline   Reply With Quote
Old 12th December 2003, 03:17   #16  |  Link
Animaniac
Registered User
 
Animaniac's Avatar
 
Join Date: Mar 2003
Location: Cambridge, MA
Posts: 286
Very VERY impressive.
Animaniac is offline   Reply With Quote
Old 12th December 2003, 08:06   #17  |  Link
ThePanda
Registered User
 
Join Date: Oct 2001
Location: Connecticut
Posts: 117
Is it possible that menus like this will ever be integrated into an automated tool like Nero Digital for DVD -> mpeg4 backup with the menus preserved?
ThePanda is offline   Reply With Quote
Old 12th December 2003, 09:59   #18  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally posted by LordIntruder
Well I tried to install things but I don't understand anything . I'm under Windows XP and have no knowledge of any script or stuff like that. Is there a GUI somewhere of GPAC? I'm quite at a lost with all those *.BT files. I see no EXE, no program to be launched, but I see many files extensions I never encounter before! Your small guide is fine but it doesn't help me.
well thats the problem, there is no gui atm

you will have to adopt the settings in the bt script itself, than you grap a systems compiler/encoder (one is for example mp4box from gpac)
use the following commandline:
Code:
"c:\path to\mp4box.exe" -mp4 "c:\path to\mp4menu_0.1.bt"
and you will get the output mp4 file
thats "all"

Quote:
Are there more explanations, step by step, somewhere else? Something like guides here that explain clearly to a newbie how to make a divx, should be fine to have such similar things with your project.
nope, there are no other step by step guides focusing on dvd menus
i think, i (proudly) can say that i am the first one who did it (at least in the public)

i think i covered in my small guide till now all things that are similar for every dvd, but as you can imagine there also big differences for every dvd/user (like how many subs, audio streams, chapters...)
i suggest everyone who is interested in making a mp4 menu this way just to start with it and when there are problems just ask, i will do my best to help you
after some time i think i will be able than to figure out what people need most, what the focus should be in a guide and than write an overall step-by-step guide

Quote:
Originally posted by ThePanda
Is it possible that menus like this will ever be integrated into an automated tool like Nero Digital for DVD -> mpeg4 backup with the menus preserved?
would be great of course
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 12th December 2003, 11:45   #19  |  Link
c0p0n
DVDBackup-Esp.net WMaster
 
c0p0n's Avatar
 
Join Date: Oct 2001
Location: Spain
Posts: 47
two words: IM-PRESSIVE. I've never been such impressed by something remotely related to MPEG4 since... well, Nandub b16(I think), maybe before with VirtualDub VKI MM4.
the next step is a WYSIWYG editor...
keep up the good work!
__________________
MPEG4 r00lz!
c0p0n is offline   Reply With Quote
Old 12th December 2003, 13:05   #20  |  Link
LordIntruder
Registered User
 
Join Date: Jan 2003
Posts: 109
Quote:
Originally posted by bond
[B]well thats the problem, there is no gui atm
Ah ok!! At least it is now clear. Do you plan do make one? If you want your work to be widely used you should think to make one. Microdvd Player has a GUI and once you learnt how to use it, it is a piece of cake to make DVD menu.

The "plus" with your project is that everything is included in the MP4. With Microdvd menu is outside of the main AVI, including sounds, images. You must have an executable and some ini files (script) and it may confuse the user, so you have to make an executable to launch everything in the right order.

With your project we just have to use a specific wiever and it rocks.

Quote:
you will have to adopt the settings in the bt script itself
Ok got it!! I opened the BT file with Notepad and everything comes clear. Well clear is not the right word because if now I know where the commands are, it is a real headache to learn how to use it. You see why I ask for a GUI? lol

When I first learn how to use MicroDVD menu creation it was already a real pain in the ass to figure out all the commands, what were their impact as the guide can not cover each case. But your BT script is at least twenty times longer than my microdvd ones and it is hard to notice what are the lines that are needed for the program to work fine and the ones than can be changed and only needed for the menu.

Quote:
after some time i think i will be able than to figure out what people need most, what the focus should be in a guide and than write an overall step-by-step guide
I can give my experience on dvd menu creation with Microdvd.

I copy vobs and encode menus if they are animated ones or takes snapshots. I encode music of those menus or add ones taken from the movie. Then with the GUI I select the clickable areas. The rest is done by "hand" with notepad (because I'm used to use that program) but you can do it with the GUI. There are some commands to learnt, you put them, you add links from one menu to the next (chapters, audios, etc...).

The user should be able to increase/decrease size and type of font for subtitles, didn't see that when playing your SW II sample. Also the possibility to use vobsub subtitles instead of only OCR (srt) ones. The possibility to add more than 2 audios streams, 2 languages and a commentary stream. The possibility to use Ogg as audio, usual stuff like that.

I'll keep an eye on your work.
LordIntruder is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.