Log in

View Full Version : Distorted Picture @ AVI2SVCD (w/D2SROBA) with XVID source (due to 122B3 I think)


Venom_IL
3rd September 2004, 14:42
major edit - the following doesn't happen when i use LanczosResize but it does happen with bilinear.. strange because there doesn't seem to be a meaningful difference in the avs script in avisynth.ini:

[AVISYNTH_LanczosResize]
0=Import(!RoBaConditional.avs)
1=LanczosResize(^TargetWidth,^TargetHeight)
2=AddBorders(^BorderLeft,^BorderTop,^BorderRight,^BorderBottom)
!RoBaConditional.avs=C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs

[AVISYNTH_BilinearResize]
0=Import(!RoBaConditional.avs)
1=BilinearResize(^TargetWidth,^TargetHeight)
2=AddBorders(0,^BorderTop,0,^BorderBottom)
!RoBaConditional.avs=C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs

:confused: :confused: :confused:

in any case the problem when using bilinear is the following-

a picture that's supposed to look like this
http://members.lycos.co.uk/tvcaptures/original.jpg

looks like this
http://members.lycos.co.uk/tvcaptures/distorted.jpg

happened 3 times in a row (batch gone to waste :p ) since i updated D2S from 1.2.2 B1 to 1.2.2 B3 and avisynth from 2.5.4 to 2.5.5 so I guess that's the cause

Preview looks fine, when I open the avs file in media player it also looks fine

it's not the conditional filters as well (i checked unfiltered.mpv)

I have eclCCE 1.81 and CCE trial 2.67.00.23

relevant part of dvd2svcd log:

--------------------------------------------------------
- 03/09/2004 15:35:12
- Free on drive F: 18322.31 mb
- Video Encoding using Cinema Craft
--------------------------------------------------------

Executing Cinema Craft Encoder.
StreamSectors: 1667869728
AudioSectors: 169621788
VideoPAPO: 23208660
ScanOffsetBytes: 179192
SeqAligningBytes: 11388673
DVDBytes: 0
VideoEndHeader: 8
SubtitleSectors: 0
EmptySectors: 238.00
PictureSectors: 1.00
PureMPEGStream: 1463471407.07
Seconds: 5977.08
CalcMPEGStream: 1463471407.07
Frames: 149327
CDSize: 800.00
Number of CDs: 2
Cut point 795.00
Variable Settings:
Frames: 149327
Anti Noise Filter: Off
Passes: 5
Image Quality: 17
VAF file creation: On
Video Encoding Mode: One Pass VBR
Q. Factor: 36
Min. bitrate: 300
Max. bitrate: 1958
Aspect Ratio: 4:3 (No borders, encoded as 4:3)

