PDA

View Full Version : Determine video stream saving in the script


dum
23rd November 2007, 18:43
Hi, cannot someone tell me: can I determine (or even - have some influence) on file videofile saving in my script. For example I have script like this:

AVISource("some.avi")
#
# Make necessary transformations of avi-file
#

and after all this I want to save it to the file, without using "Save as..." option of VirtualDubMod (I use this one, but it doesn't matter), because I want to make a king of automation. Is it possible? What opportunities I have? What functions I have to read about?

tsp
23rd November 2007, 18:51
short answer: No

Not from within the script at least unless you use a special filter that can interact with the program that opened the AviScript and I'm not aware of such a special filter.

dum
25th November 2007, 15:23
Does anyone know and can give me the reference to the filter, which can help my?

smok3
25th November 2007, 15:28
you can avtomate virtualdub throught the use of vdub.exe (dunno if that was there in virtualdubmod era thought).

example windows .bat, save audio:

rem purpose - to extract audio to separate file where it can be procesed further

@ECHO OFF
echo ------------------------------------ vdub extract audio to pcm
title extract audio to pcm %1

echo VirtualDub.Open(VirtualDub.params[0]); > "%~dp1%~n1.script"
echo VirtualDub.SaveWAV(VirtualDub.params[1]); >> "%~dp1%~n1.script"

@vdub /i "%~dp1%~n1.script" "%~dp1%~n1%~x1" "%~dp1%~n1.wav"

del "%~dp1%~n1.script"

dum
26th November 2007, 03:36
Ok, yes I can do like this. But, nevertheless, may be someone knows the avisynth filter, which exactly saves video data to AVI file (in other words - saves file, having PClip)?

squid_80
26th November 2007, 08:22
Something like the twriteavi (http://forum.doom9.org/showthread.php?t=121869&highlight=twriteavi) filter? You still need something to play through the script (hint: search for avsutil). Avisynth is designed to frameserve, not write files itself.

dum
26th November 2007, 23:58
Thanks a lot! Exactly what I have meant (if someone know any other filters like this - please, let me know).

But, squid_80, what do you mean, when you say that I'll "need something to play through the script"?

squid_80
27th November 2007, 02:20
It won't write a whole avi file as soon as the script is opened, you have to view all the frames so that they are processed by the filter and written out.

dum
29th November 2007, 01:06
Someone knows any other filters like that TWiteAvi, which write video stream to the file, from AviSynth script?

dum
29th November 2007, 03:35
squid_80, can you please send me a working sample script, which uses TWriteAvi. Thank you beforehand.