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 27th April 2002, 15:02   #1  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Aspect Ratio flag in MPEG4-Video?

Does MPEG4-Video support setting the display aspect ratio in the stream? If yes, is there any tool to set it?

Or do I have to live with using square pixels?
Chibi Jasmin is offline   Reply With Quote
Old 27th April 2002, 16:45   #2  |  Link
ProfDrMorph
fresh brains!
 
ProfDrMorph's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 195
I'm not sure but I think the problem is that AVI ( the container most people use for MPEG4 video ) only supports square pixels. The upcoming MCF format will support an aspect ratio flag as far as I know.
ProfDrMorph is offline   Reply With Quote
Old 27th April 2002, 18:36   #3  |  Link
DeXT
Registered User
 
Join Date: Mar 2002
Location: Spain
Posts: 307
It's true that AVI only does support square pixels. But it's true also that the MPEG-4 video stream has an aspect ratio flag. The problem is, no current MPEG-4 CODEC makes use of this flag (it's always set to 1) and no player currently available support it.

I made my own tests, both with a DivX file and a MP4 one. The first one, when I changed it to an alternate aspect ratio value (using an hex editor and some MPEG-4 specs), the DivX decoder totally messed up the picture, so I guess it doesn't like this very much.

With the MP4 file, once changed, the MPEG4IP's wmp4player simply ignored this field when playing.

I put a request in DivX forums asking support for this in future. But I doubt anyone in the DivX team may have any interest in this.
DeXT is offline   Reply With Quote
Old 27th April 2002, 18:46   #4  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Thanx for the information...at least, it's there... :-)
Chibi Jasmin is offline   Reply With Quote
Old 27th April 2002, 18:47   #5  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Quote:
Originally posted by DeXT
The problem is, no current MPEG-4 CODEC makes use of this flag (it's always set to 1) and no player currently available support it.

Well, mp4encode from the mpeg4ip utils supports setting an aspect ratio for encoding from raw (uncompressed) avi to MPEG-4...strange that wmp4player doesn't support it then...so there is one mpeg-4 codec using it...but I guess this one is out of the question due to quality...and if the player really doesn't play it anyway....


Last edited by Chibi Jasmin; 27th April 2002 at 18:50.
Chibi Jasmin is offline   Reply With Quote
Old 27th April 2002, 20:57   #6  |  Link
DeXT
Registered User
 
Join Date: Mar 2002
Location: Spain
Posts: 307
Well I tried with a somewhat old release I think (0.9.2 or 0.9.3). Perhaps the new ones may support this. I'll try to do a test when I get some free time. But anyways having this option supported in the encoder and the player is a different thing, because the first one is much easier (it's just a flag set) and the latter requires image resizing.
DeXT is offline   Reply With Quote
Old 27th April 2002, 21:14   #7  |  Link
gabest
Registered User
 
gabest's Avatar
 
Join Date: Oct 2001
Posts: 1,459
Any video decoder (dshow) can set the aspect ratio on the output media type and the video renderer will make use of it automatically. Unfortunately, none of the current decoder filters are using this feature.

(see dwPictAspectRatioX/Y at http://msdn.microsoft.com/library/en...2structure.asp)
gabest is offline   Reply With Quote
Old 27th April 2002, 21:36   #8  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Fine...but my goal was to have the aspect ratio in the mp4-stream...
Chibi Jasmin is offline   Reply With Quote
Old 27th April 2002, 21:40   #9  |  Link
gabest
Registered User
 
gabest's Avatar
 
Join Date: Oct 2001
Posts: 1,459
Hehe, ok. But once it is there, it will be easy to handle.
gabest is offline   Reply With Quote
Old 27th April 2002, 21:56   #10  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Well, a tool to set the flag and an MP4-DSF and we're set.
Chibi Jasmin is offline   Reply With Quote
Old 28th April 2002, 21:40   #11  |  Link
ChristianHJW
Guest
 
Posts: n/a
Why use MP4 instead of MCF ( if ever ) ? Because of hardware support !
But : Will MP4 hardware players support aspect ratio flags ??
  Reply With Quote
Old 28th April 2002, 22:24   #12  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Who knows...
Chibi Jasmin is offline   Reply With Quote
Old 29th April 2002, 14:37   #13  |  Link
Gawen
Registered User
 
Join Date: Apr 2002
Posts: 52
For editing mp4 files try MP4Edit from ENST in france. Very nice Interface.

http://www-elec.enst.fr/~dufourd/mpeg-4/tools.html

There is also an alternative muxing prg., mp4tool, but it uses IM1 compatible scripts to compile and those are not so easy to create.

An alternative would be Apples dumpster.exe, wich is for .mov qt files, but also accepts .mp4 as .mov with some unknown tags. You dont even have to rename the files. Is shows the high similarity between .mov and .mp4. Its almost the same.

Afaik mp4 uses the same sizes as VCD, the cif size family, (for instance 352*288 PAL + the well known DVD format wich is called CCIF if i remember correctly.) Dont forget, its an MPEG organisation product, they are conservative with formats. The Apple suggested formats for streaming are 320*240 and 640*480, but not limited to.

Last edited by Gawen; 29th April 2002 at 14:44.
Gawen is offline   Reply With Quote
Old 29th April 2002, 15:24   #14  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Thanx for your hints...I never heard of these tools :-) Will take a look...but even if I should be able to set the flag, it won't get played with aspect ratio other than 1 at the moment, will it?

Apart from that, what bugged me a bit is this:

"AAC (mono 0x40 / stereo 0x41: OK this is not standard, this is just the way we use it in IM1 currently) or MPEG-4 video (IM1 format, 0xC4: again, not standard, just the way in IM1)"

taken from the above mpeg-4 tools description... I am not familiar with most aspects of the mpeg-4 specs so I prefer a tool, which at least claims to be spec-compliant (like the mpeg4ip tools), until I understand what such things mean...

Last edited by Chibi Jasmin; 29th April 2002 at 15:28.
Chibi Jasmin is offline   Reply With Quote
Old 29th April 2002, 19:23   #15  |  Link
Gawen
Registered User
 
Join Date: Apr 2002
Posts: 52
@Chibi

Hi, i wouldnt have posted, if MP4EDIT.EXE did not do what you want, please give that URL a second chance. Dont mix it up with mp4tool.exe. *g*

Happy RTFMing!

P.S.: You know, i am researching in the same area *g*, but i am only 1 or 2 steps ahaed of you. MP4EDIT gives you an easy to use flag editor, please dont ask ME about wich app uses wich flag how. Even MPEGLA is still doing interoperability tests. They dont know themselfes.

Link to dumpster:
ftp://ftp.apple.com/developer/Quickt...r/Dumpster.zip

Theres a new player in town:
http://www.mpegable.com/

Last edited by Gawen; 29th April 2002 at 19:44.
Gawen is offline   Reply With Quote
Old 29th April 2002, 21:20   #16  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Quote:
Originally posted by Gawen
@Chibi

Hi, i wouldnt have posted, if MP4EDIT.EXE did not do what you want, please give that URL a second chance. Dont mix it up with mp4tool.exe. *g*

Happy RTFMing!

P.S.: You know, i am researching in the same area *g*, but i am only 1 or 2 steps ahaed of you. MP4EDIT gives you an easy to use flag editor, please dont ask ME about wich app uses wich flag how. Even MPEGLA is still doing interoperability tests. They dont know themselfes.

Link to dumpster:
ftp://ftp.apple.com/developer/Quickt...r/Dumpster.zip

Theres a new player in town:
http://www.mpegable.com/
I will try to find something :-) Any hints appreciated...but as long as there is no player playing the files with modified aspect ratio, it's useless...maybe the mpegable one will do that? I will see, if I ever find out how to change the flag :-)

What I would still need is a muxer that can reliably mux 23.976 fps avi into mp4...mp4creator has its problems (as posted in http://forum.doom9.org/showthread.php?s=&threadid=23751 - in the meantime I also modified mp4creator V0.9.3.9 the same way) and I don't too much trust in my self-made solution (see that thread).

Will check out the mpegable players capabilities later...while we are at it, it would still be interesting to find out, which resolutions and aspect ratio are supposed to be standard in mpeg4-video...you posted some above...maybe simply the same as in dvd today can be used!? Many things to be researched...

Last edited by Chibi Jasmin; 29th April 2002 at 21:38.
Chibi Jasmin is offline   Reply With Quote
Old 29th April 2002, 22:02   #17  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
Hey ! This player seems half-way usable! My first quick tests result in...

mpegable Player V2.0 plays...

muxed with mp4creator (all 25 fps):

XVid h263: yes
XVid mpeg: yes
DivX5: yes
DivX5_b: no (choppy, seems to simply skip the b-frames)
DivX5_gmc: yes
DivX5_qpel: no (color artifacts)

muxed with DivX5Creator
DivX5 (23.976 fps): yes
XVid mpeg (23.976 fps): no (too fast)
XVid mpeg (25 fps): yes

directly written with DivX5 (all 23.976 fps):
DivX5: yes

Note that DivX5Creator muxes 23.976 fps correctly (unlike mp4creator)!

Much better than mpeg4ip player, that only plays xvid h263 and divx5 without any mpeg-tools...I personally like to see that xvid with mpeg quantizer is supported...great stuff!

The only problem with this player is it does not create overlay windows for playback so my G400-DVDMax TVOutput doesn't work

You said:

"Afaik mp4 uses the same sizes as VCD, the cif size family, (for instance 352*288 PAL + the well known DVD format wich is called CCIF if i remember correctly.) Dont forget, its an MPEG organisation product, they are conservative with formats. The Apple suggested formats for streaming are 320*240 and 640*480, but not limited to. "

Can you provide some more detailed info or some links about this? Is there some standards? Can't be too wrong simply keeping the original dvd-resolution (would it be legal to cut black borders?)...would just have to set the aspect ratio (good hope the mpegable player supports it...???)...and as I said a muxer for 23.976 fps avis....

BTW: I didn't find out how to set aspect ratio with mp4edit or some other way, can you tell me how to do it, please?

Last edited by Chibi Jasmin; 30th April 2002 at 09:33.
Chibi Jasmin is offline   Reply With Quote
Old 30th April 2002, 12:26   #18  |  Link
Gawen
Registered User
 
Join Date: Apr 2002
Posts: 52
@Chibi

And i alway thought googeling belonged to the base lessons for a researcher...

Just try a search for "mp4 aspect ratio" at google.com.

As stated in the m4if mail list archive there is a flag (atom) aspect_ratio_info in mp4, but it is the player programmers choice to use it or not. Default ratios are 12:11 and 40:33.

http://lists.m4if.org/pipermail/tech...ch/000573.html

Common Intermediate Format - CIF
A video format used in videoconferencing systems that easily supports both NTSC and PAL signals. CIF is part of the ITU H.261 videoconferencing standard. It specifies a data rate of 30 frames per second (fps), with each frame containing 288 lines and 352 pixels per line.

4CIF 704*576, comp. H.263

http://www.tele.ntnu.no/signal/cours...ge-formats.pdf

Best supported DSP Hardware Platform i found for MP4 is TMS320C62x:

http://focus.ti.com/docs/tool/list.j...DAV=Generation

Most encoders for those DSPs use CIF family sizes, so i would assume they are good for future player compatibility.


Last edited by Gawen; 30th April 2002 at 13:09.
Gawen is offline   Reply With Quote
Old 30th April 2002, 13:11   #19  |  Link
Chibi Jasmin
Registered User
 
Join Date: Oct 2001
Posts: 800
I'm sorry for not searching myself and am thankful for the info you provided...it's just been late at night, forgive me being lazy...
Chibi Jasmin is offline   Reply With Quote
Old 30th April 2002, 13:33   #20  |  Link
Gawen
Registered User
 
Join Date: Apr 2002
Posts: 52
The .mov atoms are a lot better described than .mp4, but the "mvhd" and "mask" atom values for .mp4 should imho be the same.

Load your .mp in dumpster and hack it!

* 8+ bytes movie header atom = long unsigned offset + long ASCII text string 'mvhd'
-> 4 bytes version/flags = byte hex version + 24-bit hex flags (current = 0)
-> 4 bytes created mac date = long unsigned value in seconds since beginning 1904 to 2040
-> 4 bytes modified mac date = long unsigned value in seconds since beginning 1904 to 2040
-> 4 bytes time scale = long unsigned time unit (default = 600)
-> 4 bytes duration = long unsigned time length (in time units)
-> 4 bytes decimal user playback speed = long fixed point rate (normal = 1.0)
-> 2 bytes user volume = short unsigned level (mute = 0; 100% = 255; 300% max = 767)
-> 10 bytes reserved = 5 * short values set to zero
-> 4 bytes decimal window geometry matrix value A = long fixed point width scale (normal = 1.0)
-> 4 bytes decimal window geometry matrix value B = long fixed point width rotate (normal = 0.0)
-> 4 bytes decimal window geometry matrix value U = long fixed point width angle (normal = 0.0)
-> 4 bytes decimal window geometry matrix value C = long fixed point height rotate (normal = 0.0)
-> 4 bytes decimal window geometry matrix value D = long fixed point height scale (normal = 1.0)
-> 4 bytes decimal window geometry matrix value V = long fixed point height angle (normal = 0.0)
-> 4 bytes decimal window geometry matrix value X = long fixed point positon (left = 0.0)
-> 4 bytes decimal window geometry matrix value Y = long fixed point positon (top = 0.0)
-> 4 bytes decimal window geometry matrix value W = long fixed point divider scale (normal = 1.0)
-> 8 bytes preview = long unsigned start time + long unsigned time length (in time units)
-> 4 bytes still poster = long unsigned frame time (in time units)
-> 8 bytes selection time = long unsigned start time + long unsigned time length (in time units)
-> 4 bytes current time = long unsigned frame time (in time units)
-> 4 bytes next/new track id = long integer value (single track = 2)

* 8+ bytes optional clipping (mask) atom = long unsigned offset + long ASCII text string 'clip'

http://www.geocities.com/xhelmboyx/q...qtm-layout.txt

Last edited by Gawen; 30th April 2002 at 13:36.
Gawen 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 00:43.


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