---AVS Begin---
LoadPlugin("C:\Programs\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
AVISource("G:\DOWNLO~1\LOONEY~2.AVI",audio=false)
ConvertToYUY2()
Import("C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs")
BilinearResize(360,576)
----AVS End----



d2sroba log (i stopped it after the first Q test encode since it already was distorted):


--------------------------------------------------------
D2SRoBa v3.60, by Tylo
--------------------------------------------------------
- WIN_XP - AutoIt 3.0.101.0
- 2004-09-03 15:32:52
--------------------------------------------------------
- Output type : SVCD
- CD size : 800
- Number of CD's : auto (max 32)
- Threshold Q : 36
- Sample size : 1.0%
- Adjust estimated : 1.2%
- Cond. sizing pass : Yes (Transcode if opv sz > 0.0% oversize, and Q <= 40)
(Encode if opv sz < 2.5% undersize, or Q > 40)
- Cond. filtering : If configured, and estim. oversize for Num CDs-1 is below 25%
- Audio after video : Yes (9% of video, min 160 kbps)
- Adjust max br : Yes (total: 2754, max avg offset: 300 kbps)
- Run mode : Normal
--------------------------------------------------------
- Waiting for CCE window ...
- Detected a CCE encode window
- Detected the movie encode window - shutting down
--------------------------------------------------------
- 2004-09-03 15:36:23
- Project dir: F:\DVD2SVCD\tmpdjksf\
- Avisynth setup: BilinearResize
- Configured cond. filter: C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs
- D2S ver. 1.2.2.3, CCE ver. 2.67.0.23
--------------------------------------------------------
- Movie length : 01:39:33 (149327 frames, 25 fps)
- D2S audio select : 224 + 0 kbps
- D2S video calc. : 1958 kbps, 2 CDs
- Select ranges : every 1500, select 15 frames
- Sample frames : 1500
--------------------------------------------------------
Calculations:
- 1 CD: video_br=923 (923) audio_br=160+0 video_sz=689144105 fill=100% cbr=0
- 2 CD: video_br=1990 (1990) audio_br=192+0 video_sz=1485803650 fill=100% cbr=0
- 3 CD: video_br=2530 (3057) audio_br=224+0 video_sz=1888986550 fill=84% cbr=1
--------------------------------------------------------
Computing target number of CDs:
- Sample max br : 2562 (adjusted for 2 CDs)
- Sample enc. Q=36 : 2399 kbps, err=?%, size=1791445357, sample sz=17995192
- Estim. oversize : 20.6% for 2 CDs
Conditional filter test:
- Sample enc. Q=36 :


:thanks: in advance

Nick
3rd September 2004, 16:36
It seems strange that changing from Bilinear to Lanczos should make a significant difference.

2 questions

1. Does the preview work or is this distorted also?
2. Would you mind deinstalling Avisynth 2.55 and return to 2.54, but still using the new build of D2S? This would help us establish if it is D2S or Avisynth causing the problem.

Cheers
Nick

Venom_IL
3rd September 2004, 18:48
1. Like I said the preview looks fine w/bilinear, no distortion

2. of course, it's the least i could do - I'll go back to avisynth 2.54 later today (I have some stuff to do first) and check it out

Cheers :sly:

Venom_IL
4th September 2004, 00:52
same exact thing happens with avisynth 2.54 so i guess it's something in D2S

while i was at it, i also tried simpleresize and bicubic. both resulted fine - no distortion

btw, for some reason my default avs script for bicubic was
0=BicubicResize(^TargetWidth,^TargetHeight,^b_value,^c_value)
1=AddBorders(^BorderLeft,^BorderTop,^BorderRight,^BorderBottom)
2=Import(!RoBaConditional.avs)
^b_value=0.0
^c_value=0.6
!RoBaConditional.avs=C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs


which prevented AviSynth_Script_file.avs from returning a video

i changed it to

0=Import(!RoBaConditional.avs)
1=BicubicResize(^TargetWidth,^TargetHeight,^b_value,^c_value)
2=AddBorders(^BorderLeft,^BorderTop,^BorderRight,^BorderBottom)
!RoBaConditional.avs=C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs
^b_value=0.0
^c_value=0.6


(according to the other resizers' theme, i know nothing in scripting :D ) and it worked fine

so if that script is really the default after some combination of D2S/D2Sroba installations maybe it could be fixed in future versions, or mentioned in a sticky

Boulder
7th September 2004, 13:29
---AVS Begin---
LoadPlugin("C:\Programs\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
AVISource("G:\DOWNLO~1\LOONEY~2.AVI",audio=false)
ConvertToYUY2()
Import("C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs")
BilinearResize(360,576)
----AVS End----


Why are you resizing to 360x576? It should probably be 352x576 and could fix the issue.

ralphthedog
8th September 2004, 04:21
I thought this had been a glitch in AVI2SVCD for a few versions now?

I always get bizzare,incorrect sizes on the rare occasions I do .avi's and use "edit as part of video encoding" to verify or correct the values in the resize line(not much good if you're doing batch encodes I guess),then the encode turns out fine.

Nick
8th September 2004, 10:11
There used to be a problem up to 1.2.1B3 with AVI2... using CVD framesize but I thought it had been fixed. I'll have another look when I get a few minutes.

Cheers
Nick

Venom_IL
12th September 2004, 19:34
Cool, I'll be using lanzcos till then :D

Venom_IL
13th September 2004, 19:31
this has nothing to do with the bilinear resizer.. as a matter of fact, that resizer is the only one that seems to be working well for me

following Boulder's post i looked at the encodes made by the other resizers (which were fine in terms of distortion) and noticed that they were horizontally contracted (i.e. there were black bars on the sides whereas the movie was supposed to take the whole screen)... and when i changed their avs scripts like he suggested (they too were set to 360x576) the same distortion appeared - and this time they filled the whole screen like it should've been in the first place

thing is, when i changed the bilinearresize avs script like boulder suggested everything worked great (distortion and aspect ratio).. i guess it has something to do with the right&left borders that are set to zero with the bilinear.. at least that's the only relevant difference i can see in the scripts ..

I'd appreciate it if you guys could tell me what i should do in order for the avs script to be set to resize it to 352x576 every time without my having to change it from 360x576 (again, for batch purposes mainly)

btw, i'm not sure i understand why it's set to 360x576 as the default in the first place (i haven't touched anything).. again i'm guessing it has something to do with the borders but i certainly don't know for sure

svcdprayer
14th September 2004, 20:15
0=BicubicResize(^TargetWidth,^TargetHeight,^b_value,^c_value)
1=AddBorders(^BorderLeft,^BorderTop,^BorderRight,^BorderBottom)
2=Import(!RoBaConditional.avs)
^b_value=0.0
^c_value=0.6


In avisynth.ini file edit :

For 0=BicubicResize(^TargetWidth,^TargetHeight,^b_value,^c_value)
u change for example ^TargetWidth with ^p_value and ^TargetHeight with ^q_value

then after
^b_value=0.0
^c_value=0.6
u add :
^p_value=352
^q_value=576
and save file. then rerun d2s again.

I hope this helps.


or u can add next type of script and then in frameserver tab u just add it so u dont change the original

Venom_IL
14th September 2004, 22:28
but would that work well for all the movies i'd like to convert to SVCD or for this specific one only ?

basically what i ask is this - when encoding to SVCD, would the command always be BilinearResize(352,576) for all input movies ?

or, at least, for all 4:3 input movies ? (in which case i'll just make a different script for those - i don't seem to have any problems when encoding 16:9 movies)

and if so - why did D2S prepared a script with BilinearResize(360,576) and i've seen other values than 360 as well, with other movies :confused:

svcdprayer
14th September 2004, 23:50
basically what i ask is this - when encoding to SVCD, would the command always be BilinearResize(352,576) for all input movies ?

Yes!

I had to create script for myself aswell, I really dont know why he changed resizing, but hes the author :) And we must respect that. The best software around!
usually i do capturing from tv with pinnacle and when doing avi2svcd jsoto math calculations that author implemented in 1.2.2b2 and later. calculations didnt work out for me so i had to use script from 1.1.3. works perfect.

Venom_IL
15th September 2004, 00:55
and you're saying this script would be good for 16:9 movies as well ?

are you sure i don't have to change anything with the borders (like I said I thought they had something to do with D2S changing ^targetwidth from the default 352)

btw, why isn't it BilinearResize(480,576) :confused:

sorry for the barrage of questions :)

svcdprayer
15th September 2004, 12:49
For 16:9 i would say this:

I am not 100% sure that it will work, but from logical aspect since its avi, and its already in there, if u do preview u would see if u change between 4:3 and 16:9 nothing would happen, there should be no difference. So thats I would say yes it should work. However, when i do capturing i do capture in 720x576, and i do have resize setup to 480x576, and works like a charm, however my all avis were 4:3 captured. Why its not set to 480x576 again i dont know. We should ask someone from the forum why, they for sure know the reason, and i would like someone to tell us :)


