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.

 

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

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th March 2008, 04:26   #1  |  Link
omion
Registered User
 
omion's Avatar
 
Join Date: Nov 2003
Location: San Diego, CA
Posts: 325
Using AviSynth in C without VfW

I am writing a program in the OCaml language, and I want to be able to access AviSynth directly to get frames from an AVS file.

The problem is that in order to link anything to OCaml I need to use a C interface (not C++), and I can't find any resources on how exactly to do that. It looks like there is a method of loading the DLL in C++ (avs2yuv does it), and there are headers and a library for doing plugins in C, but I don't know how to connect the two.

In the end, I want to be able to do something like this (in OCaml):
Code:
let avs = open_avs("some_file.avs");;
let big_fat_string = get_nth_frame(avs,20);;
close_avs(avs);;
Or something similar.

I looked into the VfW interface, but it doesn't look like it will output in YV12, which I need.

I have the C/OCaml interface covered, but I don't know enough C to figure out how to wedge AviSynth into the program.

Ideally, if somebody could post a little C snippet that would approximate the above code, that would be the most helpful. Any other suggestions would be appreciated as well.

Thanks!
__________________
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
omion is offline   Reply With Quote
Old 24th March 2008, 08:45   #2  |  Link
omion
Registered User
 
omion's Avatar
 
Join Date: Nov 2003
Location: San Diego, CA
Posts: 325
Nevermind. I think I got it figured out. I didn't realize I could call avs_create_script_environment, then invoke the "Import" filter with the AVS file as an argument.
I'm now dishing out frames in OCaml!
__________________
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2
omion 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 11:13.


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