Log in

View Full Version : AR problem with 1440x1080 video


St Devious
21st June 2009, 23:53
I shot this movie with a HD camera. Here are the specs of the original video


Video
ID : 2064 (0x810)
Menu ID : 100 (0x64)
Format : MPEG Video
Format version : Version 2
Format profile : Main@High-1440
Format settings, Matrix : Default
Duration : 11mn 11s
Bit rate mode : Constant
Bit rate : 24.7 Mbps
Nominal bit rate : 25.0 Mbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 16/9
Frame rate : 29.970 fps
Standard : Component
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.530

Here is the stats of output file
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 11mn 11s
Bit rate mode : Variable
Bit rate : 6 000 Kbps
Maximum bit rate : 8 727 Kbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 17.982 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.215
Stream size : 481 MiB (100%)
Writing library : x264 core 67 r1169M ab85c9b
Encoding settings : cabac=1 / ref=5 /
deblock=1:-2:-2 / analyse=0x3:0x133 / me=umh / subme=6 /
psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 /
trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 /
chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 /
mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 /
direct=3 / wpredb=1 / keyint=250 / keyint_min=25 /
scenecut=40 / rc=2pass / bitrate=6000 / ratetol=1.0 /
qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0
/ qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Encoded date : UTC 2009-06-20 22:17:42
Tagged date : UTC 2009-06-20 22:49:45


The problem is that AR is changed from input 16:9 to output 4:3

How do I correct this ?

poisondeathray
22nd June 2009, 15:42
You can use the AR flag in mkvtoolnix for .mkv , set it to 16/9 just like it was in the original HDV source

St Devious
22nd June 2009, 19:21
You can use the AR flag in mkvtoolnix for .mkv , set it to 16/9 just like it was in the original HDV source

what about if I'm putting it in mp4 ?

poisondeathray
22nd June 2009, 19:32
what about if I'm putting it in mp4 ?

Then use mp4box (yamb is the gui) for the pixel aspect ratio

Not all players will display properly accept this type of signalling. e.g. If this is for flash or streaming you should resize and use 1:1 pixels

St Devious
22nd June 2009, 21:22
Then use mp4box (yamb is the gui) for the pixel aspect ratio

I don't see anything to do this in Yamb

Not all players will display properly accept this type of signalling. e.g. If this is for flash or streaming you should resize and use 1:1 pixels[/QUOTE]

Don't know what you mean here

poisondeathray
22nd June 2009, 21:33
Highlight the video track, hit properties, under pixel aspect ratio you will see a drop down menu for 16:9, 4:3 etc...

When I say not all players will accept container signalling, I mean it's not universally compatible (most PC software players will display correctly). The only 100% compatible method is to use 1:1 pixels e.g. 1920x1080 or 1280x720. Your HDV 1440x1080 is anamorphic and gets "stretched" on playback to display as 1920x1080. i.e the pixels are not 1:1 in your HDV, they are not square pixels. If this still doesn't make sense, I suggest you read up on "anamorphic"

