News:

--

Main Menu

XviD aspect bugs ?

Started by kapetr, January 19, 2015, 12:00:17 PM

Previous topic - Next topic

kapetr

Hello.

source: m2ts 720x576 =>
PAR 64:45 for 16:9 DAR
PAR 16:15 for 4:3 DAR

output: XviD *.mp4 container

1. the "name"  in dialog is "Pixel aspect ratio" (PAR) = e.g. 16:9(PAL) is wrong
It is not PAR. It is DAR!

2. it is encoded wrong -
e.g. if I select "16:9(PAL)" then the target should by scaled by player to 1024x576 (DAR 16:9) from 720x576 (64:45 PAR). But ...


- If I use mplayer:
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 1048x576 Planar YV12

- If I use avplay:
Stream #0.0(und): Video: mpeg4 (Advanced Simple Profile), yuv420p, 720x576 [PAR 16:11 DAR 20:11], 798 kb/s, 25 fps

The dialog should by corrected in x264 way
- to select/define PAR of source (source after resize filter applied) or
- to select target DAR (whatever PAR of (resized)source is)

Thanks.

P.S.: by 4:3 DAR source it is the same problem:
- mplayer:
Movie-Aspect is 1.36:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 786x576 Planar YV12
-avplay:
Stream #0.0(und): Video: mpeg4 (Advanced Simple Profile), yuv420p, 720x576 [PAR 12:11 DAR 15:11]

AQUAR

I think You are not interpreting the aspect ratio in the Xvid configuration dialog correctly.
I don't have time to explain, but search in this forum and you will find the answers.

Hopefully someone else will explain!

kapetr

#2
Thanks - bud I thing I know quite a lot over aspect ratio.

And: 16:9 is 100% not PAR - as dialog says.

And: so or so - the result is wrong any ways. 1048x576 from 720x576 is definitely bad.


poutnik

I see no way but agree with kapetr.

I may be wrong, but...

PAL widescreen has

64:45 PAR - Pixel Aspect Ratio - geometry of pixel
16:9 DAR - Display Aspect Ratio - geometry of screen
720:576 = 5:4 SAR - Sample Aspect Ratio - geometry of pixel set

DAR = SAR * PAR = 5:4 * 64:45 = 320:180=16:9

PAL standardcreen has

16:15 PAR - Pixel Aspect Ratio - geometry of pixel
4:3 DAR - Display Aspect Ratio - geometry of screen
720/576 SAR - Sample Aspect Ratio - geometry of pixel set

DAR = SAR * PAR = 5:4 * 16:15 = 80:60=4:3

kapetr

#4
Exactly! THX <poutnik>. (Díky za podporu).

Interesting Note:

Mediainfo shows what expected - e.g. for 4:3 target DAR (by selecting "4:3(PAL)" in XviD setting):

Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate                              : 25.000 fps
Standard                                : PAL


But by playing it with e.g. mplayer ends with wrong result:

Movie-Aspect is 1.36:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 786x576 Planar YV12


I do not see deep enough about saving aspect ratio info in container and/or video stream itself packed in it.
But all of this points to a problem in XviD (in way it's called by Avidemux).

poutnik

Note that some PAL TS sources have SAR 704:576 instead of 720:576 .
For such cases is for DAR 16:9 resp 4:3    PAR = 16:11 resp 12:11.
https://en.wikipedia.org/wiki/Pixel_aspect_ratio#Pixel_aspect_ratios_of_common_video_formats

Also, while for digital purposes is DAR 16:9, resp 4:3,
according to some standard specifications are DAR values slightly different.., like those 1.36....

Also, sometime there is confusion in terminology, as PAR is somewhere taken as Pixel Aspect Ratio, somewhere as Picture Aspect Ratio.


kapetr

#6
I think you found the origin of this bug in avidemux. Great !

Avidemux use older digital PAL resolution 704x576 and do not check the real SAR (which is today mostly 720x576 for PAL DVB-T/S). This causes the issue. (Maybe older codec => inherited old code.)

=> avidemux should do what I wrote:
Quote
The dialog should by corrected in x264 way
- to select/define PAR of source (source after resize filter applied) or
- to select target DAR (whatever PAR of (resized)source is)

Hopefully the developers monitor this forum to remove this bug.
(Or how/where fill Bug Report ?)

Thanks again <poutnik>  ;)

poutnik

