View Full Version : Anamorphic flag query
WorBry
26th February 2009, 04:47
I recently encoded a batch of bob-deinterlaced (50p) anamorphic 720x576 DV files to x264.mkv using the SA-Blu-Ray profile in MeGUI with the intent of converting to Blu-Ray (or DVD-AVCHD) format for later playback on a Blu-Ray/AVCHD standalone player (when I eventually get one). I subsequently added a 16:9 DAR flag using MKVMerge with the mistaken notion that this would be preserved on conversion to m2ts (using TSMuxeR), which it is not. I realize now that I should have changed the SAR setting in the x264 SA-Blu-Ray profile from 1:1 to 64:45 (for a 1024x576 DAR)
Question is - rather than re-encode the x264.mkv files from scratch, is there any (easy) way to set a 16:9 flag in the converted m2ts streams, or edit the Blu-Ray file structure in some way, so that they will display correctly?
Thanks alot.
poisondeathray
26th February 2009, 06:08
Is 720x576 50p compatible? It isn't listed on the blu-ray or avchd compatible specs, only 720x576 50i is listed
You might be able to alter the aspect ratio with h264info , I think neuron2 was working on a stream tool as well
WorBry
26th February 2009, 17:23
Thanks.
For sure, there is/was debate about the Blu-Ray spec compliance of progressive AVC streams at standard (SD) resolutions. Fact is though that they (at least 576/25p and 576/50p) do play on standalone BD/AVCHD players:
http://forum.doom9.org/showthread.php?t=135642
I'll have a look at H264Info when I'm back at my home PC. IIRC, it requires raw H264 stream input.
Edit: Tried H264Info. Setting the 'Output Aspect Ratio' to 16:9 gives an output resolution of 1280x576. Weird.
Any link for Neuron2's stream tool?
1248
4th March 2009, 00:56
Hello,
I recently wrote a tool which can change the aspect ratio of a h.264 stream. The stream can be either an elementary stream or inside an AVI container. At the moment it's still kind of beta, but for me it works well. Perhaps you'd like to try it. Since the maximum size of zip-attachments here in the forum is only 300k, I uploaded it to rapidshare:
http://rapidshare.com/files/205016752/H264ARM.0.1.1.zip.html
I tested it on WinXP SP3, and as far as I can tell it works well. Still, the usual disclaimer: Use it at your own risk. If you are interested in a Linux version then please send me a PN and I will try and port it, but this will be the first time I will do something like that, so I cannot guarantee that I will be successful.
Limitations:
- changes are made in place in the original file!
- Therefore you can only replace either a predefined AR by another predefined one or a custom AR by another custom one.
Some instructions:
1. Load AVI file or stream file (Menu, Button or drag&drop)
2. The file is scanned for AR information. You can stop this by clicking on abort, but I would recommend to scan the whole file.
3. All AR information is displayed in a list. Most likely you'll want to change all at once, but you can also change single or several entries.
4. To change an AR information, select the entry (or entries), select the new AR on the right hand side and click on "Set new AR"
5. Click on "Save changes" to save the changes to file.
Please tell me if it worked for you.
Philipp
onesloth
4th March 2009, 08:00
I realize now that I should have changed the SAR setting in the x264 SA-Blu-Ray profile from 1:1 to 64:45 (for a 1024x576 DAR)
I might be wrong, but I thought bluray spec only supports 1:1 SAR.
WorBry
5th March 2009, 03:05
@ 1248
Tried your application, but could'nt change the SAR (1:1) of my original H264 streams to SAR 64:45, because the latter is not one of the listed 'pre-defined' values i.e.
.....you can only replace either a predefined AR by another predefined one or a custom AR by another custom one.
I would assume that at some stage you plan to add the ability to change a (listed) pre-defined AR to a custom one, and visa-versa.
In the interim, do you think that you could add 64:45 (i.e. 16:9 DAR (Image) = 1024 x 576) and 16:15 (i.e. 4:3 DAR (Image) = 768 x 576) to the 'pre-defined' SAR list.
Thanks.
Edit: Here's a sample of one of my x264.mkv encodes (720x576 anamorphic, 50p, SA-Blu-Ray profile with default SAR 1:1) if you wish to test:
http://rapidshare.com/files/205456867/Test_720x576_anamorph_50p_to_x264_SA-Blu-ray_SAR_1_1_mkv.mkv.html
@ Onesloth
I might be wrong, but I thought bluray spec only supports 1:1 SAR.
720x576 is a Blu-Ray/AVCHD compliant SD resolution, but AFAIK 768x576 and 1024x576 are not. Please, someone correct me if I'm wrong, as I would hate to find out that I should have resized before encoding to x264.
1248
5th March 2009, 14:08
I would assume that at some stage you plan to add the ability to change a (listed) pre-defined AR to a custom one, and visa-versa.
In the interim, do you think that you could add 64:45 (i.e. 16:9 DAR (Image) = 1024 x 576) and 16:15 (i.e. 4:3 DAR (Image) = 768 x 576) to the 'pre-defined' SAR list.
The distinction between pre-defined and custom SARs was not made by me. In the h.264 specifications there is a list of pre-defined SARs which are stored slightly different than custom ones, using 4 bytes less space. That's why I can not simply add more SARs to the list, and that's why it is much more complicated to replace pre-defined SARs by custom ones.
I will try to add this feature one day, but I'm afraid that I don't have much time at the moment. As a workaround you could use the pre-defined 16:11 SAR. This was defined by the MPEG-4 standard for 16:9 PAL videos. The reason for this value is that in the usual PAL videos the resolution is 720x576, but the active video area is only 702x576 (the rest is called "overscan"). Stretching this active video area by 16:11 results in a 16:9 picture (not exactly, but up to 2-3 pixels).
So there are different "flavours" of anamorphic videos, either those acording to MPEG-4 / ITU as described above (SAR 16:11), or those with a generic SAR of 64:45. The latter result in a 16:9 picture if the whole frame of 720x576 is regarded as the active video area (no overscan). Usual PAL-DVDs use mainly 16:11, but there are exceptions. It depends on the anamorphic standard which was used during the encoding process.
I don't know how your video was recorded, unfortunately I couldn't open the sample you sent. But you could try to use the 16:11 pre-defined SAR anyway. Even if it is not exactly the right one, the difference is only 2%, so in a normal viewing situation you will not notice it (Just consider that even with a perfect AR you will see a slightly distorted picture just by sitting not exactly in front of the screen!).
Good luck,
Philipp
onesloth
5th March 2009, 14:44
720x576 is a Blu-Ray/AVCHD compliant SD resolution, but AFAIK 768x576 and 1024x576 are not. Please, someone correct me if I'm wrong, as I would hate to find out that I should have resized before encoding to x264.
Those are DARs. My point is I thought I read that blu-ray spec does not support anamorphic playback (i.e. SAR != 1:1). AFAIK AVCHD does, however.
SeeMoreDigital
5th March 2009, 16:40
Hello,
I recently wrote a tool which can change the aspect ratio of a h.264 stream. The stream can be either an elementary stream or inside an AVI container. At the moment it's still kind of beta, but for me it works well. Perhaps you'd like to try it. Hi Philipp,
Many thanks for creating your application. I'm sure it's going to prove very useful ;)
smok3
5th March 2009, 21:04
Those are DARs. My point is I thought I read that blu-ray spec does not support anamorphic playback (i.e. SAR != 1:1). AFAIK AVCHD does, however.
that would be really weird,
http://en.wikipedia.org/wiki/Blu-ray_Disc#Technical_specifications
b66pak
8th March 2009, 20:02
@1248 thanks for your tool...i used with success...if you have a new version post a link!
_
WorBry
10th March 2009, 15:33
I don't know how your video was recorded, unfortunately I couldn't open the sample you sent. But you could try to use the 16:11 pre-defined SAR anyway. Even if it is not exactly the right one, the difference is only 2%, so in a normal viewing situation you will not notice it (Just consider that even with a perfect AR you will see a slightly distorted picture just by sitting not exactly in front of the screen!).
As I indicated, the uploaded sample was an x264.mkv file encoded with MeGUI using the Standalone Blu-ray profile (default 1:1 SAR). H264ARM accepted the extracted H264 stream (MKVExtract) OK for me, so I'm not sure why you couldnt open it. However, I have had a problem editing H264 streams from other x264.mkv files (anamorphic and non-anamorphic 720x576, 50p) that I encoded 6 - 9 months ago using the (default) x264 SA-Blu-ray profile. H264ARM looks like it is loading and analysing the file (i.e. box indicates 'Sequence Parameter (SPS) Sets Found' ) but then does not reveal the Aspect Ratio Information in the main window, so there is nothing to select. I can upload a sample if you would like.
However, I have found it possible to change the stream SAR of these files using YAMB (i.e. via conversion to MP4). Again, the only options for SD PAL 16:9 and 4:3 are 16:11 and 12:11, but I guess I'll have to live with that, as I no longer have the source files to re-encode anyway.
1248
10th March 2009, 21:44
@all: Thank you for your feedback!
@WorBry:
H264ARM looks like it is loading and analysing the file (i.e. box indicates 'Sequence Parameter (SPS) Sets Found' ) but then does not reveal the Aspect Ratio Information in the main window, so there is nothing to select. I can upload a sample if you would like.
If you could upload a sample, I will have a look into the problem. For me it would be the easiest if you could upload a sample of the extracted elementary stream. Thanks in advance,
Philipp
WorBry
11th March 2009, 21:24
Actually the problem appears to be limited to those x264.mkv files (encoded with SAR 1:1) that I had subsequently modified with MKVMerge, to set a 16:9 (1024x576) or 4:3 (768x576) DAR. Although, to my understanding, the flag is set in the mkv container and not the H264 stream, evidently the extracted stream is changed in some way, such that the AR information cannot be read properly by H264ARM.
Here are the H264 streams extracted from two x264.mkv samples;
Original:
http://rapidshare.com/files/208022263/Test_720x576_anamorph_50p_x264_SA-Bluray_SAR_1_1_mkv_to_H264.h264.html
16:9 DAR flag set in mkv container:
http://rapidshare.com/files/208023544/Test_720x576_anamorph_50p_x264_SA_Bluray_SAR_1_1_mkv_to_MKVMerge_16_9_flag_to_H264.h264.html
SeeMoreDigital
11th March 2009, 22:08
Here's your sample, muxed into the .TS container complete with 64:45 aspect ratio stream signalling: -
http://rapidshare.com/files/208103927/Test_720x576_anamorph_50p.ts.html
WorBry
11th March 2009, 23:36
So, pray tell, how did you do that ? :)
Edit: Ah, silly me. It is possible to set a custom SAR/PAR, like 64:45, with YAMB. Is that the method you used, SeeMoreDigital?
SeeMoreDigital
12th March 2009, 09:53
Ah, silly me. It is possible to set a custom SAR/PAR, like 64:45, with YAMB. Is that the method you used, SeeMoreDigital?That's the way ;)
jayman
4th April 2009, 01:14
I've attempted two h264 streams demuxed with tsmuxer from high def mkv files and they don't show up in this program.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.