Need a look over of my script

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 5:11 am

Code: Select all

DirectShowSource("M:\Gameplay Videos\Compressed\me1 playthrough part 1.mp4",audio=true,video=true).BilinearResize(1920,1080, 0, 0, 1680, 1050)
EnsureVBRMP3Sync()
So, what I am trying to do with this is load a 1680x1050 mp4 file into avsp then using avs2avi, compress and convert it to 1920x1080. So far all I managed to do with Avs2Avi was make a video file without any audio. If I open it in Vdub I ca convert with audio but I am unable to compress and I get a god awful HUGE file (somewhere around 230GB for 10 minutes).

So is there anything wrong with my script that would cause Avs2Avi not to render the audio??

and if Avs2Avi can't deal with audio what sohuld I use to get the result I am looking for?

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Need a look over of my script

Post by mirkosp » Fri Jul 02, 2010 5:44 am

There are some mistakes you are doing that can cause various issues. For starters, you are using directshowsource. Since it is not frame accurate, its usage is discouraged (it can cause weird motion and audio de-sync). You should load mp4s with ffvideosource instead. Loading audio in avisynth is a bad idea too, and my guess is that your recording has aac audio, so my suggestion would be to leave the audio alone and remux it with the compressed video into an mkv or mp4, depending on what you want to do. If you however need to do an avi final encode and the avi isn't just a lossless mid-step, then you should look into using ffmpeg or eac3to to convert it. I don't know of any public builds of ffmpeg for win32 (which I'm assuming is the OS you're on), so eac3to is certainly an easier solution ─ there's a gui if you don't like command lines, too. Third thing you're doing wrong is the aspect ratio: 1680x1050 is a 16:10 aspect ratio, whereas 1920x1080 is 16:9. Upscaling is a bad idea imho, but if you REALLY need to upscale for whatever reason, then upscale to 1920x1200. Also, instead of bilinearresize, I'd suggest using spline36resize. EnsureVBRMP3Sync seems useless too in the script since I find it hard to believe that your audio is mp3 in there (it just seems more likely for it to have been recorded as aac or perhaps pcm, but I can very well be wrong since I don't know what software and settings you used for your recording) and it only serves its purpose when you have to trim within avisynth.
As for virtualdub, you are most likely overlooking the codec settings to use ─ if you want to do mp3 audio, then I'd say either convert the audio to wav with eac3to and compress it with lame mp3 in vdub or compress it to mp3 directly with eac3to and just have vdub mux it. For the video, you'll have to set it to fast recompress and choose xvid or divx or a similar lossy codec and set it properly (by default it uses no codec, and uncompressed video weights a LOT, as you've noticed).
Image

geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Re: Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 6:12 am

mirkosp wrote:There are some mistakes you are doing that can cause various issues. For starters, you are using directshowsource. Since it is not frame accurate, its usage is discouraged (it can cause weird motion and audio de-sync). You should load mp4s with ffvideosource instead. Loading audio in avisynth is a bad idea too, and my guess is that your recording has aac audio, so my suggestion would be to leave the audio alone and remux it with the compressed video into an mkv or mp4, depending on what you want to do. If you however need to do an avi final encode and the avi isn't just a lossless mid-step, then you should look into using ffmpeg or eac3to to convert it. I don't know of any public builds of ffmpeg for win32 (which I'm assuming is the OS you're on), so eac3to is certainly an easier solution ─ there's a gui if you don't like command lines, too. Third thing you're doing wrong is the aspect ratio: 1680x1050 is a 16:10 aspect ratio, whereas 1920x1080 is 16:9. Upscaling is a bad idea imho, but if you REALLY need to upscale for whatever reason, then upscale to 1920x1200. Also, instead of bilinearresize, I'd suggest using spline36resize. EnsureVBRMP3Sync seems useless too in the script since I find it hard to believe that your audio is mp3 in there (it just seems more likely for it to have been recorded as aac or perhaps pcm, but I can very well be wrong since I don't know what software and settings you used for your recording) and it only serves its purpose when you have to trim within avisynth.
As for virtualdub, you are most likely overlooking the codec settings to use ─ if you want to do mp3 audio, then I'd say either convert the audio to wav with eac3to and compress it with lame mp3 in vdub or compress it to mp3 directly with eac3to and just have vdub mux it. For the video, you'll have to set it to fast recompress and choose xvid or divx or a similar lossy codec and set it properly (by default it uses no codec, and uncompressed video weights a LOT, as you've noticed).

I was using Fraps to cap some in-game footage for some tests but yeah its not mp3 audio, I think it is ac3 (this file is a compress from Vegas [SAVC]). Also I am loading the video file via the play in external player button in AvsP and in that situation there are no compression options.

I did some searching and found out about x264 and am currently running a test compress with it.

The reason I want to upscale to 1920x1080 is that it is not too far off from the current resolution and my 13 gig test file from Vdub (compressed it later in the actual vdub prog and not he AvsP version) looks good.

I just don't have the space to convert the entire video losslessly.


And eureka! using FFVideoSource lets Vdub use compression options, DirectShowSouce did not. I'll try a compression with Vdub and see what happens.

If anything, takes me a step closer to getting what I need done xD (all this drama because YouTube wont accept my 1680x1050 vids D:<).

geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Re: Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 6:23 am

geowil11_3 wrote:
mirkosp wrote:There are some mistakes you are doing that can cause various issues. For starters, you are using directshowsource. Since it is not frame accurate, its usage is discouraged (it can cause weird motion and audio de-sync). You should load mp4s with ffvideosource instead. Loading audio in avisynth is a bad idea too, and my guess is that your recording has aac audio, so my suggestion would be to leave the audio alone and remux it with the compressed video into an mkv or mp4, depending on what you want to do. If you however need to do an avi final encode and the avi isn't just a lossless mid-step, then you should look into using ffmpeg or eac3to to convert it. I don't know of any public builds of ffmpeg for win32 (which I'm assuming is the OS you're on), so eac3to is certainly an easier solution ─ there's a gui if you don't like command lines, too. Third thing you're doing wrong is the aspect ratio: 1680x1050 is a 16:10 aspect ratio, whereas 1920x1080 is 16:9. Upscaling is a bad idea imho, but if you REALLY need to upscale for whatever reason, then upscale to 1920x1200. Also, instead of bilinearresize, I'd suggest using spline36resize. EnsureVBRMP3Sync seems useless too in the script since I find it hard to believe that your audio is mp3 in there (it just seems more likely for it to have been recorded as aac or perhaps pcm, but I can very well be wrong since I don't know what software and settings you used for your recording) and it only serves its purpose when you have to trim within avisynth.
As for virtualdub, you are most likely overlooking the codec settings to use ─ if you want to do mp3 audio, then I'd say either convert the audio to wav with eac3to and compress it with lame mp3 in vdub or compress it to mp3 directly with eac3to and just have vdub mux it. For the video, you'll have to set it to fast recompress and choose xvid or divx or a similar lossy codec and set it properly (by default it uses no codec, and uncompressed video weights a LOT, as you've noticed).

I was using Fraps to cap some in-game footage for some tests but yeah its not mp3 audio, I think it is ac3 (this file is a compress from Vegas [SAVC]). Also I am loading the video file via the play in external player button in AvsP and in that situation there are no compression options.

I did some searching and found out about x264 and am currently running a test compress with it.

The reason I want to upscale to 1920x1080 is that it is not too far off from the current resolution and my 13 gig test file from Vdub (compressed it later in the actual vdub prog and not he AvsP version) looks good.

I just don't have the space to convert the entire video losslessly.


And eureka! using FFVideoSource lets Vdub use compression options, DirectShowSouce did not. I'll try a compression with Vdub and see what happens.

If anything, takes me a step closer to getting what I need done xD (all this drama because YouTube wont accept my 1680x1050 vids D:<).

Ok, tested it and seems to be good. So now, how can I get the footage into true 1920x1080? You know, without the black bars in the frame, right now it's just 1680x1050 video in a 1920x1080 frame.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Need a look over of my script

Post by mirkosp » Fri Jul 02, 2010 6:38 am

Just use spline36resize(1920,1200).crop(0,60,0,-60) from the 1680x1050. Trust me, the ar difference between 16:10 and 16:9 is there and noticeable, stretching is no solution, go for the cropping.
Image

geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Re: Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 6:45 am

mirkosp wrote:Just use spline36resize(1920,1200).crop(0,60,0,-60) from the 1680x1050. Trust me, the ar difference between 16:10 and 16:9 is there and noticeable, stretching is no solution, go for the cropping.
a compromise?

Code: Select all

FFVideoSource(source="M:\Gameplay Videos\Compressed\me1 playthrough part 1.mp4", seekmode=1)
Crop(240, 0, -240, -0)
nnedi2_rpow2(2,2,3,true,"spline36resize",1920,1080)
lsfmod()
the VDub preview window quality looks nice, wont be sure till its done tho (going for a 13 second test render).

geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Re: Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 6:55 am

geowil11_3 wrote:
mirkosp wrote:Just use spline36resize(1920,1200).crop(0,60,0,-60) from the 1680x1050. Trust me, the ar difference between 16:10 and 16:9 is there and noticeable, stretching is no solution, go for the cropping.
a compromise?

Code: Select all

FFVideoSource(source="M:\Gameplay Videos\Compressed\me1 playthrough part 1.mp4", seekmode=1)
Crop(240, 0, -240, -0)
nnedi2_rpow2(2,2,3,true,"spline36resize",1920,1080)
lsfmod()
the VDub preview window quality looks nice, wont be sure till its done tho (going for a 13 second test render).

Result of that script:

http://www.youtube.com/watch?v=0GIESHzHDAo

maybe some cropping off the top and bottom, but to me it looks good (best viewed in 1080p version [and I would kill someone for a damn edit button xD])

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Need a look over of my script

Post by mirkosp » Fri Jul 02, 2010 6:57 am

Wait wait what. Why are you cropping from left and right? That's making the ar even worse. Although I'm pleased by seeing nnedi2 used for the upscale... I didn't suggest it here, but yes, it is better. :P
EDIT: Edit button is available only in some sections unless you donate... (there are reasons for this, actually :uhoh: )
Image

geowil11_3
Joined: Wed Mar 31, 2004 8:16 pm
Org Profile

Re: Need a look over of my script

Post by geowil11_3 » Fri Jul 02, 2010 7:02 am

mirkosp wrote:Wait wait what. Why are you cropping from left and right? That's making the ar even worse. Although I'm pleased by seeing nnedi2 used for the upscale... I didn't suggest it here, but yes, it is better. :P
EDIT: Edit button is available only in some sections unless you donate... (there are reasons for this, actually :uhoh: )
yeah I did some searching and found a reply you made to ZetZu about up-scaling.

:o about the edit button lol

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Need a look over of my script

Post by Mister Hatt » Fri Jul 02, 2010 8:19 am

That is not how you upscale game footage with nnedi, you'll want to split planes for it. In this case, I would actually suggest spline36 over nnedi2 anyway, and I'm not going to explain why.

Locked

Return to “AviSynth Help”