Log in

View Full Version : MPEGDecoder.dll (Direct VOB/M2v -> AviSynth)


Pages : 1 2 3 4 5 6 7 [8] 9 10

Nic
12th January 2003, 22:45
Sorry about the lack of source, id uploaded the file as MPEGDecoder_Src.zip rather than MPEGDecoder_src.zip. Doh! Source is now up, please dont make changes to it and re-release it yet unless you do it through me. There are so many things I want to add (and have just to turn on really) that I dont want different versions to get out of sync...(IMHO there are too many versions of mpeg2decgoing around as it is :) )
(also I put a link to mpegdecoder.zip twice, duh! how dumb am I (I dont want an answer to the BTW ;) )

The seeking seemed to work ok on the files I had. Must have made a dumb mistake somewhere ill fix that now.

Expect alot more to come, ill add post-processing as well.

@kurosu:
Could you send me the d2v file of that (the original one rather than the one MPEGDecoder made). email addr is at the bottom of the help.

Cheers,
-Nic

spyder
12th January 2003, 22:55
Why do I get a "Unrecognized Exception" at the line of my script that opens a D2V file? I know it is the correct path and the files have not been moved. It opens fine if I switch the MPEGSource to an MPEG2Source and use MPEG2DEC3. If I open the VOBs I still get the error but after D2V creation...

If you need more info just ask.

Kurosu
12th January 2003, 23:02
@spyder
My ideas on your problem:

1) Are you sure you got Nic's package from my direct link?
2) If yes, are you using Avisynth 2.5, the only one to support YV12 ? :D
3) If yes, maybe you could try to use trim

Strangely, MPEGDecoder 1.32 under AVS 2.07 produces such an exception, but it's gone if I trim the video)

Nic
12th January 2003, 23:11
@spyder:
Hmmm, the code should work on any mmx PC. What type of CPU do you have. Check that your running the correct version of avisynth for the correct version of MPEGDecoder (the YV12 version will only run on avisynth2.5 and the normal version will only run on AviSynth 1.x & < 2.5
(actually, I dont have version 2.x on my computer, maybe thats the problem...ill check that now also (only checked with 1.05)

Comparing MPEGDecoder 1.32 and 2.0 is not a good idea, because the code is so different, I had MPEGDecoder 2.0 running on a K6-2 400. Hopefully the new links on my web page are working
( http://nic.dnsalias.com )

Cheers,
-Nic

seewen
12th January 2003, 23:15
I've got a litle question :

I don't understand exactly how it's possible that MpedDecoder-YV12 is able to open MPEG-1 througth D2v...

If I try to open this MPEG-1 ( it's in fact a VCD) with DVD2AVI, it freeze... But with MpegDecoder-2.0a, it works very well.


And I find this even stranger, beccause MpegDecoder-1.32 ( for Avisynth 2.0x ) don't use D2v when opening MPEG-1/VCD.


Someone know, in 2 words, where's the trick ?

( btw, MpegDecoder-YV12-2.0 works very well with VCD's. It seems like it opens files faster than 1.32, and it seek faster in Vdub too. )

Nic
12th January 2003, 23:20
MPEG-1 = subset of MPEG-2

of more precisely
MPEG-2 is a superset of MPEG-1

Thats as few words as I could do? ;) I.e. the d2v file is just used for finding the number of frames. the startcodes to signify GOPs etc are the same for both. So I can get the same info.

Also in two words: I rule ;) (just kidding :) )

Cheers,
-Nic

FuPP
12th January 2003, 23:57
I've done a few/quick tests between mpegdecoder (thx Nic !) and mpeg2dec3 :

mpegdecoder command line : mpegsource("F:\tests\vts_01.d2v")
mpeg2dec3 command line : mpeg2source("F:\tests\vts_01.d2v",cpu=0,idct=2)

(MPEG2 ENCODE)

mpegdecoder speed gain : + 12,5 % :)
mpegdecoder compressibility : - 5 % :(

Any ideas / comments ?

Regards,

FuPP

Edit : Oops, just realized that both encodes did not start from the same frame : I'm afraid there's a bug in mpegdecoder -> wrong frame counting. But the good news is that it could explain the compressibility loss !

cult
13th January 2003, 00:15
@Nic
same here.Original film is 154646 frames,while mpegdecoder claims that is 231970 frames(wrong)

seewen
13th January 2003, 00:22
yes exactly the same here. I didn't noticed it at once ( just realized when I saw that the DivX were really to small ;-)


First VCD 67'499 frames : Detected by MpegDecoder=40'579
Second VCD 64'659 frames : Detected by MpegDecoder=48'314.

I tried to specify the number of frame in the AVScript, and to use the "0" parameter ( and of course, try to with none params ;) ).
And it's everytime the same result.

@Nic
Thank for the short explanation ;)