I strongly believe u dont need to change anything with borders.

If i am wrong, i would like that someone corrects me :)

Nick
15th September 2004, 18:52
The new AVI resizing is for 1:1 PAR AVI's - ie those with square pixels.
An unfortunate side effect is that capture AVI's at DVD/(S)VCD compatible resolutions do not have square pixels and do not therefore resize correctly.

The author is working on an answer to please everyone. Please be patient. You may wish to revert to an older build for now for capture AVI's. If you wish to continue using the current build, this should work for PAL captures.

1. Make a backup copy of Avisynth.ini to another folder.

2. Change the default resizer scripts in Avisynth.ini in each case from

0=***resize(^TargetWidth,^TargetHeight)
1=AddBorders(^BorderLeft,^BorderTop,^BorderRight,^BorderBottom)

to

0=BilinearResize(^BorderLeft+^BorderRight+^TargetWidth,^TargetHeight)
1=AddBorders(0,^BorderTop,0,^BorderBottom).

then resave.

Since DVD sources should always be full width, it shouldn't screw up DVD resizing.

PAL capture AVI's will then work also (NTSC won't btw) but most 1:1 AVI's will still resize correctly.

Give it a go.

PS @ Venom_IL
The distortion you were seeing is because the AddBorders line seems to be missing in your avisynth script. I am not sure why.

Oh and all this talk of 352 instead of 480 is that people were assuming you were keeping the ½D1 framesize of your original file. If you set the Resize To box in the frameserver tab to CVD(352x480/576) your DVD player will probably still play the output, but the quality will be better as no resizing will be needed.

Venom_IL
30th September 2004, 21:44
it seems to work well.. i'll give you a more confident answer once i've encoded some movies with it

in the meantime, i'd really appreciate it if you could provide me with a similar script for NTSC AVI's (even if it would only work for 4:3 AVI's [like i said 16:9 ones seem to work fine] or have any other limitations.. would sure be better than nothing) ?


btw, sorry for the late response, but i have been away for the last 2 weeks (army - yes, my life sucks)

EDIT - I saw the script you gave to that emazure fellow

[AVISYNTH_FillFrameBicubic]
0=BicubicResize(^TargetWidth+^BorderLeft+^BorderRight,^TargetHeight+^BorderTop+^BorderBott
om,^b_value,^c_value)
^b_value=0.0
^c_value=0.6

would it work for more AVI's? NTSC? :confused:

Nick
30th September 2004, 22:13
It should do.
Give it a try!
:)

Venom_IL
30th September 2004, 22:33
btw, can i switch "BicubicResize" in that script with any other resizer ? (of course, without ^b_value,^c_value)

and just for general knowledge - the "addborders" command is omitted since all the borders are already counted for in the resize command, right?

Nick
30th September 2004, 22:56
yes and yes :)

Your choice of resizer is fine.
As you are resizing the source to fill the screen, no borders need to be added so the command is omitted.

Venom_IL
30th September 2004, 23:04
i'll run some encodes and get back with the results, tomorrow i hope

Venom_IL
2nd October 2004, 18:42
I am happy to report all my encodes work great with the new Bilinear_nosideborders script..

NTSC, 16:9, 4:3, whatever

:thanks: