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. |
|
|
Thread Tools | Search this Thread | Display Modes |
4th March 2015, 17:06 | #1 | Link |
Registered User
Join Date: Mar 2010
Posts: 79
|
Joining 2 AVS scripts and one base vide through FFMPEGS2 in a consistent colorspace
Items:
* 1 script that generates 5 seconds title with static image, converts output in YV12 * 1 base lossless AVI recording in YV12 * 1 script that generates 5 seconds ending with static image, converts output in YV12 Target: Merge all 3 in order with aligned space so the lack of audio will be filled with silence as per "AlignedSplice" specs. Code:
a = FFAudioSource("base.avi") v = FFVideoSource("base.avi") z = AudioDub(v, a) Crop(z,0, 96, -0, -96) Lanczos4Resize(z,1280, 720) # start titlev = AviSource("able-title.avs") titlea = BlankClip(titlev, audio_rate=48000) y = AudioDub(titlev, titlea) # end endv = AviSource("able-end.avs") enda = BlankClip(titlev, audio_rate=48000) x = AudioDub(endv, enda) AlignedSplice(y,z,x) |
4th March 2015, 17:30 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Taking a guess at what you are trying to do
Code:
a = FFAudioSource("base.avi") v = FFVideoSource("base.avi") z = AudioDub(v, a).Crop(0, 96, -0, -96).Lanczos4Resize(1280, 720).Trim(0,0) # start y = AviSource("able-title.avs").ResampleAudio(48000).Trim(0,0) # end x = AviSource("able-end.avs").ResampleAudio(48000).Trim(0,0) AlignedSplice(y,z,x) # Same as y++z++x Code:
return y.Info # same for z and x to see framerate etc Code:
a = FFAudioSource("base.avi") v = FFVideoSource("base.avi") z = AudioDub(v, a) Crop(z,0, 96, -0, -96) # Lanczos4Resize(z,1280, 720) # Result implicitly assigned to Last clip (NOT z) # start titlev = AviSource("able-title.avs") titlea = BlankClip(titlev, audio_rate=48000) # y = AudioDub(titlev, titlea) # You just killed off original audio (if there was any) # end endv = AviSource("able-end.avs") enda = BlankClip(titlev, audio_rate=48000) # x = AudioDub(endv, enda) # You just killed off original audio (if there was any) AlignedSplice(y,z,x) # z not cropped nor resized
__________________
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 ??? Last edited by StainlessS; 4th March 2015 at 17:43. |
4th March 2015, 17:39 | #6 | Link | |
Registered User
Join Date: Mar 2010
Posts: 79
|
Thanks for the suggestions, I figured out what caused issue:
Quote:
Any workarounds for what I want? |
|
4th March 2015, 17:47 | #9 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
16bit has to be in quotes audio = BlankClip(videoyuv, audio_rate=48000, sample_type="16bit", channels=2) |
|
4th March 2015, 17:50 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
My mistake, start and end are already silent. Below revised.
Code:
a = FFAudioSource("base.avi") v = FFVideoSource("base.avi") z = AudioDub(v, a).Crop(0, 96, -0, -96).Lanczos4Resize(1280, 720).Trim(0,0) # start titlev = AviSource("able-title.avs") titlea = BlankClip(titlev, audio_rate=48000, channels=2) # Stereo deprecated, changed to channels=2 y = AudioDub(titlev, titlea) # end endv = AviSource("able-end.avs") enda = BlankClip(titlev, audio_rate=48000, channels=2) x = AudioDub(endv, enda) y++z++x
__________________
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 ??? Last edited by StainlessS; 4th March 2015 at 18:03. |
4th March 2015, 17:59 | #12 | Link | |
Registered User
Join Date: Mar 2010
Posts: 79
|
Dammit, I hate inconsistent AviSynth syntax. Thanks, poisondeathray, it works.
Quote:
StainlessS This looks much cleaner than my monster, cheers. What is additional Trim() for? To get rid of possible overhead? Last edited by Kein; 4th March 2015 at 18:02. |
|
4th March 2015, 18:06 | #13 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Trim(0,0) just ensures audio same length as clip (for aligned splice), chops off excess or pads audio to video length.
EDIT: Note the edit in post #3, ie "# z not cropped nor resized".
__________________
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 ??? |
4th March 2015, 18:11 | #14 | Link |
Registered User
Join Date: Mar 2010
Posts: 79
|
Now that you mentioned it I have follow-up question: what if, or example, I don't need full base.avi but rather just specific range, starting from 00:01:00 to 00:15:00, or even few segments joined: xx:xx:xx-yy:yy:yy and aa:aa:aa-bb:bb:bb. is there anything I should keep in mind to avoid overstretched audio, delay/desync in audio?
Yep, BakaProxy mentioned that too, I took it into account later. Original audio never existed in a first place and I used the advice of poisondeathray in post #5 to refer to processed "z" for audiospecs. Last edited by Kein; 4th March 2015 at 18:14. |
4th March 2015, 18:19 | #15 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Just trim will do, specifying frame numbers rather than time.
Code:
T1=Trim(1000,1999) T2=Trim(3000,3999) TTOT = T1 ++ T2 # or whatever
__________________
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 ??? |
|
|