spyder
13th January 2003, 00:29
Originally posted by Kurosu
@spyder
My ideas on your problem:

1) Are you sure you got Nic's package from my direct link?
2) If yes, are you using Avisynth 2.5, the only one to support YV12 ? :D
3) If yes, maybe you could try to use trim

Strangely, MPEGDecoder 1.32 under AVS 2.07 produces such an exception, but it's gone if I trim the video)

1) I got the YV12 version from nic's site. Is there another link?
2) Yes I use AVISynth 2.5 as I also develop a filter for it.
3) I can't try right now because of a rip in progress(I left the loadplugin for this dll...doh)

@Nic: i use an Athlon XP 1700+ I doubt it's a compatibility issue.

Nic
13th January 2003, 11:35
Force film was being dealt with wrong. Please try the new version, the documentation has been changed to include a "ff" function which causes the MPEGDecoder to read the d2v as a forced film one when creating the d2v automatically.

If you have any problems try loading debugview (you can get it from www.sysinternals.com ) and viewing the output to see if any peculiarities occur.

If you have the same frame counting problems, please send me the d2v stating how many frames should be reported and how many frames there actually are.

Cheers,
-Nic

Guest
13th January 2003, 14:53
Here's a little utility I wrote to parse a D2V to determine the number of frames there should be in the output, to associate the D2V flags with the *displayed* frame numbers (not the encoded ones), and to show 3:2 pattern breaks. Usage is "parsed2v filename >parsefile" from a command prompt.

If you run it on a PAL or nonprogressive D2V you'll get lots of pattern breaks! You can ignore them. Maybe I'll enhance the tool if people find it useful.

cult
13th January 2003, 17:03
@nic
no luck,still the same mistake

Nic
13th January 2003, 17:16
@cult: could you send me the d2v file (created by dvd2avi) that shows correctly in mpeg2dec but wrongly in mpegdecoder. could you also send the number of frames supposed to be reported. my email address is at the bottom of the help html file.

-Nic

Kurosu
13th January 2003, 17:23
@Nic

Sorry for not replying earlier, your post wasn't (weird !?) showing before first Spyder post.

I believe it's not due to the d2v file: using the original .d2v (though the vob is just a plain 1GB extracted from the DVD by SmartRipper, hence maybe having an incorrect end) produces the same error.

I'll send you a mail with the 2 .d2v, but they look identical, except that the IDCT method chosen by your plugin is 1, while 2 was the original (DVD2AVI, i.e. SSEMMX)

[EDIT]
That also happens with 2.01a, and with deleting the .d2v generated by that version.

spyder
13th January 2003, 21:19
I too get incorrect frame numbers. BTW, this version fixed my trouble.

FuPP
13th January 2003, 22:12
same problem with 2.01a

frames requested by encoder : 10000 to 13000, frames returned : 9660 to 12260 (about)

attached d2v

Cheers,
FuPP.

Selur
13th January 2003, 22:27
10% Speed increase (on my dual Athlon MP 1.8+), but too much frames ;)

Cu Selur

Ps.: d2v file created by DVD2AVI and MpegDecoder don't differ,..

bugs7
13th January 2003, 23:06
@nic
It's seem to work good for Pal (some french men try it) ;)

Thx for your good job again :)

FuPP
13th January 2003, 23:13
mine is pal too, but doesn't work :confused:

Selur
13th January 2003, 23:47
Strange,.. just tested a PAL myself and for me the frame count with is okay, but the sometimes stream got some ugly clitches,.. Something is really wicked out there, when I hit the Refresh (F5) button in VirtualDubmod the Frame that looked broken looks fine again, but another one is broken,...
(works fine if I use mped2dec3)

Cu Selur

Ps.: Attached a shot of a broken frame

Nic
14th January 2003, 00:10
Doh, found the bug. I honestly had never seen a trf (rff & tff flag combined) with value 0 in a d2v. So, I just completely forgot about. Doh! With that changed it counts fine.

@selur: do those frame glitches occur when encoding or while decoding a long stream. or do they occur while seeking about the frame. if its seeking inside VDub that causes it then thats ok (thats my basic cr***y seek code), if its during encoding or preview mode (without seeking first), then its a problem I dont know about.

2.02 with correct frame counting will be up tomorrow, im off to bed now. Thanks very much to cult & Kurosu for the d2v files :) (but why you guys didn't zip 'em up I dont know ;) lol ) & thanks to everyone for testing.

Cheers,
-Nic

FuPP
14th January 2003, 00:17
Then, will have a look tomorrow, good night nic ! ;)

Selur
14th January 2003, 00:22
"or do they occur while seeking about the frame."
while seeking, haven't encoded, because I thought it looked to ugly :)

"if its seeking inside VDub that causes it then thats ok"
puh,.. that's good to hear :)

