Two Seconds of Black

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Kero777
Joined: Sun May 06, 2007 9:37 am
Org Profile

Two Seconds of Black

Post by Kero777 » Fri Jul 20, 2007 6:21 pm

I finally decided to ask after two hours of trying to figure out how to do this simple task. (Hehe, that rhymed). I was testing things out and created a test .avi file to try to do this should-be-easy-but-not-for-me little script. Here's what I have (separated to show you so it doesn't stretch the page):
BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
++AVISource("C:\Documents and Settings\User\Desktop\test.avi")
++BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
My video that's named "test" is at 23.976fps, so I'm pretty sure I did this correctly, but I keep getting an error that reads:
"Splice: Video framerate doesn't match.
C:\Documents and Settings\User\Desktop\script.avs, line 1"
I am trying to follow this guide here (I'm not submitting anything, just practicing how to use Avisynth scripts): http://www.animemusicvideos.org/guides/ ... s/#leaders.

If anyone has any suggestions, please give them. I bet anything I did something really silly (I have no idea where to add the "=last") that I will hit myself in the head for. :sweat:

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Fri Jul 20, 2007 7:07 pm

You need to establish variables to save values to, you can't simply concatinate values on the fly like that.

As for when you need to do video=last:
The first thing you have to do is store the video you've already got in a variable:

video=last
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
Kero777
Joined: Sun May 06, 2007 9:37 am
Org Profile

Post by Kero777 » Fri Jul 20, 2007 9:10 pm

BasharOfTheAges wrote:You need to establish variables to save values to, you can't simply concatinate values on the fly like that.

As for when you need to do video=last:
The first thing you have to do is store the video you've already got in a variable:

video=last
Thanks again for your reply.

I put "video=last" at the beginning of that script and it still doesn't work. I'm assuming I'm not supposed to take it so literally. Gomen nasai. Just as I said, I'm really new to this. I guess even more new to it than I thought I was. Lol. :sweat:

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Fri Jul 20, 2007 10:14 pm

Did you also set the variables up like I said before?
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
downwithpants
BIG PICTURE person
Joined: Tue Dec 03, 2002 1:28 am
Status: out of service
Location: storrs, ct
Org Profile

Re: Two Seconds of Black

Post by downwithpants » Sat Jul 21, 2007 9:50 am

BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
++AVISource("C:\Documents and Settings\User\Desktop\test.avi")
++BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
try

Code: Select all

layer(AVISource("C:\Documents and Settings\User\Desktop\test.avi").trim(0,47), BlankClip(48,640,480,"rgb32"), op="add",level=255)

++AVISource("C:\Documents and Settings\User\Desktop\test.avi")

++layer(AVISource("C:\Documents and Settings\User\Desktop\test.avi").trim(0,47), BlankClip(48,640,480,"rgb32"), op="add",level=255)
maskandlayer()|My Guide to WMM 2.x
a-m-v.org Last.fm|<a href="http://www.frappr.com/animemusicvideosdotorg">Animemusicvideos.org Frappr</a>|<a href="http://tinyurl.com/2lryta"> Editors and fans against the misattribution of AMVs</a>

User avatar
dokidoki
c0d3 m0nk3y
Joined: Tue Dec 19, 2000 7:42 pm
Status: BLEEP BLOOP!
Location: doki doki space
Contact:
Org Profile

Re: Two Seconds of Black

Post by dokidoki » Sat Jul 21, 2007 10:09 am

BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
++AVISource("C:\Documents and Settings\User\Desktop\test.avi")
++BlankClip(48,640,480,"rgb32",23976,1000,48000,true,true,000000)
BlankClip can "inherit" the properties of another clip.

v=AVISource("C:\Documents and Settings\User\Desktop\test.avi")
b=v.BlankClip(48)
b++v++b
BasharOfTheAges wrote:You need to establish variables to save values to, you can't simply concatinate values on the fly like that.
The first script posted is fine assuming it's all on one line and the video format is corrected. To find the video format use:
AVISource("C:\Documents and Settings\User\Desktop\test.avi").info()

But my script above is the quick and easy way.
Image Image Image
"Comedy is a dying breed." -- kisanzi // "Comedy. Serious business." -- dokidoki

User avatar
Kero777
Joined: Sun May 06, 2007 9:37 am
Org Profile

You Guys Rock! ^_^

Post by Kero777 » Sat Jul 21, 2007 12:56 pm

Thanks a lot, you three! It finally works! *Dances around happily* (Haha, I'm such a dork. :oops:) I wasn't really understanding what setting up the variables meant before.

I am curious about something:
I know the order of a script is very crucial. For example, If I wanted to add a script to "deblock" my footage, how would the order go? If I put Deblock(quant=25) after the last "++b," deblocking would only be going into effect after the last blank clip and therefore not take effect at all, correct? Let's say I was using the shortcut script DokiDoki gave me, would it work correctly with what I have below or would it be best to create a new .avs script, filter the video in the new script, and then add the new script to the one below, making sure to change test.avi to my new .avs file?
v=AVISource("C:\Documents and Settings\User\Desktop\test.avi")
b=v.BlankClip(48)
Deblock(quant=25)
b++v++b
I hope that makes sense. I really appreciate your help. :D

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Post by BasharOfTheAges » Sat Jul 21, 2007 1:10 pm

Just add the black in last.

so...

* load video
* do stuff to it (whatever you want)
* v=last (this will take the video with everything done to it and store it to v)
* create blank clips
* concatenate (b++v++b)
* ???
* profit
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
Kero777
Joined: Sun May 06, 2007 9:37 am
Org Profile

*Glomp*

Post by Kero777 » Sat Jul 21, 2007 2:29 pm

BasharOfTheAges wrote:Just add the black in last.

so...

* load video
* do stuff to it (whatever you want)
* v=last (this will take the video with everything done to it and store it to v)
* create blank clips
* concatenate (b++v++b)
* ???
* profit
Thank youuuuuu! I finally get it now. Before I was using "video=last" instead of "V" when I had b++v++b. Why I never caught that before... I'll never know. :lol:

I was just reading up on filters and since I read that they can only operate in the YV12 colorspace, if I do what the guide says here:
A&E's Guide wrote:...your video is probably in the RGB32 colorspace, or some other colorspace besides YV12. If your video isn't in YV12 already, then that means we need to convert the colorspace, like so:

AVISource("youramv.avi")
ConvertToYV12()
Is there a way I can/Should I convert it back to RGB32 after filtering? Will it make a difference?

User avatar
Kero777
Joined: Sun May 06, 2007 9:37 am
Org Profile

Re: *Glomp*

Post by Kero777 » Sun Jul 22, 2007 2:24 pm

A&E's Guide wrote:...your video is probably in the RGB32 colorspace, or some other colorspace besides YV12. If your video isn't in YV12 already, then that means we need to convert the colorspace, like so:

AVISource("youramv.avi")
ConvertToYV12()
Kero777 wrote:Is there a way I can/Should I convert it back to RGB32 after filtering? Will it make a difference?
Maybe it doesn't matter because ConvertToYV12() is only filtering that colorspace and not really changing the whole video's color? :? *Scratches head*
Thanks to: Qyot27, Jaddziadax, BasharOfTheAges, Scintilla, Post-It, Anubisx00, Kariudo and everyone else for helping this Newby out! :P

"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki

Locked

Return to “AviSynth Help”