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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th February 2003, 16:56   #1  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Drag and Drop, perhaps?

It would be great if we could drag and drop a file on an AVS like a batchfile. For example, the INFO parameter of avisynth is very useful. Let's say you wanted a drag and drop avs for the info command of avisynth. Would this be something the developers would consider implementing, or does the architecture of avisynth preclude this?:

#drag and drop info for avi files
#Info
set fname=%1% #(or whatever convention)(Imaginary)
avisource(fname).info
DDogg is offline   Reply With Quote
Old 26th February 2003, 00:05   #2  |  Link
Unarmed
Registered User
 
Join Date: Feb 2003
Location: Ames, IA
Posts: 9
You could make a batch file that would create the .avs and then run it for you:

echo AVISource("%1").info > %temp%\info.avs
"C:\Program Files\Windows Media Player\mplayer2.exe" "%temp%\info.avs"

Then you could drag & drop onto the batch file.

Edit: It looks like you don't need the quotes around %1 on the first line for drag and drop; Windows inserts them for you.

Last edited by Unarmed; 26th February 2003 at 00:14.
Unarmed is offline   Reply With Quote
Old 26th February 2003, 01:12   #3  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Very, very nice workaround. Thanks much. Works like a charm.

I still hope for a reply on the original topic.
DDogg is offline   Reply With Quote
Old 27th February 2003, 09:06   #4  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
This might be what you are looking for:

http://tangentsoft.net/video/asynther/
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 28th February 2003, 01:14   #5  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Thanks for the reply but no, I was hoping a file dragged upon an avisynth script would read the filename in as a variable the same way a batch file does and run the AVS. Would this be so difficult to do? I am absolutely sure you would be using it all the time.

DD
DDogg is offline   Reply With Quote
Old 28th February 2003, 04:51   #6  |  Link
vhelp
Registered User
 
vhelp's Avatar
 
Join Date: Feb 2003
Posts: 299
hi DDogg..

I'm curious.. do you mean, a user would proceed to click on an
* an .AVS file (ie, an icon w/ .avs extention ie, superman.avs)
* on a suposed container or .exe app that intercepts files,
* and reads their format (ie, .AVS and directs it to the VFAPI
.. plugin)
* thereby running AVIsynth, and as a result..
.. (give or take a little code) and (just for your scenario)
.. display some info about this .avs file ?? ?? ??

So..

scenario:
---------
* a user want to get some INFO on file: "superman.avs"
* he/she clicks it, and drags it to an AVS aware app
* as a result, AVIsynth is somehow loaded up and begins parsing/
..reading the file "superman.avs"
* as a result of this click and drag, a final display would be:

Superman AVS info:
--------------------------
Height & Width: 720x480
Length: 120 minutes
Media type: Film / 24fps
Source: mjpeg


If the above is what you're looking for, that's an interesting idea,
but you could get that by double-clicking or opening up in notepad.
Or, are you after something else all-to-gether ??

-vhelp
__________________
ESC K7S5A / XP 1800+ / Windows 98
ADVC-100[dvio] / WTVGO[avio] / DC10+[avio] / Canon ZR-10 / Delphi 6 Personal / JVC S-VHS HR-S3910U / Durabrand SSS w/ DVD Player STS75E / Sony TRV-22
FithElement/Dogma/BladeRunner/Contact
vhelp is offline   Reply With Quote
Old 28th February 2003, 09:14   #7  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Um, yes, Unarmed's workaround example shows exactly how to do that.

Simply save this in notepad as info.bat You can then drag any AVS, AVI onto it and see the information you gave in your question.

Like this:

Rem start of batchfile
@echo AVISource(%1).info > %temp%\info.avs
@"C:\Program Files\Windows Media Player\mplayer2.exe" "%temp%\info.avs"
rem end of batchfile

To answer you question more specifically, Windows is a drag and drop OS. Avisynth is used in Windows. The ability to be able to drop a file on a set of "toolkit" scripts would be a tremendous time saver. In a similar fashion, I don't even open a program to burn a disk. I just drag the CUE onto a small batchfile and it is done. Simple and elegant.

To get back to the topic, I had asked "Would this be something the developers would consider implementing, or does the architecture of avisynth preclude this?"

