Log in

View Full Version : Cant Figure Out AR Problem


Bathrone
13th August 2005, 14:31
Gday folks

Im using VirtualDubMod 1.5.10.1 build 2349 to transcode some vob media into AC3 divx 6.0. For frameserving Im using Avisynth 2.5.6 beta 4 and DGMPGDec version 1.4.1 Beta 4.

My source media has the following AR elements : FAR 1.250, PAR 1.422 and DAR 1.778 - its a PAL 720*576 standard 25fps dvd.

For some unknown reason, I keep getting encodes with the following AR figures : FAR 1.250, PAR 1.00 and DAR 1.250.

I have triple checked every setting within dgindex, vdmod, avisynth....I just dont understand why its being changed.

I tried to fiddle with the Divx 6.0 codec config to fix it but couldnt come up with a solution.

Any help appreciated :)

Bathrone
14th August 2005, 05:04
Ok the penny has dropped. After alot of research:

"AVI's are square pixel and have no provisions for setting flags for the player to resize them"

Seems the vobs can have a non square pixel aspect ratio? And the avis cant.

Also it seems that anomorphic 16:9 means for PAL DVDs its in 720x576 4:3 and the dvd player changes the aspect ratio so it looks right?

As Im doing transcoding, I cant have an avi file with anything other than a pixel aspec ratio of 1.0?

Therefore since the par must be 1.0, my only choice is to change the frame aspect ratio by resizing the whole video to give a display aspect ratio thats 16:9 PAL DVD format. And I want to do this without messing up the video or loosing resolution.

Mmmmm more questions.....help! Im drowning here.

Free beer to any helpers :) Ok, virtually!

stephanV
14th August 2005, 11:30
Well... AVI does support non-square pixels, there are just no tools that support it. :)

If you dont want to resize there are a few things you can do:

1. use mpeg4modifier to change the PAR setting after encoding.
2. use a codec that supports AR signalling (e.g. XviD)
3. use a container where tools DO support AR signalling (Matroska with MKVMerge)

SeeMoreDigital
14th August 2005, 11:52
3. use a container where tools DO support AR signalling (Matroska with MKVMerge)Or even the .MP4 container.... But there's no reason why you can't simply stay with the AVI container!

But like you already mentioned.... which can't be mentioned enough. The most important thing is to install a codec or MPEG-4 direct-show decoder filter, that supports AR signalling detection ;)


Cheers

stephanV
14th August 2005, 11:58
But like you already mentioned.... which can't be mentioned enough. The most important thing is to install a codec or MPEG-4 direct-show decoder filter, that supports AR signalling detection ;)


*hopes Haali won't see that post* ;)

Yeah, that would help too, assuming he is using DirectShow, VLC player and mplayer should work too also.

mic
14th August 2005, 19:39
A vob has 720 x 480/576 frames, regardless pixel aspect, this is all the image data you're given to work with. During encoding to another format, this image data is read and, well basically encoded and saved to whatever format and frame is specified. It makes a lot of sense then to not make any changes to the frame size or aspect or anything until the actual process of encoding -- that gives the encoder all the original image data you have, data that hasn't been changed or altered so no quality loss.

Anamorphic widescreen is a good example... No matter what you do pixels will have to be added to the original image to create a wider frame, but you have two places you can do this -- during playback or during encoding. Why wasn't the original encoded to a wider frame? (among other reasons) Because less pixels means smaller video files. Using the same logic, encoding less to allow max bitrate makes sense. The only problem is creating that wide frame on playback -- your software (or device) has to know to do it. Hence earlier posts about file containers that can include instructions to players.

Speaking strictly of quality, there shouldn't be a penalty resizing the video to widescreen during encoding rather then later -- creating pixels out of thin air either way ;) The main disadvantages are longer encoding times, and bigger files or more compression. But if you're a stickler for accuracy, also consider the anamorphic widescreen pixel aspect issue a little closer...

