Log in

View Full Version : Help Me With PAL to NTSC AR Woes


Chumbo
3rd March 2013, 02:41
I have a couple PAL mpeg-2 files that I'm converting to AVC. The source is 16:9 720x576 and am re-encoding to 16:9 720x480. Where I'm getting in trouble is with SAR/PAR in x264. I also have one PAL 4:3 720x576 video.

My head is spinning from all the info on this and nothing seems to work unless I encode at 1:1 using a resolution like 853x480 for the 16:9 videos.

I even used smok3's resize calculator (http://resizecalc.sourceforge.net/) which calculated an SAR of 237:200 and still the output video does not display correctly and mediainfo still shows a 3:2 DAR.

I had similar problems with the one 4:3 PAL video. I wound up converting it from 720x576 to 720x540 at 1:1 SAR. I've also read that it's not a good idea to use this resolution.

This is driving me nuts, so any help is appreciated on what SAR/PAR values I need to use for:
- PAL 720x576 4:3 to NTSC 720x480 4:3
- PAL 720x576 16:9 to NTSC 720x480 16:9

Blue_MiSfit
3rd March 2013, 03:27
You're making it harder than it is :)

Just use 32:27 for 16x9 NTSC and 8:9 for 4x3 NTSC, as you would for native NTSC material. The display ratios are the same.

I'm about 90% sure of this, so maybe someone else will chime in and tell me I'm crazy - but this definitely seems to work in practice.

Sharc
3rd March 2013, 14:00
You're making it harder than it is :)

Just use 32:27 for 16x9 NTSC and 8:9 for 4x3 NTSC, as you would for native NTSC material. The display ratios are the same.

Agree.
Frame rate conversion from PAL to NTSC is probably going to be the more difficult exercise.

Chumbo
3rd March 2013, 16:52
Thanks a lot guys. Yeah, I was thinking the same thing, i.e., it's got to be simpler than I thought. The problem is, unless you know what you're doing, all the info out there can be rather overwhelming which is the state I was in when I finally asked for help. ;) I'll try these and report back.

Just a quick question on x264. The docs say that the --sar parameter specifies the SOURCE SAR. I ask because you said to use the numbers above for NTSC. In my case the source is PAL. Any how, I'm probably making more complicated right? ;)

Chumbo
3rd March 2013, 17:47
Okay, I re-encoded a short 30 second clip using 32:27 and pretty much got the same results, i.e., a "squished" image. Basically, with the SAR numbers I've used including 32:27, the image looks like an anamorphic 16x9 image. MPC-HC plays it fine and I use LAV for the splitter, audio and video decoders. It's just my DLNA-enabled BD player (and VLC) that doesn't display it correctly on the TV. The BD player does display the original PAL MKV just fine but not the re-encoded one.

I did try playing both the original and re-encoded MKV with VLC and it plays both "squished" with its AR set to Default. I have to change VLC's AR setting to 16:9 to display the video correctly. What a headache.

Sharc
3rd March 2013, 17:56
Just a quick question on x264. The docs say that the --sar parameter specifies the SOURCE SAR. I ask because you said to use the numbers above for NTSC. In my case the source is PAL. Any how, I'm probably making more complicated right? ;)
Agree, it is confusing at times. My interpretation of "source" or "input" sar:
Your original PAL 16:9 720x576 file has a sar of 64:45 (most probably).
If you resize for NTSC 720 x 480 your original source is squeezed vertically, and the sar of the resized picture (i.e. new source) which you feed to the encoder now becomes
64/45 x (480 x 720) / (576 x 720) = 1.185185... = 32/27.

Sharc
3rd March 2013, 18:08
Okay, I re-encoded a short 30 second clip using 32:27 and pretty much got the same results, i.e., a "squished" image. Basically, with the SAR numbers I've used including 32:27, the image looks like an anamorphic 16x9 image. MPC-HC plays it fine and I use LAV for the splitter, audio and video decoders. It's just my DLNA-enabled BD player (and VLC) that doesn't display it correctly on the TV. The BD player does display the original PAL MKV just fine but not the re-encoded one.

I did try playing both the original and re-encoded MKV with VLC and it plays both "squished" with its AR set to Default. I have to change VLC's AR setting to 16:9 to display the video correctly. What a headache.
What container are you using? The ARs should also be set correctly with the container, because the container AR's may overrule those of the stream, depending on the playback device.

