how can I calculate the number of pixels for the height of the encoded video, so that:
- the aspect ratio will be as close as possible to the AR of the source video;
- and the vertical resolution to be mod2 for x264
+ Reply to Thread
Results 1 to 6 of 6
-
-
Well what is the source? Post some more information
Do you want "square pixels" or anamorphic ?
What is the output goal ? e.g. If you aren't resizing just use the same dimensions
DAR = FAR x SAR
Display Aspect Ratio = Frame Aspect Ratio x Sample Aspect Ratio -
Unless you're encoding for a device with some specific resolution, you could just leave X and Y alone.
And yes, you probably want to tell us what are you trying to accomplish. -
That's kind of going about it ass-backwards.
Your source files are standard SD format. Either 4:3 or 16:9 DAR.
The problem is your insistance on: resizing, square pixel PARs, and prioritizing the horizontal when resizing.
All the MPEG formats support non-square PARs (mpeg1, mpeg2, mpeg4part2/divx/xvid and h.264), so why not leave the whole thing as-is? Yes, reencoding does incur losses, but modifying the source often incurs FURTHER losses.
Also, because of its analog origins, video places greater emphasis on the inviolability of the vertical dimension with its # of lines vs. the # of pixels in the horizontal dimension. So if you HAVE to resize, you should be resizing the horizontal, not the vertical.
For example, 720x480 with a DAR of 16:9 would be the equivalent of 853x480 (852 if mod2 is expected).
Scott -
Pick whatever width you want then, HEIGHT = WIDTH * 3 / 4, or HEIGHT = WIDTH * 9 / 16, then round to the nearest even number. Or pick whatever height you want then WIDTH = HEIGHT * 4 /3 , or WIDTH = HEIGHT * 16 / 9, and round to the nearest even number.
Similar Threads
-
is 1080p shown in Height in mediainfo?
By justravis in forum Newbie / General discussionsReplies: 8Last Post: 24th Feb 2011, 17:48 -
How To Maintain Proper Aspect Ratio?
By Bonie81 in forum Authoring (DVD)Replies: 4Last Post: 2nd Sep 2010, 19:23 -
mp4 width/height problem
By jfish666 in forum ffmpegX general discussionReplies: 1Last Post: 9th May 2009, 05:36 -
Rule of 16: is a divisible height as important?
By ptfigg in forum ffmpegX general discussionReplies: 1Last Post: 11th Jul 2008, 11:48 -
Changing width & height
By Blå_Mocka in forum Newbie / General discussionsReplies: 2Last Post: 31st May 2008, 11:27