Quote from: kapetr on January 19, 2015, 05:57:06 PM
Avidemux use older digital PAL resolution 704x576 and do not check the real SAR (which is today mostly 720x576 for PAL DVB-T/S). This causes the issue. (Maybe older codec => inherited old code.)

Hm, checking few todays recordings from our national DVB-T providers ( CT2, Prima ZOOM, at least 95% of my data ), I can find both 704 and 720....



kapetr

Yes - specially LOW-bitrate stations use lower resolutions. I have seen 352x576 res. too (TV Fonka ? - not sure now).
Hard-encoded pop-down list for only 704x576 or 640x480(?) sources in XviD settings is really bad Idea  :-\

AQUAR

#9
I am assuming we are talking about the Xvid configuration dialog.
That dialog does not say PAR at all, it just references screen types by way of aspect ratios.

Use it accordingly to re-define the DAR, to match the source video PAR and SAR (Stored Aspect Ratio) to digital screen types.
And of course it does not cover all cases (but presumes you understand what is covered).

Your experiences are perfectly understandable but they are not ADM issues.
The  Xvid with ADM 2.6 is only there by request (I know as I made that request!), and IMHO is only intended as usefull for transcoding from AVC.
Else, and with more control over Xvid configurations wrt to aspect ratios, go back to ADM 2.5.

Rather than yet another repeat explanation, a simple example will demonstrate:
Say you have a PAL anamorphic video (DVD) and want to recode using Xvid to give the correct DAR on your PC monitor.
The PAR of a PAL wide screen is 65:45 (the accepted median value for these virtual pixels).
To display the SAR with the correct DAR on a PC monitor you need to "recalculate" with a defined PAR of 65:45
(as opposed to nothing if you use an analog TV, because it already has a virtual PAR of 65:45).

That gives you 45/65 (horizontal compression in the SAR) * 65/45 (PAR definition) = 1:1 (PC monitor)

So select PAL(16:9) in the dialog - as that is the intended display for that source material (ie not a bug in sight!).

Furthermore, altering the PAR here is at the meta data level, and has nothing to do with resampling to various SAR's as quoted above.
Also using this approach may give inconsistent results, depending on preferential treatment in reading PAR meta data, by modern AVC capable media players.

If you want to maintain the opinion that this is an Xvid aspect bug, then this becomes another case of "back on that old road again".
I'll just bow out and happily continue to use ADM as intended.
 

Jan Gruuthuse

PAL (16:9) was intended mainly for DVD.
QuoteLoRd_MuldeR on PARBTW: PAR means "Pixel Aspect Ratio", not "Display Aspect Ratio" (DAR). But you can calculate "DAR = (width / height) * PAR" easily ;)

(The good thing about working with PAR instead of DAR is that the PAR doesn't change when you crop the video)

Tip: before you play video, mark [V] Play filtered: to check your video (preview)
found at bottom, left from volume slider

AQUAR

Haven't tried that on the current ADM (I should DL and install the latest!).
Does preview now work with PAR meta data?

Jan Gruuthuse

Only 11 jan 2015 is available in win64, that option should be present. , 17 jan 2015 not yet. Guess mean forgot to fire up the build bot ;)
I don't use PAR, DAR, SAR: not all hardware players look at those parameters: some samsung devices are very bad at playing videos correctly.
Stuff played correctly in VLC, appears wrong. Only happens with 576i 16:9. These need re-sizing & re-encoding to show correctly. Lucky SD recordings have dropped here, most recording is now done in HD (720p or 1080i) those issues are not present in these formats.


AQUAR

@ Jan,
So true, and why I keep saying that setting meta data to define aspect ratios may not work out as expected across different media players.
It used to be fine in the days when transcoding Mpeg2 to Xvid was popular.

I am assuming the OP is transcoding Mpeg2 to Xvid and couldn't reconcile the intention of that configuration dialog (so it must be a bug!).
Question is why use ADM 2.6 instead of the better featured ADM 2.5 for this purpose?
Isn't that advice already totally abundant throughout this forum!

 

Jan Gruuthuse

I try to process everything in avidemux 2.6.8. On some very rare occasions 2.6.8 does not handle some older videos. Then I use 2.5.6.
Problematic video errors, if important I try re-muxing with mkvtoolnix or avconf.
If it is very important, I would try re-encode with handbrake: if no preview is shown here -> trash can.
End of story