Look if it can't be done then so be it. If it can, and is reasonably simple, IMO, it ought to be done. As I can't do it, all I can do is ask and hope for a direct answer to my question.

Last edited by DDogg; 28th February 2003 at 09:35.
DDogg is offline   Reply With Quote
Old 28th February 2003, 11:13   #8  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Have you looked at the link I posted???

It makes it possible to use the "Send-To" menu to send files into templates, and create the AVS files you want.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 28th February 2003, 16:50   #9  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
I think support for those same templates is also buit into VirtualdubMod. I use them to open .d2v files now.

But I don't know if that helps the drag-n-drop thing any. You can drop avi or avs files on Vdubmod but I don't think you can drop files on templates yet. This would be nicer.

- Tom
trbarry is offline   Reply With Quote
Old 28th February 2003, 19:14   #10  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
@sh0dan, yes I use it a lot. Thanks.
Quote:
...but I don't think you can drop files on templates yet. This would be nicer.
Yes, it would be much more elegant. Maybe some day.
DDogg is offline   Reply With Quote
Old 28th February 2003, 21:09   #11  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
Quote:
Originally posted by trbarry
I think support for those same templates is also buit into VirtualdubMod. I use them to open .d2v files now.
Absolutely right. I used code from AviSynthesizer for the template engine.

I someone has a use for this I could add an option to vdubmod that pops up a window allowing selection of a template to open it with.

Cheers
Belgabor
__________________
VirtualDubMod [SourceForge : Tracker/DL] (FAQ, Some rules)
Be sure to also download the latest DLL package or get the all inclusive package!
Before you post questions, please read the VirtualDub and/or VirtualDubMod FAQ.
If you have a bug report or feature request for VirtualDubMod, be sure to read the rules first.
We give 100% of your donations to the Open Source community
Belgabor is offline   Reply With Quote
Old 1st March 2003, 04:55   #12  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
Quote:
I someone has a use for this I could add an option to vdubmod that pops up a window allowing selection of a template to open it with.
I'd like that.

I guess it would just be a choice of whether the default dragondrop open behavior was open or the Open-with-Avisynth dialog. Right?

Or something else?

- Tom
trbarry is offline   Reply With Quote
Old 1st March 2003, 17:46   #13  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
A general question:

1> When programming, what is required to make a application drag and drop aware, that is, for it to highlight when something is dragged on top of it and be passed the name of what was dragged on top of it?
DDogg is offline   Reply With Quote
Old 1st March 2003, 20:40   #14  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
Quote:
Originally posted by trbarry
I'd like that.

I guess it would just be a choice of whether the default dragondrop open behavior was open or the Open-with-Avisynth dialog. Right?

Or something else?

- Tom
Yup, thats what I was thinking of

@DDogg: As I never implemented that myself I can only recommend to read the VDub Source on that.
__________________
VirtualDubMod [SourceForge : Tracker/DL] (FAQ, Some rules)
Be sure to also download the latest DLL package or get the all inclusive package!
Before you post questions, please read the VirtualDub and/or VirtualDubMod FAQ.
If you have a bug report or feature request for VirtualDubMod, be sure to read the rules first.
We give 100% of your donations to the Open Source community
Belgabor is offline   Reply With Quote
Old 2nd March 2003, 22:23   #15  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
@DDogg: As I never implemented that myself I can only recommend to read the VDub Source on that.
I was asking more about windows apps in general than vdub specific, but thanks for the reply.
DDogg is offline   Reply With Quote
Old 3rd March 2003, 18:04   #16  |  Link
Belgabor
VDubMod Devel
 
Belgabor's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 824
Quote:
Originally posted by DDogg
I was asking more about windows apps in general than vdub specific, but thanks for the reply.
VDub is a windows app
__________________
VirtualDubMod [SourceForge : Tracker/DL] (FAQ, Some rules)
Be sure to also download the latest DLL package or get the all inclusive package!
Before you post questions, please read the VirtualDub and/or VirtualDubMod FAQ.
If you have a bug report or feature request for VirtualDubMod, be sure to read the rules first.
We give 100% of your donations to the Open Source community
Belgabor is offline   Reply With Quote
Old 4th March 2003, 02:13   #17  |  Link
Atamido
Seņor Member
 