"if its during encoding or preview mode (without seeking first), then its a problem I dont know about."
I'll try that tomorrow and report :)

"2.02 with correct frame counting will be up tomorrow, im off to bed now."
n8,.. going to bed now too, and maybe I'll dream about 2.02 :)

Cu Selur

Kurosu
14th January 2003, 00:36
Doh, found the bug. I honestly had never seen a trf (rff & tff flag combined) with value 0 in a d2v.

I tested that modification: "if ( trf == 2 || trf == 0 ) m_nFrameCount += 2;"
It gives the right count, but now, when playing for a long time (right key in Vdub) and then refreshing, the video was in advance by almost 2s... (haven't tested the ratio, though). I don't know what it affects.


Thanks very much to cult & Kurosu for the d2v files :) (but why you guys didn't zip 'em up I dont know ;) lol )

Next time (if there's one), I'll rar them, it'll be even smaller :p

Nic
14th January 2003, 00:37
Cool, im seeking into an arbitrary point and then im supposed to be decoding until I hit a keyframe, but maybe ive turned that off (or maybe its just not working). but yes it will be a seeking problem. Easily fixed ) hopefully ;) ). But for encoding it should all be cool.

Thanks loads for the testing all :)

-Nic

Kurosu
14th January 2003, 00:43
Erm... For that one, I'll let you debug and give us all the binary+code :)

ARDA
14th January 2003, 00:58
But for encoding it should all be cool.
Yes, I've finished a whole clip , in spite of the seeking problem;
final clip is ok.

Thanks for this great work
Arda

bugs7
14th January 2003, 09:02
Originally posted by FuPP
mine is pal too, but doesn't work :confused:

With CCE 2.5 it's crash.
With CCE 2.66 it's OK.
Strange ?
( With CCE 2.64.xx I' don't know. )

LoadPlugin("MPEGDecoder.dll")
MPEGSource("D:\trans\trans_Letterboxed.M2V")
ConvertToYUY2()
resampleaudio(44100) <- for CCE 2.5

ompg
14th January 2003, 09:23
Originally posted by bugs7
With CCE 2.5 it's crash.
With CCE 2.66 it's OK.
Strange ?
( With CCE 2.64.xx I' don't know. )


No problem with CCE 2.64.01.10.

Very Good Job Nic.

Ompg.

Nic
14th January 2003, 10:24
New build up, with counting frame bug fixed :)

ive got versions of CCE at home for testing, ill take a look, see if theres anything that can be done (CCE is such a tempramental beast).

Seeking is a problem, but not something we use in encoding. Is it accurate enough for now? Or would you prefer I fixed that first before adding DeCSS, TS Support or quick frame length detection?

(How people getting on with the MPEG-1 support?)

Cheers,
-Nic

HarryM
14th January 2003, 11:39
Originally posted by Nic
New build up, with counting frame bug fixed :)

ive got versions of CCE at home for testing, ill take a look, see if theres anything that can be done (CCE is such a tempramental beast).

Seeking is a problem, but not something we use in encoding. Is it accurate enough for now? Or would you prefer I fixed that first before adding DeCSS, TS Support or quick frame length detection?

(How people getting on with the MPEG-1 support?)

Cheers,
-Nic

Hi Nic!

You mpegdecoder_YV12 is nice fast! Overall speedup (mpeg2_decoding+resizing+xvid_encoding) is few procents!

But what result of mpegdecoder isn't the same as from mpeg2dec3?
I test it by encoding at quant2 and final size of my video isn't same.
Difference is about 1-2%.

bugs7
14th January 2003, 12:06
@nic
In previous version (1.3?), there is a feature to use mpegdecoder in an external program. This feature style exist ?
If yes, have sample vc++ project will be very cool ;)
Perhaps i will use it in a future program..

Nic
14th January 2003, 12:30
@bugs: not yet, im starting off slow this time, last time I tried to implement everything at once, and ended up not implementing anything perfectly at all. The version im putting out isn't even Intel Compiler compiled yet just to make sure that doesn't cause any bugs (ICL speeds up libmpeg2 quite alot). So expect lots of little improvements :)

-Nic

seewen
14th January 2003, 16:21
I tried MMPEGDecoder-v2.02a ( for 2.5 alpha).

And the framecount is wrong for MPEG-1 ( VCD). I tried with :
- MpegSource(".mpg")
- MpegSource(".mpg",0)
- MpegSource(".mpg",-1)
- MpegSource(".mpg",-2)
- MpegSource(".mpg", 'Correct_frame_count') ( for example 667499).

Every time, I've deleted the "*.d2v" before trying new params.

Every time I have a wrong frameCount:
Movie 1; Correct FrameCount=67499 ; Detected_by_MpegDecoder=33652
Movie 2; Correct FrameCount=64659 ; Detected_by_MpegDecoder=32209
----------

