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. |
24th March 2008, 04:26 | #1 | Link |
Registered User
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);; 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 |
24th March 2008, 08:45 | #2 | Link |
Registered User
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|