Log in

View Full Version : Tell me if i'm wrong


burnix
5th February 2008, 22:48
Hello. i want to encode some videos with mencoder or ffmpeg. So this is my method (source was pal vob 16/9 par=0.703).

- I read the video infos with mediainfo
pal 16/9 par=0.703 720*576
- i search the crop size
mencoder -vf cropdetect = 720*432
- i search the right vertical size
h = (dar/par)*v = 1087*432
- i divide by 2 and i search mod 16
544*244
- i encode with ffmpeg or mencoder
ffmpeg -y -i E:\Dvd\VIDEO_TS\VTS_01_1.VOB -t 30 -vcodec libxvid -trell -max_bframes=2 -croptop 72,0 -cropbottom 72,0 -s 544x224 -b 1000k -acodec libmp3lame -ac 2 -ab 128k -benchmark OUT.avi

mencoder -ss 300 -endpos 30 -ffourcc XVID dvd://1 -dvd-device e:\dvd -sws 9 -vf crop=720:432:0:72,scale=544:224 -ovc xvid -xvidencopts bitrate=1000000:trellis:me_quality=6:vhq=4:chroma_opt:noqpel:nogmc -oac copy -o E:\VideoSortie\Encode\temp\toto-temp.avi

So my question do i have to utilise aspect=16/9 or -aspect 16:9 or just leave the encoders without these parameters.

I thing that i have to set DAR on xvid file, but i seems it works well in 1:1 format.

If someone have good explanation or precision i thank you a lot.

Brother John
6th February 2008, 14:39
With resizing you changed your video to square pixels (PAR 1:1). Additionally applying AR flags is not necessary.

- i search the right vertical size
h = (dar/par)*v = 1087*432
That’s not correct. 1087 is too wide in any case. You should go through these steps:
Crop
Cropped Width × PAR = playback width. Get the PAR from these tables (http://forum.doom9.org/showthread.php?p=1058927#post1058927). I prefer the MPEG-4 table, but that’s up to you.
Scale down and apply mod restrictions, if needed.
For your example and assuming MPEG-4 PAR:
Crop to 720×432
playback width = 720 × 16/11 = 1047,2727
==> square pixel playback resolution is 1047,2727×432
Width / 2 = 523,63 ==> apply mod16 = 528
Scale factor for height = 528/1047,2727 = 0.5042
Scaled height = 217,8 ==> apply mod16 = 224
Final resolution = 528×224
Applying mod16 while scaling is a little more complicated than doing it at the very end but saves you from those special cases where first scaling both dimensions and applying mod16 afterwards produces a larger AR error.

emrah61
6th February 2008, 18:58
dont resize. original is better

Irakli
6th February 2008, 21:39
dont resize. original is better

Yes, but only if you have enough bitrate to encode it (1000kbps is probably too low for full anamorphic).

ffmpeg -y -i E:\Dvd\VIDEO_TS\VTS_01_1.VOB -t 30 -vcodec libxvid -trell -max_bframes=2 -croptop 72,0 -cropbottom 72,0 -s 544x224 -b 1000k -acodec libmp3lame -ac 2 -ab 128k -benchmark OUT.avi

burnix
7th February 2008, 20:15
Thanks for your reply and thanks brother john to this quick and clear response.

emrah61
8th February 2008, 13:36
1800>3200k is good for anamorphic encoding. with sixofnine(max=20) or eqm v3hr

Brother John
8th February 2008, 13:44
Bits/s is the worst indicator you can use. It hardly says anything about quality. Don’t use it, do a compressibility check instead.

burnix
8th February 2008, 18:31
thanks. i know these details about quality. One of the question that block me before i start to code my own front-end for ffmpeg-mencoder was the par. The best way was if i can make vqm analysis on xvid file, but it's not possible with mencoder or ffmpeg.

Thanks for all, and thats my las words on the subject of this thread (i understand par now)