But it works very good with Ripped/Demuxed "*.m2v".

Nic
14th January 2003, 16:32
Yup, there is a problem in the way d2v files are created for mpeg-1 files. Ill fix it asap :)

Cheers,
-Nic

MaTTeR
14th January 2003, 17:58
Would someone be so kind as to attach the latest build to this thread? I'm unable to reach any dnsalis.com pages (uManiac & Nics) for the past few days:rolleyes: TIA!

Wilbert
14th January 2003, 18:02
I attached the latest:

Selur
14th January 2003, 18:03
attached the 2.02 Yv12 Version

Okay, too late,.. so I'll delete my attachment ;)

Cu Selur

Wilbert
14th January 2003, 18:05
hehe :)

FuPP
14th January 2003, 22:12
I've downloaded 2.02 from nic.dnsalias (dll dated 14/01/2003 9:17)
Still have the same problem !
does anybody else notice some problems with this new version ? :confused: :confused: :confused:

Regards,
FuPP

seewen
14th January 2003, 22:27
Originally posted by Nic
Yup, there is a problem in the way d2v files are created for mpeg-1 files. Ill fix it asap :)

Cheers,
-Nic

Cool ;)

The only reason I keep a copy of Avisynth 2.0x somewhere, is beccause their's not "MPegdecoder-yv12" yet ;).
As soon as it will be working, I could definitively erease Avs2.0x+plugins from my comp ;)

A+

MaTTeR
14th January 2003, 22:30
Many thx for the attachment guys.

I've been running tests with the YV12 and YUY versions so far and no problems noticed on progressive sources. Indeed the speed increase is very nice too!

Nic,
Is it safe to say were using the 32bit MMX iDCT by default?

Nic
14th January 2003, 23:44
Yes, it works out what chip you have and adjusts accordingly (colorspace, motion, dct). Although I dont think theres any P4 support. Hmmm, ill get on that (I finally have a p4 to test on now too)

Ill make it so that mpegdecoder produces will output a correct value for iDCT, at present it always outputs 1. (MPEGDecoder.dll pays no attention to the iDCT value in the d2v...

Cheers,
-Nic

de66ka
15th January 2003, 09:56
hi nic,
at first i'd to say that i'm respecting your work on mpegdecoder. The speed increase is great and i would use this program in future,

BUT

i reencode my stuff with CCE(2.5 sp). To test the compressibility I encode 1% of a clip (Zeit der Unschuld, PAL-DVD, 720x576) with fixed quantizer 30 (bitrate 0-8000), quality 5.
With avisynth 2.07 and mpegdec2.dll the resulting mpv-file is 30795 kb.
Using your mpegdecoder.dll (Ver2.02) the mpv-file grows up to 41565 kb by identical settings in CCE.
So I think the speed increase is a result of poor compressability and less quality.
Is there the possibility to fix this (speed increase and better compressability)??
MFG
AXEL

Nic
15th January 2003, 10:52
"is a result of poor compressability and less quality"
if anything id assume libmpeg2 to be the better quality decoder, alot more time has been spent on libmpeg2's quality than on mpeg2dec's (which hasn't been looked at properly since dvd2avi 1.76 was first released). The higher quality output could be causing a sharper picture thats harder to compress? maybe, maybe not. im only hypothesising, ill look into it.

-Nic

ps
@fupp:
Is your problem then if you ask to encode from frame x to frame y, it doesn't seek correctly? seeking isn't working quite as nicely as Id like yet, ill add that in next...
(it didnt occur to me people would encode like that)

gizmau
15th January 2003, 13:14
@de66ka

are you sure that mpegdecoder uses the same idct accuracy as your mpeg2dec.avs did?

FuPP
15th January 2003, 14:27
Originally posted by Nic
@fupp:
Is your problem then if you ask to encode from frame x to frame y, it doesn't seek correctly? seeking isn't working quite as nicely as Id like yet, ill add that in next...
(it didnt occur to me people would encode like that)

It could be related to seeking as first frame is not the good one (9660 instead of 10660), but length is ok (3000 frames).

If I don't select a range but the total length, total of frames displayed by using the script in virtualdub seems ok (it is the same than using mpeg2dec3 or mpeg2decyv12)

"(it didnt occur to me people would encode like that)" : I encode like that only for... testing purpose ! :D :D :D

Cheers,
FuPP.

de66ka
15th January 2003, 15:09
Originally posted by gizmau
@de66ka

are you sure that mpegdecoder uses the same idct accuracy as your mpeg2dec.avs did?

yes thats the question, i've no idea which idct mpegdecoder in standard-settings use!!

Nic
15th January 2003, 15:17
It uses pretty much the same one, Peter Gubanov from elecard wrote the SSEMMX iDCT algo based on the intel release which is used in almost everything...

-Nic