Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st November 2013, 07:52   #1  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
DAR set for avs4x264mod encoding

Hi all!

Before i am using MeGUI and use DAR signaling in my script
Code:
global MeGUI_darx=4
global MeGUI_dary=3
Now i am go to batch file with
Code:
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.
yup is offline   Reply With Quote
Old 21st November 2013, 11:43   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
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
sneaker_ger is offline   Reply With Quote
Old 21st November 2013, 13:14   #3  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
sneaker_ger
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.
yup is offline   Reply With Quote
Old 21st November 2013, 14:04   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
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
sneaker_ger is offline   Reply With Quote
Old 21st November 2013, 14:33   #5  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
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.
yup is offline   Reply With Quote
Old 21st November 2013, 14:56   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,569
Quote:
Originally Posted by yup View Post
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.

Quote:
Originally Posted by yup View Post
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.
sneaker_ger is offline   Reply With Quote
Old 21st November 2013, 15:41   #7  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
sneaker_ger!

I extract from mkv bitstream.
I try
Code:
"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 is offline   Reply With Quote
Old 22nd November 2013, 11:07   #8  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi all!
Before I am using wrong SAR, now
Code:
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.
yup is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.