Log in

View Full Version : How to set/edit the PAR in MPEG files?


nnezz
12th December 2008, 00:39
My NTSC camcorder produces MPG files with resolution 704x480, intended for 16:9 AR.

Unfortunately when I try to encode them, the aspect ratio is reported to the encoding tool (handbrake in this case) as 2.32.

That's way too wide, and results in the output files also having the Pixel Aspect Ratio set incorrectly.

Instead of messing around at the encoding stage, how can I correct the PAR of my source files? Is there some kind of tool that allows setting the correct aspect ratio to 16:9?


edit: If I use MPlayer or VLC to display the source MPG files I get the ultra wide stretched look. If I use MPC, it actually displays with the correct aspect ratio, until I switch off "Override Aspect Ratio" in which case it also displays the ultra wide image.

edit2: I found a program called "restream" that supposedly can change mpeg stream tags. I demuxed my mpeg file, ran the m2v through restream with new aspect ratio set, and the result is a bit-for-bit similar file. Obviously, it doesn't work as intended, unless I'm using it wrongly.

edit3: If I use restream to set a 1:1 aspect ratio, ALL the players display the file correctly, as in squeezed dvd-like format. However, if I set the flag to 16:9, I get the identical file from edit3, where the players all display it way too wide. It's really odd.

nnezz
12th December 2008, 06:42
Well, I fixed it myself.

No thanks to any of the several programs out there that apparently do not work.

Instead I found the hex string 01 B3 2C 01 E0 34

Where 34 is wrong. It should be 24. This will need to be replaced throughout the file, but it's a relatively simple process with a decent search/replace program.

Apparently the "wide screen" flag had been incorrectly set in the transfer process from camcorder to PC, thanks to using a little program known as "sdcopy" which claims to actually set the flag correctly. I don't know, but my files came out perfectly after turning that feature off. It may have some other obscure use that I cannot divine at this point.

Unfortunately there is NO way to undo the widescreen flag once it's been done, using sdcopy, except for doing it manually through hex editing. Or at least nobody has been sharing any methods for doing so.

Restream and Dvdpatcher both do not work.

ANGEL_SU
12th December 2008, 18:42
Restream & DvdPatcher set correct aspect ratio for MPEG-2 type. Maybe your file is MPEG-1 type, that is, why your encoding tool reports a strange value - 2.32 ??