PDA

View Full Version : Is there a way to get interlaced/progressive info out of VWF.pas


Amnon82
11th October 2005, 16:47
http://www.koders.com/delphi/fidF901E0AEC29ECBF67266B86173AA1121B5BB4430.aspx

I'm coding in delphi. I want to ask you guys if I can use VWF.pas to check if the avs-script is progressive. FPS, Resolution I've already. I only need a option to detect the flags.

I did this till now:

{The GetAVSFrames function will give You the Info about the AVS-File
(C) 2005 by Amnon}

function GETAVSFRAMES(avifn: string): Boolean;
var
Error: Integer;
pFile: PAVIFile;
AviInfo: TAVIFILEINFOW;
sError: string;
begin
Result := False;
// Initialize the AVIFile library.
AVIFileInit;

// The AVIFileOpen function opens an AVI file
Error := AVIFileOpen(pFile, PChar(avifn), 0, nil);
if Error <> 0 then
begin
AVIFileExit;
sError:='Error: This file is not an AVISynth-Script. Check it!';
Messagebox(Application.Handle, pchar(sError), pchar('Error'),
MB_ICONERROR);
Exit;
end;

// AVIFileInfo obtains information about an AVI file
if AVIFileInfo(pFile, @AVIINFO, SizeOf(AVIINFO)) <> AVIERR_OK then
begin
// Clean up and exit
AVIFileRelease(pFile);
AVIFileExit;
Exit;
end;

// Show some information about the AVI
Form1.AVSFRAMES.text:=IntToStr(AVIINFO.dwLength);
Form1.avsheight.text:=IntToStr(AVIINFO.dwheight);
Form1.avswidth.text:=IntToStr(AVIINFO.dwWidth);
Form1.rate.text:=formatfloat('0.000',AVIINFO.dwRate/AVIINFO.dwScale);
form1.flags.text:=inttostr(aviinfo.dwFlags);
end;

with dwFlags I got 272. Stands this for PFF?

Prodater64
11th October 2005, 21:29
Quoted from: http://www.avisynth.org/FieldBasedVideo

Interlaced and Field-based video

Currently (v2.5x and older versions), AviSynth has no interlaced flag which can be used for interlaced video. There is a field-based flag, but contrary to what you might expect, this flag is not related to interlaced video. In fact, all video (progressive or interlaced) is frame-based, unless you use AviSynth filters to change that.

So i think that you can't to know if a source is interlaced or progressive through avisynth. Further than this, i don't think there is an automatic way to know that.
I also would wish that it would had one way.

Inc
11th October 2005, 21:50
Quick'n dirty but shure optimizable:

Via simple VFW calls:
Do generate a conditional environment based script. Where "IsCombed" could detect combs in a "sliced" video, IF combs are recognised, then this will remarked in a txt file using the avs's internal textfilewriter. ---> But very unprecise as the more precise, the more samples have to be inspected.

Via Avisynth.dll .... Do call the API of the avisynth.dll and build a scriptenvironment where you maybe could uses teh function invoke for generating the filter flow means the conditional environment. But these are just bricks of a "guess" as I never directly called avisynth.dll's API. But as avisynth.pas for dlphi exists, then you should look at warpenterprises or some other avisynth.dll wrappers written in delphi to see how it works.

Amnon82
16th October 2005, 00:07
thx inc, thx prodater. I'll give it a try.