View Full Version : Any SIMPLE way to see mpeg2 properties?
Malow
24th August 2004, 05:34
hi, im making a automatic dvd2xvid script, but i need a software or a VERY SIMPLE way for beguiners open a mpeg2 (vob) and see if it is 4x3 or 16x9, ntsc or film, interlaced / progressive / hybrid.
this thing exist? :)
with less "clicks" possibles, nothing like dvd2avi, or other "too many clicks" softs..... :(
and sorry for the topic whit caps... :( next time i will :readrule:
killingspree
24th August 2004, 08:16
well unless you want to parse the mpeg2 file yourself - dvd2avi/dgindex might be as simple as it gets!
but perhaps, some devs know more :)
since this is more of a dev question than a newbie question, i'll move it there!!
cheers
steVe
Nic
24th August 2004, 16:02
http://nic.dnsalias.com/mpgtx.exe
download that and from a command line try:
mpgtx -i thefile.mpg
That will output some info...
It's from an opensource project, use google to find it if you want more info.
Might be useful,
-Nic
Malow
24th August 2004, 18:46
tnkx nic, but it can't show if videos is a 29.97 with pulldown? (film content)
SeeMoreDigital
24th August 2004, 18:54
The new 2.5 beta version of Gspot can show quite a bit of information now: -
http://img14.exs.cx/img14/1917/SMD_Gspot_v25Beta8.gif
Cheers
SeeMoreDigital
24th August 2004, 19:05
Jeez, the new version provides even more info and has more tools.... nice!
http://img18.exs.cx/img18/6964/SMD_GSpot_v25b8.gif
Cheers
Malow
24th August 2004, 22:02
YES! now it shows if is film content! yes! yes! tnks a lot guys!
Malow
25th August 2004, 08:31
mmm... in fact, the "3:2 detection" is not working at all... some film contents not showing it, but any other app detect it.... i will wait for new builds... :)
SeeMoreDigital
25th August 2004, 15:56
Originally posted by Malow
mmm... in fact, the "3:2 detection" is not working at all... some film contents not showing it, but any other app detect it.... i will wait for new builds... :) Yep, shame about that.. but it's fast becoming a very interesting and useful tool... Much more so than before.
I wonder if anybody knows whether its creator (Steve G), is a member of Doom9?
Cheers
Malow
26th August 2004, 07:00
i think he see my mail and a lot others... :)
26 Aug 2004
" Note: The MPEG-2 parsing for the interlace & pull-down functions have significant design flaws, causing them to display erroneous results. This is scheduled to be fixed in the next day or two"
Malow
28th August 2004, 05:53
problem solved...
¤ Rewrote the MPEG-2 parsing routines for the interlace & pull-down functions. The previous version had significant design flaws, causing it to display erroneous results.
¤ Added native recognition of H.264 video streams and an associated "indicator light". Should recognize H.264 in an AVI (e.g. VideoSoft), in an MPEG-2 Program Stream (e.g. MainConcept), or raw (e.g. ITU reference encoder)
¤ "open with" and drag 'n drop should work on Win98 again
int 21h
28th August 2004, 08:31
Obligatory reminder...
These flags aren't always correct.
Malow
28th August 2004, 23:47
i hope the "not always" be 0,1% , because i have no other way to get such video info... :)
stegre
30th August 2004, 02:01
Originally posted by SeeMoreDigital
Yep, shame about that.. but it's fast becoming a very interesting and useful tool... Much more so than before.
I wonder if anybody knows whether its creator (Steve G), is a member of Doom9?
Cheers
Thanks. Yes, I am a member (just not a frequent poster). But I did see both this thread and Malow's email. I'd be curious to hear any feedback on how the updated version is working. BTW, I just posted in another thread (http://forum.doom9.org/showthread.php?s=&postid=538583#post538583) about a "packed bitstream" feature (http://gspot.headbands.com/nvop.png) I just added, in case that's of interest to anyone here.
Steve G
SeeMoreDigital
30th August 2004, 09:52
Thanks for the 'heads-up' Steve.
I think the preview window is a great addition. As is the filter chain graph window.
Being very greedy, more MP4 container support would be very welcome. But in the meantime...
Thanks very much :)
Wilbert
30th August 2004, 14:59
@stegre,
I made a feature report:
https://sourceforge.net/tracker/index.php?func=detail&aid=1018532&group_id=22678&atid=376139
If you could display the "matrix_coefficients" and the "display_horizontal_size" (both in the sequence_display_extension) if present when requesting the file info. The matrix_coefficients are used to decode the video :)
SeeMoreDigital
30th August 2004, 17:43
Steve, I've just realised that this metadata information can also be used to identify the exact version of DivX codec used (ie: 5.0.1, 5.0.2, 5.1.0, 5.2.0 etc).
http://gspot.headbands.com/nvop.png
Some forum members have asked about such a feature in the past!
Cheers
stegre
31st August 2004, 05:52
Originally posted by Wilbert
@stegre,
If you could display the "matrix_coefficients" and the "display_horizontal_size" (both in the sequence_display_extension) if present when requesting the file info. The matrix_coefficients are used to decode the video :)
I'm just coding that up now as an experiment, maybe I'll add it. I had to go thru 3 or 4 DVD's before I found one that even includes a sequence_display_extension, though. Not sure if that's typical. I'm more curious about display_horizontal_size & its vertical counterpart than I am about the matrix coeffecients - do some DVD's actually supply the active picture area dimensions (picture size less encoded letterboxing)? So you could determine the "theatrical" AR?
SeeMoreDigital
31st August 2004, 08:31
Originally posted by stegre
I'm more curious about display_horizontal_size & its vertical counterpart than I am about the matrix coeffecients - do some DVD's actually supply the active picture area dimensions (picture size less encoded letterboxing)? So you could determine the "theatrical" AR? If I understand what you mean correctly, I don't think so. As far as I know there is only DAR signalling information. All DVD images are encoded using 720x480 (NTSC) or 720x576 (PAL) pixel frames sizes, regardless of whether the "theatrical" AR contains mattes or not. And the positions of these mattes are very often not a 100% accurate representation of the AR stated on the DVD's back cover.
But maybe LIGHTNING UK could tell us more. You never know he might well have found some weird code lurking in a DVD's structure!
Mind you, I'm yet to see a DVD that can display on-screen 'chapter title naming' either. And by all accounts this should be possible!
Cheers
Wilbert
31st August 2004, 12:22
I'm just coding that up now as an experiment, maybe I'll add it. I had to go thru 3 or 4 DVD's before I found one that even includes a sequence_display_extension, though. Not sure if that's typical.
Some quotes (from fcchandler) from this thread:
http://forum.doom9.org/showthread.php?s=&threadid=81191
"For whatever reason, mixUVc.m2v doesn't contain a "sequence display extension" (like mix2.mpg had). In the absence of this extension, the specs say we are supposed to use the default MPEG-2 coefficients (0.2125, 0.7154, 0.0721)."
TMPGEnc (and QuEnc) uses the fcc standard:
"In that one, matrix coefficients = 4 (the FCC standard). But this is so close to (0.299, 0.587, 0.114) that you probably won't see a difference with your eyes."
DivX/XviD use MPEG-1 coefficients.
btw, some example files can be found in the link above.
do some DVD's actually supply the active picture area dimensions (picture size less encoded letterboxing)? So you could determine the "theatrical" AR?
That's also something I would like to know :)
stegre
31st August 2004, 13:11
Well. forgetting anamorphic for a sec, say I had a movie with a theatrical AR of 1.666. So a typical NTSC DVD would encode that as 720 x 480 pixels with 10:11 pixel aspect for a result that's playable on a 4:3 display device, all of which I can find out from fields I already know about. But, if I'm calculating correctly (and if I'm understanding correctly), the top 48 and bottom 48 lines would be encoded as black so I could view the 1.666 movie letterboxed on my 4:3 screen. I was hoping there was some way, short of decoding the video and attempting to detect black, that it could tell me that those 96 scan lines were thrown out.
I don't have it in front of me, but the MPEG spec's description of display_horizontal_size & display_vertical_size sounded like it might do that...
SeeMoreDigital
31st August 2004, 13:46
With your 1.666 (15:9) calculation I presume you are basing that the Mpeg2 stream has a 4:3 DAR?
Obviously with other AR's the vertical pixel count would increase if the DAR was 16:9.
I can only think that some kind of auto cropping tool might work. Nero's Recode2 is quite accurate at auto cropping 4:3 and 16:9 DAR streams. It even displays the correct pixel count of the cropped image!
Some years ago I generated a list of pixel frame size calculations (http://www.SeeMoreDigital.net/03_Video_Only_Info/Pixel_Frame_Size_Totals.html). I hope you can make sense of it :confused:
Cheers
stegre
31st August 2004, 14:26
Yes, the example was for a 4:3 DAR.
Wilbert - I'll look at that thread and check into all this further when I get home tonight.
stegre
7th September 2004, 04:08
Originally posted by Wilbert
Originally posted by stegre
I'm more curious about display_horizontal_size & its vertical counterpart than I am about the matrix coefficients - do some DVD's actually supply the active picture area dimensions (picture size less encoded letterboxing)? So you could determine the "theatrical" AR? That's also something I would like to know :)
Looks like the answer is YES. That is, if you want to find the "theatrical aspect ratio of the FBI warning"...
Seriously, the answer appears to be yes, though it's apparently not widely supported. Of the small sample of the DVD's I checked, only around 50% had a sequence_display_extension (SDE) to begin with. Of those, not a single one had values other than 720 x 480 (NTSC) for the feature film, despite having encoded black matting which would seem to have warrrented other values there. My samples did include both anamorphic and non-anamorphic encodes.
But now for the good news: It's apparently at least being used for framing menus and other ancillary stuff (hence my "FBI warning" joke). In the case of Finding Nemo, though - the "2 disk collector's edition" - many of the "extra feature" videos happen to use a square (1:1) aspect ratio - for whatever reason - for the full duration of the presentation. And they DO properly support it with SDE values. In fact, since the main feature on this DVD is exactly 16:9, and therefore should say 720 x 480 as the "active" area, one could say that this particular DVD supports these SDE values 100%. It would be interesting if it turns out manufacturer's support for this is on the increase. For one thing, it would permit the design of home theatre systems with servo-controlled doors, or curtains, to cover unused parts of the screen, as do curtains in a real theatre. But I digress, as they say...
Here's a screenshot of GSpot 2.52 beta 1 (http://gspot.headbands.com/gsss.png), which I'll release later this week, with "SDE" support for displaying the matrix coefficients and h/v size information we're discussing. And here is a screenshot of one of the Finding Nemo extra features (http://gspot.headbands.com/shss.png). As you can see, it’s encoded non-anamorphically for display on a 4:3 screen, with black matting on either side to achieve the "theatrical" 1:1 AR (after PAR adjustment). And the SDE values indicate the precise borders of betwee the active and black matted areas.
SeeMoreDigital
7th September 2004, 09:45
Originally posted by stegre
...here is a screenshot of one of the Finding Nemo extra features[/url]. As you can see, it’s encoded non-anamorphically for display on a 4:3 screen, with black matting on either side to achieve the "theatrical" 1:1 AR (after PAR adjustment). And the SDE values indicate the precise borders of betwee the active and black matted areas. Hi Steve,
With you Finding Nemo sample, something doesn't feel right to me. Are trying to say that if you captured a still image from that part of the disc it would look like this before DAR correction: -
http://img73.exs.cx/img73/7954/SMD_Gspot_before.jpg
But after DAR correction and when viewed on an 16:9 TV it looks like this: -
http://img43.exs.cx/img43/4362/SMD_Gspot_after.jpg
Or after DAR correction and when viewed on an 4:3 TV it looks like this: -
http://img85.exs.cx/img85/8654/SMD_Gspot_after_43b.jpg
or even this: -
http://img45.exs.cx/img45/184/SMD_Gspot_after_43.jpg
But in any case, such ways of distributing video must be rare and surely only confined to the extras.
On an personal note I regularly capture 4:3 Mpeg2 DVB-S material in the way (I think your) describing, for playback on my 16:9 TV. I do it like this so I don't have to fiddle about with TV's aspect ratio correction settings during playback... but it's not really the normal thing to do!
Anyway, the prospect of what you are suggesting is an very interesting one indeed. Have you only tested NTSC DVD's... Is there no hop for us PAL disc users?
---------------------------------------------------------------------
PS: Gspot v2.52 B02 observations with AVI-mux 1.16.8 (using default AVI-mux settings).
* After muxing XviD Mpeg4 and AC3 into AVI, Gspot is not able to reveal the kbps speed of the file!
* After muxing XviD Mpeg4 and MP3 into AVI, Gspot reveals a totally incorrect kbps speed of the file!
* After muxing XviD Mpeg4, Mp3 and AC3 into AVI, Gspot crashes
I apologise if the above has already been reported
---------------------------------------------------------------------
Cheers
Wilbert
7th September 2004, 12:02
Here's a screenshot of GSpot 2.52 beta 1, which I'll release later this week, with "SDE" support for displaying the matrix coefficients and h/v size information we're discussing.
Looks great! I can't wait to test this :)
stegre
7th September 2004, 13:47
I'll post more later but SMD, the third pic above (the second one you made, "4:3") is exactly right; after correction for square pixels, it'd be a 480x480 square horiz centered in a 640x480 (4:3) frame, with black padding on either side. Which is to say that on a DVD player, the appearence would be identical to the that third pic as we see it now on the PC.
edit:
It has nothing to do with sequence display extension, but the example is confusing for a number of reasons:
1. Viewable target is more square than a 4:3 screen; usually it's more rectangular.
2. NTSC / non-anamorphic DVD pixels are "portrait shaped" (PAR < 1), for other combinations they are "landscape". So correction for display on PC involves horizontal squeeze, not stretch as in other situations.
3. To get the numbers we're discussing, you'd use the PAR of 0.8888, not the "BT-601" value of .9090 (10:11) shown. In particular, 540 x 0.88888 = 480. (I'm thinking of changing GSpot to display that value, but that's a separate subject)
Now, while I think all the above is correct, I'm still not sure about the mysterious sequence display extension values in question: something I saw recently implied it's a value to "stretch from", not a value to "crop to". That would be entirely different. I'll be posting more info when I find out.
SeeMoreDigital
7th September 2004, 16:24
Originally posted by stegre
I'll post more later but SMD, the third pic above (the second one you made, "4:3") is exactly right; after correction for square pixels, it'd be a 480x480 square horiz centered in a 640x480 (4:3) frame, with black padding on either side. Which is to say that on a DVD player, the appearence would be identical to the that third pic as we see it now on the PC. Jeez that's weird!
I have to ask myself why would anybody want to create and display an image such as this for viewing on an 4:3 display. On an 16:9 display yes... absolutely!
Anyway, just to confuse things more. It does not matter whether the DVD has a DAR of 4:3 or 16:9. They all contain either 720x480 or 720x576 pixels, so by definition, contain some form of anamorphic image...
On a different note. As far as I am aware, there has never been an commercially encoded DVD submitted for general release that contains an image using square pixels. Even though (for you NTSC users) it's perfectly possible to create square pixelled encodes for both 4:3 or 16:9 images. Without exceeding the current 414,720 pixel limit set by the chip-set manufacturers.
Cheers
stephanV
7th September 2004, 16:39
Originally posted by SeeMoreDigital
Anyway, just to confuse things more. It does not matter whether the DVD has a DAR of 4:3 or 16:9. They all contain either 720x480 or 720x576 pixels, so by definition, contain some form of anamorphic image...
No its not... 4:3 720x480 or 720x576 is not anamorphic. You are calculating AR from the resolution then, which is fundamentally wrong as they are not related to each other, not in that way. Because our computer displays neither conform with standard PAL or NTSC TVs, they "look" distorted, but what you actually are seeing is an effect of the wrong format on the wrong display.
SeeMoreDigital
7th September 2004, 17:51
Originally posted by stephanV
No its not... 4:3 720x480 or 720x576 is not anamorphic. You are calculating AR from the resolution then, which is fundamentally wrong as they are not related to each other, not in that way. Because our computer displays neither conform with standard PAL or NTSC TVs, they "look" distorted, but what you actually are seeing is an effect of the wrong format on the wrong display. We've had this discussion before Stephen. Sufficed to say we both have different points of view of what's considered to be, anamorphic. Mine happens to be, any image that requires some form of correction (ie: DAR or PAR) to make the image look normal.
It would not be fair to bog this thread down with our own points of view (or the points of view of others).
Given that the original purpose of this thread has been answered and has now moved onto discussing SteveG's excellent Gspot. Maybe this thread should be split?
Cheers
stegre
8th September 2004, 03:34
Well, not to be the mediator, but I think one could make the argument that either of you could be considered correct. From the original book definition of anamorphic, which is something about having "differing characteristics along mutually perpendicular radii", one could argue that anything but 1:1 pixel aspect ratio is anamorphic. On the other hand, in the world of DVD it clearly refers only to the 16:9 DVD's and never to the 4:3 ones, and that could be further justified my thinking of the standard 3:2 as "normal" and the 16:9 as "anamorphic to that" since one axis is additionally squashed.
But back to sequence_display_extension. I've confirmed, by both the behavior of my home DVD player and by the ISO MPEG-2 specification, that the very last thing I suggested is actually the case: the two SDE values in question,"display_horizontal_size" and "display vertical size", do indeed represent the "active part" of the frame. But we're supposed to "resize from" that, not "crop to" it. This is gonna confuse things, but the fact of the matter is that those values, when present and not equal to the frame size (normally 720 x 480 NTSC or 720 x 576 PAL), will change the pixel aspect ratio. In fact, the MPEG-2 specification defines the pixel aspect ratio (which they confusingly call "SAR") in terms of it. Here, I'll summarize the whole deal:
1. MPEG defines four possible aspect ratios for the physical display screen, as measured in inches or cm (not pixels). That's called "DAR", and the four possibilities are 4:3, 16:9, 2.21:1 and "variable” - which I won't get into, because of #2 below.
2. The DVD spec does not allow the last two possibilities above, so all DVD's have a DAR of 4:3 or 16:9.
3. Ignoring a few other oddball possibilities, all DVD's are encoded as MPEG-2, 720 x 480 encoded pixels (NTSC) or 720 x 576 pixels (PAL). That's called the frame size and their ratio is called FAR, so the FAR of DVD's is pretty much always 1.5 (NTSC) or 1.25 (PAL).
4. The MPEG-2 spec defines something they call "sample aspect ratio" or "SAR" and most other people call "pixel aspect ratio" or PAR. If the SDE values are not present, the PAR is defined, after flipping fractions to correspond to common usage and changing the word "SAR" to "PAR", as follows:
PAR = DAR/FAR
So there are really only four PAR values in common usage:
(4/3) / (720/480) = 0.8888 NTSC std
(16/9) / (720/480) = 1.1852 NTSC "anamorphic"
(4/3) / (720/576) = 1.0666 PAL std
(16/9) / (720/576) = 1.4222 PAL "anamorphic"
5: Here's where it gets interesting: If the SDE values are present, their ratio replaces "FAR" in the above equation. In other words, the numbers in the SDE replace the 720 & 480 (or 720 & 576 for PAL) in the four calculations above. You now have an infinite number of possible SAR's. However, it is interesting to note that the correct information for my Finding Nemo extra feature is:
4/3 x 480/540 = 1.1852
So they're using the same SAR that's usually used in a 16:9 anamorphic DVD, but using it to horizontally "stretch" the 480 active, non-black pixels to perfectly fit on a 3:2 screen.
Now, argue whether that should be called "anamorphic"! :p
_______________________________
ref: ISO/IEC 13818-2 sec 6.3.3
SeeMoreDigital
8th September 2004, 10:55
Originally posted by stegre
...one could argue that anything but 1:1 pixel aspect ratio is anamorphic. On the other hand, in the world of DVD it clearly refers only to the 16:9 DVD's and never to the 4:3 ones, and that could be further justified my thinking of the standard 3:2 as "normal" and the 16:9 as "anamorphic to that" since one axis is additionally squashed.And there's the rub stegre.
There were a lot of us who working on DVD during it's very early stages who did not like the terminology's being offered and used for DVD. I for one could not stand the terms "standard" and "fullscreen" to describe an 4:3 (1.33:1) TV display.... to me it was totally misleading and lacked foresight, especially as some of us had enough imagination to see (even back in the late 80's - early 90's) that a 16:9 TV would at some time become, the new "standard" ;)
Originally posted by stegre
So there are really only four PAR values in common usage:
(4/3) / (720/480) = 0.8888 NTSC std
(16/9) / (720/480) = 1.1852 NTSC "anamorphic"
(4/3) / (720/576) = 1.0666 PAL std
(16/9) / (720/576) = 1.4222 PAL "anamorphic"These are the figures I use for calculating PAR from MPEG2 DVD and DVB sources... so I love you to death for posting the above. But the guys who keep quoting ITU regulations may not be so accepting ;)
Originally posted by stegre
So they're using the same SAR that's usually used in a 16:9 anamorphic DVD, but using it to horizontally "stretch" the 480 active, non-black pixels to perfectly fit on a 3:2 screen.
Now, argue whether that should be called "anamorphic"! They probably cocked up!
This kinda thing happens from time to time. I've got a Star Wars DVD where some bits in the extras are 4:3 DAR coded but are actually 16:9. And another were the audio is reported as being 2Ch but in reality it's 6Ch.
Sadly I can understand why this type of confusion is common on NTSC DVD titles because you guys are still able to buy an 4:3 (aka: Std) version and 16:9 (aka: anamorphic) version of the same movie, either as separate releases or as flippers.
It's most probable that some nerd somewhere has not thought that some bits of the extras were 16:9 and may require re-working to 4:3. So you get weird things like you observed.
For me, if I'm not sure of the DAR of a particular section of the disc I take a 'still image' (without any form of DAR/PAR correction) and work it out the old fashioned way!
Cheers
stegre
9th September 2004, 06:02
Well, the guys over at Pixar are pretty tech savvy when it comes to video, one would assume, so I'd bet against it being a mistake. Anyway, the end of the Nemo saga follows, but first I should mention that I discovered that BSPlayer has a "respect the MPEG sequence extension" checkbox (off by default, btw) but when it is checked it behaves as it should. So I made these two screenshots (http://gspot.headbands.com/bsplayer.html) which show how the SDE changes the PAR, and how that Nemo DVD feature is supposed to look.
BTW, unrelated to all this, I made the corrections to GSpot so the AVIMux "multi-riff" format, which is now the default, won't confuse the bitrate calculation anymore. That fix will be included in this same GSpot update if I ever get around to posting it. Thx for the report.
SeeMoreDigital
9th September 2004, 09:28
Originally posted by stegre
Well, the guys over at Pixar are pretty tech savvy when it comes to video, one would assume, so I'd bet against it being a mistake. You could say the same for the guys over at THX... but mistakes have been made.
I'm actually very pissed off that the movie industry saw fit to create a market for all these "cropped-to-4:3" DVD's. One of DVD's strengths is its ability to output to different screen sizes, including pan and scan... but sadly such options are under used and poorly marketed.
The people who continue to buy all these "standard" disc's for their 4:3 TV's are in for a shock, should they ever decide to upgrade to an 16:9 TV (genuine 4:3 material and disc's excepted).
Originally posted by stegre
BTW, unrelated to all this, I made the corrections to GSpot so the AVIMux "multi-riff" format, which is now the default, won't confuse the bitrate calculation anymore. That fix will be included in this same GSpot update if I ever get around to posting it. Thx for the report. Thanks Steve,
I've been meaning to email you about this for a few months. I'm surprised others have not mentioned it.
I shall make an effort to be more proactive in this regard. But starting an "Official GSpot (beta) test" thread, within the General Discussion section of the forum might be a great help for everyone.
And please don't forget to create an link to your homepage under your profile options... this forum needs you!
Cheers
stegre
14th September 2004, 03:23
It's now posted: GSpot v2.52 ß01 (http://gspot.headbands.com/gspot252dl.html)
SeeMoreDigital
14th September 2004, 08:55
Originally posted by stegre
It's now posted: GSpot v2.52 ß01 (http://gspot.headbands.com/gspot252dl.html) Sorry Steve,
I could not stop myself... I created a new thread for you here: -
http://forum.doom9.org/showthread.php?s=&threadid=82313
I think some of the forums "moderators charm" has rubbed off on me!
I like the revised GUI set out...
Cheers
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.