A normal DVD vob frame is already distorted on your PC's monitor. It would take a long time to explain all the details, so I'll leave it at NTSC will look wider, PAL narrower then on your TV through a DVD player. A normal vob frame therefore isn't completely normal as far as your PC is concerned, but has to be both cropped & resized to be completely accurate, though not to sweat it too much as the cropping amount can be considered trivial by most of us.

Anyway, the point is that the normal vob frame isn't normal to our PCs, and if resizing to widescreen, please do not overlook this, or your new frame will be distorted also. Take a snapshot in something like PowerDVD or the original vob, and check the dimensions in a graphics program -- most player software that understands aspect will stretch the image to correct aspect differences between TV & PC.

Also, try not to get confused too much about aspect ratios... often all you need to or can deal with are frames and frame sizes, which is a practical approach anyway. :D

Realizing I'll probably catch some flak, I'll emphasise the *Too Much* in the paragraph above. :p

Bathrone
15th August 2005, 03:40
Thanks everyone. Greatly impressed with the knowledge here.

Using the mpeg4modifier utility I selected to change the par from 1.00 to 16:9 PAL and it appears to display correctly in WMP and XBMC.

However, Gspot still reports the file as having a PAR of 1.00. Strange.

SeeMoreDigital
15th August 2005, 10:25
However, Gspot still reports the file as having a PAR of 1.00. Strange.Unfortunately SteveG has not got round to adding "AR signalling" detection for MPEG-4 streams in .AVI (Or whether the MPEG-4 content is progressive or interlaced).

Sadly development for GSpot has gone a bit quite, since the the launch of v2.52 B01 (Build 040915). Which was exactly 11 months ago, to the day!

But we live in hope..... I hope he's okay!


Cheers

Bathrone
17th August 2005, 02:45
Thanks all :) It really is impressive whats been done with all these open source tools.

Im considering doing a guide for what I have learnt to give some back to the community. I didnt find a guide for doing high quality AC3 Divx V6 transcoding from DVD sources that had appropriate levels of controls within the programs used - no auto gordianknot automations. Ive learnt alot of things in figuring out how to do that and other newbies like me might appreciate a guide on it.

Lets hope GSPOT gets picked up again.

Bathrone
19th August 2005, 03:44
Hmmmm. My process has hit a new problem.

I transcoded a long personal backup into Divx v6 / AC3 @ a high video bitrate. The muxed file with the ac3 video is 2.5gig. When I went to adjust the PAR in mpeg4modifier it complained about the file being an open dml avi - I cant adjust the par using mpeg4modifier.

Q: What has made it open dml? The filesize?

Q: If it is open dml how can I change the PAR? Is it something I can hex edit or similar?

Bathrone
19th August 2005, 09:53
Ok, after alot of searching Ive found out that having an over 2gb avi makes it an OpenDML AVI container type.

Apparently splitting it into two avis less than 2gb each, changing it in mpeg4modifier and then rejoining them is the workaround. A less ugly solution hasnt turned up in the research Ive done.

mic
19th August 2005, 23:17
Apparently splitting it into two avis less than 2gb each, changing it in mpeg4modifier and then rejoining them is the workaround. A less ugly solution hasnt turned up in the research Ive done.
Does/would the helium version of divx help? http://labs.divx.com/archives/000055.html

Bathrone
20th August 2005, 05:06
Thanks Mic! :)

After a fair bit of searching and experiment : you can use the release version as well as the helium version of Divx6 command line interface with the following command:

-parout YY:XX

where

1:1 Square
12:11 (PAL for 4:3)
10:11 (NTSC for 4:3)
16:11 (PAL for 16:9)
40:33 (NTSC for 16:9)

This is recognised in wmp, xbmc, nero showtime. Divx player didnt recognise the par but it can be forced to 16:9

Im going to use this method as it saves having to split, change PAR, rejoin with mpegivmodifer when its an opendml avi container.