Atamido's Avatar
 
Join Date: May 2002
Location: Austin, Texas
Posts: 915
Quote:
Originally posted by DDogg
1> When programming, what is required to make a application drag and drop aware, that is, for it to highlight when something is dragged on top of it and be passed the name of what was dragged on top of it?
For basic VB controls, it is automatic within windows. For instance, in Visual Basic, if you create a text box within the interface, it will automatically accept text dragged to it. So, I would assume its just a matter of finding the correct control object, and defining a simple property for the window itself. But I have never done this, so I wouldn't know for sure.

You might glance at the sources for DivFix as I know it supports drag and drop of files.
Atamido is offline   Reply With Quote
Old 16th August 2012, 03:02   #18  |  Link
NoX1911
Registered User
 
NoX1911's Avatar
 
Join Date: Aug 2003
Location: Germany
Posts: 186
*necrobump*

Please implement drag&drop. Filenames are passed as simple arguments to the exe/dll. It is indeed very useful.

I would use it to analyze YUV range (16..235) with histogram. Those damn (Apple/QT?) h264/MP4s are mostly 0..255 nowadays and no windows player (i'm aware of) respects the corresponding metadata (so i have to handle it manually). Histogram is a nice way to check it.
NoX1911 is offline   Reply With Quote
Old 22nd August 2012, 08:31   #19  |  Link
pbristow
Registered User
 
pbristow's Avatar
 
Join Date: Jun 2009
Location: UK
Posts: 269
As I understand it, what people are asking for here is the ability to drag a video file to a particular avisynth script, and have that script executed using the video file as input. (If I've misunderstood, NoX1911, then please explain exactly what you want to do.)

Unfortunately, this is not something that can be done by making changes to Avisynth. Windows allows you to open a given file in a suitable *application*, by dragging the file and drop it onto the application.

Problem 1: An avisynth script is not an application: It's simply a text file that has to be interpreted *by* an application.

Problem 2: Even Avisynth itself is not an application: It's a frameserver designed to feed video to an application that knows what to do with the output from Avisynth.

Problem 3: Avisynth doesn't have a way of accepting filenames from the outside world to be inserted into a pre-existing script. Again, that's something that has to be done by an active application that has access to information coming from the Windows drag-and-drop interface. Avisynth isn't an application in its own right, so has no access to that.

So, to combine a video file with an avisynth script, and get it opened and read by avisynth, you need at least 4 things: The file, the script, Avisynth, and the application that calls Avisynth. But drag-and-drop only allows the user to create an association between *two* things.

Fortunately, Windows DOES provides a way to create pre-defined associations between things in a form that looks like an executable application: It's called a batch file or .BAT file. If we create a batch file to handle the relationships between our four things, then we can drag our video file onto *that*, and let it sort out the mess.

So, what people need (as I understand the oroginal post) is a batch file that:
1. Receives the name of the video file (either from the drag-and drop interface, or from a command line or some other method of invocation, the batch file doesn't care);
2. Inserts that filename into the right place in a template avisynth script, and writes the result as a new .AVS file;
3. Opens an avisynth-aware application, passing it the name of the newly created .AVS file as input.

Now, when we drag a video file to this .BAT file, it will open up our chosen application, which will see that it's being asked to open an avisynth script. The application passes the script over to Avisynth; Avisynth interprets the script and opens the video file... and at that point everything is back in the hands of the user, to tell the application what they want done next. (If the application is a video player, it might start playing the output of the script immediately. That depends on the player and how it's set up.)

*IF* the application is an editor that accepts command line arguments to tell it what to do with its input file, then you could add those into the BAT file, and create something that automatically creates an output file using the avisynth script. But that all depends on the capabilities of your video app (I only ever use Virtualdub, which I don't think allows that kind of command-line control...?).

So, to sum up: Making Avisyth scripts usable via drag-and-drop can't be done by making changes to Avisynth, but *you* can do it by writing your own batch file.

Last edited by pbristow; 22nd August 2012 at 08:43.
pbristow is offline   Reply With Quote
Old 22nd August 2012, 17:30   #20  |  Link
Zarxrax
Registered User
 
Join Date: Dec 2001
Posts: 1,228
This can also pretty much be done with avsp or avspmod
Zarxrax is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.