PDA

View Full Version : Numer of Frames from .D2V-File


Chatwalker
14th October 2002, 08:49
Hi

I need to count the number of frames from a .D2V-Project-File made by DVD2AVI. With PAL-Movies there is only the value 2 for I,P and B frames. So i was able to determine the whole number of frames by countig this value.
With NTSC-Movies there are the values 0,1,2 and 3 for the frames. The summation of appearances did not match with the total amount of frames. Did anyone knows the meaning for the values 0,1,2,3 and how to calculate the total amount of frames from this values or their appearances?

Regards
Chatwalker

mpucoder
14th October 2002, 15:19
What field is this value in? There are many fields, with many values. Also, which number of frames do you want? For NTSC there are the coded frames and the displayed frames. Your count is probably the correct for the coded count.
Possibly you are talking about the combined tff/rff flags (which are not adjacent in memory). If so, count the frames with the rff flag (which would be values 1 and 3) as 1.5 displayed frames.

int 21h
16th October 2002, 04:03
Simple Solution: Import from Mpeg2dec.dll and get the frame count from that.

Chatwalker
17th October 2002, 19:45
Hi

Thank you for your replies.


@Int 21h
Can you explain, how to get the Framecount with MPEG2DEC.DLL?

Chatwalker

int 21h
17th October 2002, 22:34
You'll have to look at the source of mpeg2dec.dll because I can no longer remember (its been replaced in my brain by something else evidently more important).

2COOL
8th November 2002, 09:00
Hi,

Just open the .d2v file in FitCD. You'll see how many frames there are and more. FitCD is freeware too.

TheUnforgiven
9th November 2002, 12:45
u can also open the d2v file in QuickAVS:
http://forum.doom9.org/showthread.php?threadid=37626
and it will show the number of frames immediately

llemor
10th November 2002, 09:52
Can you explain, how to get the Framecount with MPEG2DEC.DLL?

First, create temporary avs file pointing to your "d2v" file via mpeg2source function. Then, open the avs file using API functions for AVI file:

-AVIFileInit
-AVIFileOpen
-AVIFileGetStream
-AVIStreamLength => this will give you the number of frames
-AVIFileStreamInfo => you can get info from AVISTREAMINFO struct
-AVIFileExit

Hope this will help you. ;)

Chatwalker
11th November 2002, 15:08
@Ilemor

Thanks!!!!!

That is the answer i was looking for.

Chatwalker

int 21h
11th November 2002, 15:23
You can skip the .avs step by directly referencing the functions in mpeg2dec.dll, the url I meant to reference is here: http://aquaplaning.20m.com/


var MPEG2videoInfo: PVideoInfo;
MPEG2frame: TBitMap;
isMPEG2VideoOpen: boolean;
MPEG2DllName: String;

// direct access to DLL function's
openMPEG2Dll: function(name: PChar): PVideoInfo; stdcall;
closeVideoDll: procedure; stdcall;
getRGBFrameDll: function(frame: integer): PByteArray; stdcall;
getFrameDll: function(frame: integer): PByteArray; stdcall;

// capsulated functions for delphi, recommended for use
procedure openMPEG2(name: String);
procedure closeVideo;
procedure getFrame(frame: integer);
procedure getRGBFrame(frame: integer);
function getWidth: integer;
function getHeight: integer;
function getFrameCount: integer;
function getFPS: float;


The full source code is available at the Aquaplaning's site, and is a good example of how to skip the avs step.

Beave
7th April 2003, 12:39
Does anybody know a function or a external program with which I could get the Framecount from a D2V File out of a vbscript?
It could also be a avisynth plug-in which can write to a file, which I can read from afterwards.

Can somebody help?

Guest
8th April 2003, 02:51
Originally posted by Chatwalker
Did anyone knows the meaning for the values 0,1,2,3 and how to calculate the total amount of frames from this values or their appearances? The 0 and 2 values count for 1 frame each. The 1 and 3 values count for 1.5 frames each. This is so because the 1 and 3 values have the 3:2 pulldown repeat_first_field flag set.

Guest
8th April 2003, 02:54
Originally posted by Beave
Does anybody know a function or a external program with which I could get the Framecount from a D2V File out of a vbscript?
It could also be a avisynth plug-in which can write to a file, which I can read from afterwards.

Can somebody help? Maybe this will help you. Get this:

http://shelob.mordor.net/dgraft/tools/ParseD2V.zip

Run it from a DOS prompt like this:

ParseD2V your_d2v.d2v >out

Then look at the file out.

If you want the parsing source code, let me know.

DoC hEx
8th April 2003, 03:14
If you want the parsing source code, let me know.

I would like the code please :D

Guest
8th April 2003, 03:32
It's primitive but it does the job. :)

[attached below, please wait for approval]

Beave
17th October 2003, 14:32
I would like the Sourcecode too, but the attachement isn't shown. Could you offer it on your site maybe?

Guest
18th October 2003, 18:10
http://neuron2.net/tools/parsed2vsrc.zip