Another option instead of container signalling is to use --sar in x264 to signal directly in the stream (that won't help you with an already encoded file)

St Devious
22nd June 2009, 21:44
Highlight the video track, hit properties, under pixel aspect ratio you will see a drop down menu for 16:9, 4:3 etc...



got it .

i set it to 16/9 NTSC in YAMB. But its not the same AR when i manually force 16/9 in MPC-HC. MPC-HC looks to be the correct 16/9 AR. While the one I set in Yamb is a little taller.

poisondeathray
22nd June 2009, 21:48
IIRC in yamb, I think it might be the SAR value that should be used (the same as the one you would use for x264)

16/9 = 1440/1080 * x/y

Display Aspect Ratio = Frame Aspect Ratio * Pixel Aspect Ratio(called sample aspect ratio in x264 terminology)

so solve for x/y and enter the custom value

St Devious
22nd June 2009, 21:51
IIRC in yamb, I think it might be the SAR value that should be used (the same as the one you would use for x264)

16/9 = 1440/1080 * x/y

Display Aspect Ratio = Frame Aspect Ratio * Pixel Aspect Ratio(called sample aspect ratio in x264 terminology)

so solve for x/y and enter the custom value

x/y ends up to be 4:3, which is not what i want.

i set the AR to 16/9 PAL in Yamb, and now the picture is a little shorter vertical than 16/9 MPC-HC.

poisondeathray
22nd June 2009, 22:00
4/3 is the pixel aspect ratio in YAMB, not the Display Aspect Ratio. Try it (enter custom value 4:3). It works (I just confirmed on an HDV source, encoded using x264 to .mp4)

poisondeathray
22nd June 2009, 22:05
As an aside, there is some weirdness to your encoded frame rate too....17.982 fps?

What was your avs script?

St Devious
22nd June 2009, 22:17
As an aside, there is some weirdness to your encoded frame rate too....17.982 fps?

What was your avs script?

DirectShowSource("F:\Video.m2t", fps=29.970, audio=true, convertfps=true)
TDecimate(cycleR=2)
#crop
#resize
#denoise

ya just noticed it. probably due to convertfps. but that's what megui gave me after analyzing the video for type of interlacing.

poisondeathray
22nd June 2009, 22:27
Definitely. This is one reason you shouldn't blindly use autogenerated scripts. What is your target for playback (PC? Flash? Device?)

From a HDV source, you probably want to deinterlace; and you will get more consistent results using DGIndex for MPEG2 sources, instead of DirectShowSource()

Did you get the .mp4 aspect ratio sorted out?

St Devious
22nd June 2009, 22:30
Definitely. This is one reason you shouldn't blindly use autogenerated scripts. What is your target for playback (PC? Flash? Device?)

PC mostly

From a HDV source, you probably want to deinterlace; and you will get more consistent results using DGIndex for MPEG2 sources, instead of DirectShowSource()

Do you mean make a D2v with DGindex and import that into avisynth script creator ?


Did you get the .mp4 aspect ratio sorted out?

I'm gonna encode again and get the FPS issue sorted out first.

poisondeathray
22nd June 2009, 22:35
Do you mean make a D2v with DGindex and import that into avisynth script creator ?


I'm gonna encode again and get the FPS issue sorted out first.


Yes, make a .d2v with DGIndex. I'm not sure if the script creator is a good idea , as the autogenerate script might produce more errors. It's a good starting place to learn about scripts, but you should definitely try to learn what is going on in the script and start to do your own. Since this is for PC playback, you probably want to deinterlace

Since you are starting over, the option of encoding using --sar 4:3 is now open to you (encoding into the stream, instead of using container signalling in .mp4 or .mkv)

St Devious
22nd June 2009, 22:38
Since you are starting over, the option of encoding using --sar 4:3 is now open to you (encoding into the stream, instead of using container signalling in .mp4 or .mkv)

i never knew about setting the AR in the encoder. I haven't seen this option in megui x264 settings GUI.

So i just add this option in the commandline in the gui and the O/P will be 16:9 AR ?

poisondeathray
22nd June 2009, 22:43
i never knew about setting the AR in the encoder. I haven't seen this option in megui x264 settings GUI.

So i just add this option in the commandline in the gui and the O/P will be 16:9 AR ?

http://mewiki.project357.com/wiki/X264_Settings#sar

If you are using MeGUI, you can enter a custom command line option, so you would enter "--sar 4:3" in the box (without the quotes)

The 4:3 is derived from the formula above, and can be thought of the shape of the pixels (width:height). It's called "sample aspect ratio" in x264 terminology, but can be called pixel aspect ratio (because it's can be thought of the ratio of w:h of pixels). Obviously the value would change for different sources, but it would be 4:3 for your uncropped HDV sources.