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 > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th October 2002, 08:49   #1  |  Link
Chatwalker
Registered User
 
Join Date: Jul 2002
Location: Bremen,Germany
Posts: 35
Numer of Frames from .D2V-File

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
Chatwalker is offline   Reply With Quote
Old 14th October 2002, 15:19   #2  |  Link
mpucoder
Moderator
 
Join Date: Oct 2001
Posts: 3,530
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.
mpucoder is offline   Reply With Quote
Old 16th October 2002, 04:03   #3  |  Link
int 21h
Still Laughing
 
int 21h's Avatar
 
Join Date: Oct 2001
Location: Around
Posts: 1,312
Simple Solution: Import from Mpeg2dec.dll and get the frame count from that.
int 21h is offline   Reply With Quote
Old 17th October 2002, 19:45   #4  |  Link
Chatwalker
Registered User
 
Join Date: Jul 2002
Location: Bremen,Germany
Posts: 35
Hi

Thank you for your replies.


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

Chatwalker
Chatwalker is offline   Reply With Quote
Old 17th October 2002, 22:34   #5  |  Link
int 21h
Still Laughing
 
int 21h's Avatar
 
Join Date: Oct 2001
Location: Around
Posts: 1,312
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).
int 21h is offline   Reply With Quote
Old 8th November 2002, 09:00   #6  |  Link
2COOL
PGC Navigator in Training
 
2COOL's Avatar
 
Join Date: Oct 2002
Location: NTSC Land
Posts: 3,552
Hi,

Just open the .d2v file in FitCD. You'll see how many frames there are and more. FitCD is freeware too.
2COOL is offline   Reply With Quote
Old 9th November 2002, 12:45   #7  |  Link
TheUnforgiven
XviDer
 
TheUnforgiven's Avatar
 
Join Date: Jun 2002
Posts: 190
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
__________________
www.the-unforgiven.info
TheUnforgiven is offline   Reply With Quote
Old 10th November 2002, 09:52   #8  |  Link
llemor
Registered User
 
llemor's Avatar
 
Join Date: Feb 2002
Posts: 123
Quote:
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.
llemor is offline   Reply With Quote
Old 11th November 2002, 15:08   #9  |  Link
Chatwalker
Registered User
 
Join Date: Jul 2002
Location: Bremen,Germany
Posts: 35
@Ilemor

Thanks!!!!!

That is the answer i was looking for.

Chatwalker
Chatwalker is offline   Reply With Quote
Old 11th November 2002, 15:23   #10  |  Link
int 21h
Still Laughing
 
int 21h's Avatar
 
Join Date: Oct 2001
Location: Around
Posts: 1,312
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/

Code:
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.
int 21h is offline   Reply With Quote
Old 7th April 2003, 12:39   #11  |  Link
Beave
Registered User
 
Join Date: Nov 2001
Posts: 205
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?
Beave is offline   Reply With Quote
Old 8th April 2003, 02:51   #12  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Re: Numer of Frames from .D2V-File

Quote:
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 is offline   Reply With Quote
Old 8th April 2003, 02:54   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Quote:
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.
Guest is offline   Reply With Quote
Old 8th April 2003, 03:14   #14  |  Link
DoC hEx
2 VB R !2 VB Dat is D Q?
 
DoC hEx's Avatar
 
Join Date: Nov 2001
Posts: 110
Quote:
If you want the parsing source code, let me know.
I would like the code please
DoC hEx is offline   Reply With Quote
Old 8th April 2003, 03:32   #15  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
It's primitive but it does the job.

[attached below, please wait for approval]

Last edited by Guest; 8th April 2003 at 03:34.
Guest is offline   Reply With Quote
Old 17th October 2003, 14:32   #16  |  Link
Beave
Registered User
 
Join Date: Nov 2001
Posts: 205
I would like the Sourcecode too, but the attachement isn't shown. Could you offer it on your site maybe?
Beave is offline   Reply With Quote
Old 18th October 2003, 18:10   #17  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
http://neuron2.net/tools/parsed2vsrc.zip
Guest 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 12:47.


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