PDA

View Full Version : x264's SAR or MKV's DAR?


elguaxo
30th July 2008, 16:07
If I encode with x264 to MKV and use a custom SAR is it really stored in the AVC stream or is MKV's DAR used instead?

I did an anamorphic encode via MeGUI which resulted in a weird AR (it's a documented bug of the MeGUI version I'm currently using). I wanted to fix it via MKVToolnix remuxing and setting the correct DAR. Then I thought something weird might happen if the stream has one SAR and the container is specifying a different AR via DAR. But if I extract the rawstream out of the MKV with weird AR and open it via DGAVCIndex I get: SAR: Unspecified. So I wonder if the AR was stored just at the container level.

Sharktooth
30th July 2008, 16:17
in the avc stream.
mkvmerge removes the AR from the stream and places it into the container.

martino
30th July 2008, 16:20
Does it really remove it? I was in the through that it is kept, so even after doing AVC (w/ --sar) -> MKV/MP4 -> AVC -> MKV/MP4 the correct AR would be still kept since it's present in the AVC stream... Or is my memory going bad. :/

elguaxo
30th July 2008, 16:21
mkvmerge removes the AR from the stream and places it into the container.

that solves the mystery! thanks.

buzzqw
30th July 2008, 16:32
or you can use the --engage keep_bitstream_ar_info in mkvmerge

BHH

elguaxo
30th July 2008, 16:35
good to know. thanks buzzqw!

Sharktooth
30th July 2008, 16:42
Does it really remove it? I was in the through that it is kept, so even after doing AVC (w/ --sar) -> MKV/MP4 -> AVC -> MKV/MP4 the correct AR would be still kept since it's present in the AVC stream... Or is my memory going bad. :/
it removes the AR from the bitstream and places it in the container, how many times i have to repeat that?
you can do as buzzqw sugested to change the default behaviour

martino
30th July 2008, 16:50
it removes the AR from the bitstream and places it in the container, how many times i have to repeat that?
Ugh calm down... I was merely saying something, nothing more... :V

Sharktooth
30th July 2008, 16:53
k, np. sorry. however search before posting. that info is already available in other threads too.

Brother John
31st July 2008, 01:34
The removal doesn’t happen for all input types, though, as mosu explained some time ago in the German forum. I’m sure about raw AVC input and I think it was MP4 as well, but not other formats.