View Full Version : DAR set for avs4x264mod encoding
yup
21st November 2013, 07:52
Hi all!
Before i am using MeGUI and use DAR signaling in my script
global MeGUI_darx=4
global MeGUI_dary=3
Now i am go to batch file with
avs4x264mod --level 4.1 --preset veryslow --crf 20 --keyint 24 --b-pyramid strict --ref 4 --weightp 0 --slices 4 --qpmin 10 --qpmax 51 --vbv-bufsize 30000 --vbv-maxrate 40000 --aud --nal-hrd vbr --tff --output file.mp4 file.avs
What I need make, add --sar option for avs4x264mod or during muxing mkvmerge change to DAR 4:3.
Please advice.
yup.
sneaker_ger
21st November 2013, 11:43
H.264 "SAR" and DAR are two different things. It is recommended to set --sar, mkvmerge will then automatically read and use that info for the container as well.
DAR = (width/height) * SAR
yup
21st November 2013, 13:14
sneaker_ger :thanks:
But If encoded without --sar, mkvmerge solving problem, if I change to 4:3?
I have some files encoded without --sar and question easy can I use mkvmerge for patching or need reencoding.
yup.
sneaker_ger
21st November 2013, 14:04
If you put an H.264 stream into an mkv container there can be two locations in which aspect ratio information is stored:
1. within the H.264 bitstream
2. within the mkv header
Some players rely on 2 and some players rely on 1. The x264 paramter --sar will only write 1, mkvmerge will only write 2. You cannot use mkvmerge to patch 1.
There is a tool which can change 1 without re-encoding but it's neither trivial to use nor stable:
http://forum.doom9.org/showthread.php?t=152419
yup
21st November 2013, 14:33
sneaker_ger!
I try patched from mkvmerge files on VLC and two my mediabox it is work.
I read that mkvmerge remove AR info from bitstream.
I try suggested direct264 tool.
yup.
sneaker_ger
21st November 2013, 14:56
I try patched from mkvmerge files on VLC and two my mediabox it is work.
If your players rely on 2 you could of course leave it at that.
I read that mkvmerge remove AR info from bitstream.
That information is very outdated. Mkvmerge has not been doing that anymore by default for years.
yup
21st November 2013, 15:41
sneaker_ger!
I extract from mkv bitstream.
I try
"C:\Video\ff\ffmpeg.exe" -i "T1_Video - .h264" -vcodec copy -acodec copy -vbsf h264_changesps=sar=12:11 "T1_Video - ow.h264"
and after mux back to mkv.
Now Mediainfo show only DAR 4:3.
My video PAL 720x576.
It is right way for processing? I have near 300GB video which I could remake.
Please advice.
yup.
yup
22nd November 2013, 11:07
Hi all!
Before I am using wrong SAR, now
ffmpeg.exe -i chapter13.mkv -vcodec copy -acodec copy -vbsf h264_changesps=sar=16:15/fps=50:2 chapter13cd.mkv
work on mkv without demuxing, but I add fps parameter because without this I get video with 1000 fps.
yup.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.