View Full Version : Tried editing AviSynth script, ruined aspect ratio...


gunnm
27th March 2003, 20:04
Ok folks, looking for a little assitance please.
My source file is some sort of DivX(5.X I believ) that has a resolution of 512 by 384. The bottom 58 pixels however, are filled with an irritating T.V. station identification/advert bar, which I wish to get rid of. So I ran DVD2SVCD in AVI input mode and chose the "Edit AviSynth" option. The original (unedited) script is as follows:

LoadPlugin("C:\PROGRA~1\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("E:\TORIAM~1.AVI")
ConvertToYUY2()
SimpleResize(480,360)
AddBorders(0,60,0,60)
ResampleAudio(44100)

My idea was to crop the bottom 58 pixels, then add a black border to the bottom to replace it:

LoadPlugin("C:\PROGRA~1\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("E:\TORIAM~1.AVI")
ConvertToYUY2()
CropBottom(58)
AddBorders(0,0,0,58)
SimpleResize(480,360)
AddBorders(0,60,0,60)
ResampleAudio(44100)

This resulted in blacking out the bottom bar (good!) but also severely distorted the aspect ratio of the resulting mpeg2 (bad!). Can anybody tell me what I'm screwing up? Thanks for any help!

Also, I've attached the full log below if that helps:

--------------------------------------------------------
- 3/26/2003 4:47:46 PM
- AVI to SVCD Conversion
- AVI2SVCD ver. 1.0.9 build 2
--------------------------------------------------------
Initializing
Initializing finished.

--------------------------------------------------------
- 3/26/2003 4:47:47 PM
- Free on drive D: 1210.37 mb
- AUDIO Extraction
--------------------------------------------------------
Audio extraction finished.

--------------------------------------------------------
- 3/26/2003 4:55:44 PM
- Free on drive D: 1970.82 mb
- AUDIO conversion
--------------------------------------------------------

Converting MP2 to WAV. Filename: D:\movie scratch space\Extracted_audio_1.mpa
Executing MADPlay (mp2 to wav). Commandline:
"C:\Program Files\DVD2SVCD\MADPlay\madplay.exe" --quiet --output=wave:"D:\movie scratch space\Encoded_audio_1.mp2.wav" "D:\movie scratch space\Extracted_audio_1.mpa"
Conversion (mp2 to wav) of D:\movie scratch space\Extracted_audio_1.mpa finished.


Converting Audio to MP2. Filename: D:\movie scratch space\Extracted_audio_1.mpa
Executing BeSweet. Commandline:
"C:\Program Files\DVD2SVCD\BeSweet\BeSweet.exe" -core( -input "D:\movie scratch space\Encoded_audio_1.mp2.wav" -output "D:\MOVIES~1\Encoded_audio_1.mp2" -logfile "D:\MOVIES~1\Encoded_audio_1.log" ) -ota( -g max ) -ssrc( --rate 48000 ) -2lame( -e -b 224 -m s )
Audio conversion of D:\movie scratch space\Extracted_audio_1.mpa finished.

Audio conversion finished.

--------------------------------------------------------
- 3/26/2003 5:02:13 PM
- Free on drive D: 1508.70 mb
- Video Encoding using Cinema Craft
--------------------------------------------------------
- Editing AVS script file

Executing Cinema Craft Encoder.
StreamSectors: 834285788
AudioSectors: 74774700
VideoPAPO: 11765232
ScanOffsetBytes: 94508
SeqAligningBytes: 6006534
DVDBytes: 0
VideoEndHeader: 4
SubtitleSectors: 0
EmptySectors: 238.00
PictureSectors: 0.00
PureMPEGStream: 741644809.73
Seconds: 2634.86
CalcMPEGStream: 741644809.73
Frames: 78757
CDSize: 800.00
Cut point 796.00
Variable Settings:
Frames: 78757
Anti Noise Filter: Off
Passes: 4
Image Quality: 17
VAF file creation: On
Video Encoding Mode: Multipass VBR
Min. bitrate: 300
Max. bitrate: 2530
Avg. Bitrate: 2251
Aspect Ratio: 4:3 (No borders, encoded as 4:3)

---AVS Begin---
LoadPlugin("C:\PROGRA~1\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("E:\TORIAM~1.AVI")
ConvertToYUY2()
CropBottom(58)
AddBorders(0,0,0,58)
SimpleResize(480,360)
AddBorders(0,60,0,60)
ResampleAudio(44100)
----AVS End----

Closing program
CCE Max Speed: 1.620
Video Encoding finished.

--------------------------------------------------------
- 3/26/2003 7:23:11 PM
- Free on drive D: 1582.68 mb
- Converting Pictures from ES to PS
--------------------------------------------------------
Saving bbMPEG settings: C:\Program Files\DVD2SVCD\bbMPEG\default.ini
--------------------------------------------------------
- 3/26/2003 7:23:13 PM
- Free on drive D: 1582.68 mb
- Converting Pictures from ES to PS
--------------------------------------------------------
Saving bbMPEG settings: C:\Program Files\DVD2SVCD\bbMPEG\default.ini
--------------------------------------------------------
- 3/26/2003 7:23:15 PM
- Free on drive D: 1582.68 mb
- Multiplexing and cutting
--------------------------------------------------------
Saving bbMPEG settings: C:\Program Files\DVD2SVCD\bbMPEG\default.ini
Offset in Seconds: 0
Executing bbMPEG.
Variable Settings:
Movie offset: 0 seconds
Cut point: 796 mb

Executing RunbbMPEG. Commandline:
"C:\Program Files\DVD2SVCD\bbMPEG\RunbbMPEG.exe" "D:\movie scratch space\bbMPEG_Muxed_File.mpg"
Multiplexing and cutting finished.

CD-Image creation finished.

--------------------------------------------------------
- 3/26/2003 7:28:05 PM
- Free on drive D: 789.39 mb
- SVCD Creation finished!
--------------------------------------------------------

LdSr
27th March 2003, 21:48
Try this:
LoadPlugin("C:\PROGRA~1\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("E:\TORIAM~1.AVI")
ConvertToYUY2()
CropBottom(58)
SimpleResize(480,360)
AddBorders(0,60,0,118)
ResampleAudio(44100)

Then load the avs into virtualdub to see if it works, it's going to be a lot quicker than encoding.

Nick
27th March 2003, 23:40
One thing that leaps out is that 512x384 for the original file rather suggests a 4:3 aspect ratio since 512/384=1.33 . 4/3 also = 1.33.

I notice the AddBorders command in the UNEDITED Avisynth script indicating a "16:9 encode as 4:3" Letterbox aspect ratio for the encode. So unless I'm mistaken you are doing a letterbox encode from a 4:3 source! Now that would screw up your aspect ratio...

If the source is 4:3, then do a 4:3 encode but add the lines
CropBottom(58)
AddBorders(0,29,0,29)

Before the SimpleResize(480,480) line of the avisynth script.

This should cut out the advert line, centre the remainder and maintain your aspect ratio.

Hope this helps.
Nick

juange
7th April 2003, 21:30
Try this great plug in and will not necessary edit the Avisynth .
http://forum.doom9.org/showthread.php?s=&threadid=44445

It will do all job for you.
:D