Chumbo
3rd March 2013, 18:29
Hi Sharc. I use MKV and I was just about to post what I did to get it to play correctly...FINALLY. :) So yes, you're right on with the DAR in an MKV. I added to my process a line that runs mkvpropedit to set the DAR as needed. So, for example, on my two files, here's what the end result is that plays exactly as needed on all:PROCESSING clip30sec_16x9.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 853, Display Height: 480
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 640, Display Height: 480
Thanks much for your help. I will re-encode the entire video now at 32:27 and 8:9 for 16x9 and 4x3 respectively.

Sharc
3rd March 2013, 18:38
Glad you got it right :)

Chumbo
3rd March 2013, 19:00
BTW, I just figured out that I don't have to use mkvpropedit. I can just use the mkvmerge --aspect-ratio switch with the DAR I need and the proper DAR is set for me. :)PROCESSING clip30sec_16x9.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 853, Display Height: 480
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 720, Display Height: 540
The 4x3 changes the height, but still the same end result.

Sharc
3rd March 2013, 19:58
This is correct:
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 640, Display Height: 480

This is wrong:
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 720, Display Height: 540

Double-check your mkvmerge settings.

Chumbo
3rd March 2013, 20:16
That's what I thought actually based on everything I had read. Thanks for confirming that. I'll take a look and make sure the mkvmerge setting is right. Thanks Sharc.

Chumbo
3rd March 2013, 20:34
This is correct:
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 640, Display Height: 480

This is wrong:
PROCESSING clip30sec_4x3.mkv
Pixel Width: 720, Pixel Height: 480
Display Width: 720, Display Height: 540

Double-check your mkvmerge settings.
Here's my mkvmerge line from my log"mkvmerge.exe" -o "output\clip30sec_4x3.mkv" "--forced-track" "0:no"
"--default-duration" "0:2500000/104271fps" "--aspect-ratio" "0:4/3"
"--compression" "0:none" "-d" "0" "-A" "-S" "-T" "--no-global-tags"
"--no-chapters" "(" "clip30sec_4x3.264" ")" "--language" "0:eng"
"--forced-track" "0:no" "--compression" "0:none"
"-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters"
"(" "clip30sec_4x3.ac3" ")" "-D" "-A" "-S" "-T" "--no-global-tags"
"--no-chapters" "--track-order" "0:0,1:0"
"--title" "clip30sec_4x3.mkv [nocues]" "--engage" "no_cue_duration"
"--engage" "no_cue_relative_position"
This is producing the INCORRECT values as you pointed out. I'll point Mosu to this thread in the mkvtoolnix thread unless you see something wrong with my command line?

Sharc
3rd March 2013, 22:12
I am afraid that the problem comes because only 480 (NTSC) and 576 (PAL) are legal DVD heights. Anything else may cause issues for some (most?) players.

I am not familiar with the mkvmerge commandline syntax. However, mkvmergeGUI lets you enter the display width and height directly; maybe you want to try this.

Added:
The 4x3 changes the height, but still the same end result.
Maybe I got you wrong here. I though that the output was again distorted.
If it came out right there is probably no strong reason to force the display height to 480.

sneaker_ger
4th March 2013, 01:08
Mosu has already answered this in the mkvtoolnix thread: mkvmerge always upscales. So instead of downscaling the width, it upscales the height. It doesn't care for any legal DVD heights, and honestly: why should it? Matroska is not DVD-Video.

Chumbo
4th March 2013, 18:27
Hi Sharc,
Like sneaker_ger said, Mosu cleared it up that the Matroska specs are NOT the same as DVD. I'm not authoring for DVD so I no longer care about the specs that are specific to it. All the info that's out there pretty much was confusing in that I thought any player that played BDs, DVDs or media would have to use the same specs, but that's not the case. So what mkvmerge is doing works perfectly and is fine as it is now that I know that it's correct specs for Matroska and the player must adhere to doing things right.

benwaggoner
5th March 2013, 22:05
Agree.
Frame rate conversion from PAL to NTSC is probably going to be the more difficult exercise.
SD PAL<>NTSC conversion is always lousy. You have to throw out 20% of your spatial data or temporal data either direction. The only non-nightmare conversion is from 576p25, which can be slowed down to 480p25 or 480i30 with 3:2 pulldown.

Fortunately, if you're using H.264, most players don't care from NTSC and PAL, and no conversion is needed. Just keep all the same parameters as they are in the source.

Sharc
5th March 2013, 23:11
Fortunately, if you're using H.264, most players don't care from NTSC and PAL, and no conversion is needed. Just keep all the same parameters as they are in the source.
Oh yes, of course. Thanks for pointing this out!

benwaggoner
6th March 2013, 21:08
Oh yes, of course. Thanks for pointing this out!
Sometimes the most best operation is a NOP (http://en.wikipedia.org/wiki/NOP) :).