Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
18th February 2012, 15:00 | #1 | Link |
Registered User
Join Date: Nov 2008
Posts: 324
|
padding audio
I have several avi files that I want to join together and save as one file. These are clips that I created some time ago. It would appear that the audio is shorter than the video as, when joined, they gradually drift out of sync. The video lags.
Is it possible with avisynth to pad the audio stream to match the length of the video? Thanks. |
18th February 2012, 15:47 | #2 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
|
|
18th February 2012, 17:55 | #4 | Link |
Registered User
Join Date: Nov 2008
Posts: 324
|
I'm not joining them with avisynth. I'm using avisynth to open the avi's and resize, normalise etc. Then the saved avs scripts are processed to 264 & aac and joined externally. So "++" doesn't come into play unfortunately. I can't use avisynth to join them as there are 341 of them and I very quickly run out of memory!
If I used Trim(0,0) would that force the streams to match length? If need be how would I chop say 10 frames from the end of each one? Without changing each script manually! (The scripts are generated in a batch, I can add any number of filters but it must be the same for each script) Last edited by Floatingshed; 18th February 2012 at 18:39. |
18th February 2012, 21:34 | #6 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Trim(0,FrameCount() -1 - 10)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
19th February 2012, 02:22 | #7 | Link | |
Registered User
Join Date: Sep 2011
Posts: 86
|
Quote:
If you have harddrive space you can join 25 together at a time into a lossless intermediate. Code:
@ECHO OFF SET maxsources=25 SET customsource="C:\Program Files (x86)\anrichan3.3\cs.avs" SET counter=0 SET counterB=0 CD %~1 IF EXIST "spliced\" ( ECHO Spliced files already exist. OVERWRITING?!? PAUSE ) MKDIR "spliced\" SETLOCAL EnableDelayedExpansion FOR %%G IN ("*.avi") DO ( IF !counter! EQU 0 ( ECHO import^(%customsource%^) > "spliced\!counterB!.avs" ) ELSE ( ECHO \++\ >> "spliced\!counterB!.avs" ) ECHO customsource^("%%~fG"^) >> "spliced\!counterB!.avs" SET /A counter += 1 ECHO !counterB!.!counter! %%~fG IF !counter! EQU %maxsources% ( SET /A counter = 0 SET /A counterB += 1 ) ) ECHO Encode Files? PAUSE CD "spliced" SET vdub="C:\Program Files (x86)\anrichan3.3\VirtualDub-1.9.7\vdub.exe" SET vcf="C:\Program Files (x86)\anrichan3.3\spliced.vcf" FOR %%G IN ("*.avs") DO ( %vdub% "%%G" /i %vcf% "%%~nG.avi" ) PAUSE Code:
function customsource(string X){ avisource(X).converttorgb32 (height==216) ? addborders(0,4,0,4) : nop() (width==368) ? lanczosresize(320,224) : spline36resize(320,224) } Code:
VirtualDub.audio.SetSource(1); VirtualDub.audio.SetMode(0); VirtualDub.audio.SetInterleave(1,500,1,0,0); VirtualDub.audio.SetClipMode(1,1); VirtualDub.audio.SetConversion(0,0,0,0,0); VirtualDub.audio.SetVolume(); VirtualDub.audio.SetCompression(); VirtualDub.audio.EnableFilterGraph(0); VirtualDub.video.SetInputFormat(0); VirtualDub.video.SetOutputFormat(0); VirtualDub.video.SetMode(1); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); VirtualDub.video.SetCompression(0x7367616c,0,10000,0); VirtualDub.video.SetCompData(1,"AA=="); VirtualDub.video.filters.Clear(); VirtualDub.audio.filters.Clear(); VirtualDub.SaveAVI(VirtualDub.params[0]); Last edited by gyth; 19th February 2012 at 02:27. |
|
|
|