Log in

View Full Version : MPEG2Dec3 v0.9 for Avisynth 2.5


Pages : 1 [2] 3

kilg0r3
25th November 2002, 17:20
@ haazheel

i don't know the soluttion but this has been discussed elsewher already - > search

Marc FD
25th November 2002, 19:12
i was right. it was a buffer problem. but not avisynth ones. MPEG2Dec's ones. i totally overlooked this part of the code.

i feel really sorry. everything is my fault :(

so i've made the REAL work to get YV12 internally in MPEG2Dec3.
i changed the whole way MPEG2Dec handles frames (some hundred of lines to change...), it's much clean now, but i've come accros a lots of bugs (due to my hown mistakes :( ) so i've debugged during 2 hours. it's stable now, and it's is able to rewind flawlessly, but i've a new bug (i think i introduced this one :( ) : i get some drops in playback when i rewind. i don't understand why i get that. very very strange.

i think i'll attach an alpha version here soon, but only 80% of the problem is fixed, it's not finished yet, so it would be for testing only.

the good new is, MPEG2Dec3 internals are 100% YV12, so it should be a very little bit faster ^^

sh0dan
25th November 2002, 19:27
Great to hear, Marc!

Bug fixes that make code faster are always nice :)

Marc FD
25th November 2002, 19:55
>Bug fixes that make code faster are always nice

it's theoritically faster (means : nobody will notice it)

BTW, i've found the bug i added ("it's not a bug, it's a feature !!" ^^)

it's 100% fixed. but i'll finish to clean a bit the ugly code, and i want to add some MMX code in a misc part.

Marc FD
25th November 2002, 22:37
i'm in hurry and my ftp acces is dead, so here is MPEG2Dec3 v0.93
i've packaged the sources, i will upload them tomorow.

enjoy :)

and sorry again for the bugs, but hey, it's avisynth 2.5 _alpha_ ^^

( attached "mpeg2dec3 v0.93.zip" )

CruNcher
25th November 2002, 23:11
SetMemoryMax(48)
LoadPlugin("D:\Video\Tools\GordianKnot\MPEG2Dec3YV12.dll")
MPEG2Source("D:\uranusproject.d2v",idct=5,iPP=true)
BicubicResize(512,384)

is couseing unrecognized exception in last line with old mpeg2dec 0.92 it worked :(

Source is Mpeg2 interlaced PAL Svcd Stream

16:9 DVD PAL Stream works without problems any idears ?

lighty
26th November 2002, 00:00
Ummm- when I use slider in VirDubMod 1.4.11 it causes following error:Avisynth read error: Avisynth caught an access violation at 0x00ffb069, attempting to write to 0x000002d0

I tried all the scripts that used to work before with mpeg2dec3 0.92 (although with green frames and strobes).

Bulletproof
26th November 2002, 00:50
Same here, I'm getting access violations. But it manages to decode at least 1 minute of video with no problems. I'm sure you will be able to get the program working 100% soon.

springl
26th November 2002, 00:53
@Marc FD
-source material = VOB file NTSC/FILM with interlaced/progressive frames
-Mpeg2Dec3 0.93+avisynth 2.5 = crash in Windos98SE
irreversible error OE in 0028:C02A353A of VXD VWIN32(05) + 00002062
With this script:
Loadplugin("C:\Programmi\AviSynth2\plugins\Mpeg2dec3.dll")
Mpeg2Source("C:\WINDOWS\Desktop\Encoder\prova.d2v")
trim(0,2000)
crop(0,64,720,352)
I get the crash after the first frames with pf=1 (in debugview pf=1 is interlaced?) after 70 frames with pf=0 which are ok.
With this script:
Loadplugin("C:\Programmi\AviSynth2\plugins\Mpeg2dec3.dll")
Mpeg2Source("C:\WINDOWS\Desktop\Encoder\prova.d2v")
YV12toYUY2()
trim(0,2000)
crop(0,64,720,352)
I get the same error above indicated but it happens nearly a minute after.
With the second scrip the quality of frames is good but I noted that
removing the crop there is a horizontal flashing lin ,30 pixels under the top of frame.
I hope it is useful to you.
Regards
Sorry for my poor english.

Marc FD
26th November 2002, 08:34
okay 0.93 is up on my site. (with sources)

i've tested only on interlaced streams (pf = 0 is interlaced)

but i've no progressive source to test ...

>here is a horizontal flashing lin ,30 pixels under the top of frame.

hmm, i suspect something. i'll look into it. idon't do the job to end on the YV12 buffers mmx copy.

i think i've a little vob with progressives frame somewhere.

expect more tonight.

PS: yes, bugs where predictible, because i've changed a lot of code.

ookzDVD
26th November 2002, 09:21
@Marc FD,

I just finish encoding with your latest v0.93,
progressive source, 2:50 minutes length, with no problem.

lighty
26th November 2002, 11:38
@ookzDVD

Use longer clip or try to use slider in a long movie and you will notice that it will crash.

cult
26th November 2002, 13:07
loaded a normal movie(1h.48min)no crash when using the slider.And the problem is solved

lighty
26th November 2002, 15:32
Ummm- indeed when I load PAL interlaced source everything is fine but when I load NTSC progressive/interlaced source it keeps crashing. BTW- it is the same source where it used to strobe picture so I guess problem isn't solved yet.

Marc FD
26th November 2002, 17:02
i corrected 2 or 3 bugs, it should work now.

BTW, MPEG2Dec3 new buffering code should be faster for the source where you have problems ^_^

dl on my site in 10 minutes (time for me to upload ^^)

lighty
26th November 2002, 17:32
@Marc FD

Thx for the new 0.93b version. Slider now works without any errors and rewinding also haven't produced a single green frame.

As for strobing effect I will reencode same source that I had problems with before and I will advise here about all the results I get.

Good work Marc FD!:D

Bulletproof
27th November 2002, 02:30
This one is working for me with no problems :cool:

MaTTeR
27th November 2002, 03:06
Thx Marc! Seems like you found the bug for the strobing color problem. So far my encodes are looking great that caused me problems with the previous builds.

ookzDVD
27th November 2002, 03:32
@Marc FD,

If you don't mind, could you tell me about :

LumaFilter()

without parameter (use default value?)

is that the same with :

LumaFilter(-2,1) ?

Thank you.

lighty
27th November 2002, 10:22
Originally posted by MaTTeR
Thx Marc! Seems like you found the bug for the strobing color problem. So far my encodes are looking great that caused me problems with the previous builds.

I can confirm this. The NTSC progressive/interlaced source that gave me such troubles by strobing now works flawlessly. Thx Marc FD!:cool:

iago
27th November 2002, 13:14
@Marc

After a couple of full two-pass encodes with the latest version, I didn't have any problems either! ;)

Thanks for the bug-fixed new version,
iago

Marc FD
27th November 2002, 14:02
>LumaFilter()
>without parameter (use default value?)
>is that the same with :
>LumaFilter(-2,1) ?

yes, LumaFilter() == LumaFilter(-2,1) , because using 0,1 won't do anything anyway, and iago seemed to like the -2,1 setting ^_^

BTW, thanks at all for the support. i don't think MPEG2Dec is the faster MPEG2 decoder (hardware decoding or libmpeg2 is faster) but it's rock-solid. that's what i like. and 50 fps decoding is enough for me.

i'm gonna take a look on the audio aspect of DVD ripping.
i'd like to have a ac3source avisynth filter.

CruNcher
27th November 2002, 20:18
perfect it works now without any hassle great work Marc :)
could you implement PVA support i know that Nic is workin on this but it would be nice if also Mpeg2Dec3 with PP would support it thx for this great Decoder :)

Marc FD
27th November 2002, 22:04
PVA? i know MPEG2Dec3 supports ATSC (transport packets) streams or something like that. i never tried. i think tom can say more about this.

trbarry
27th November 2002, 22:42
Marc -

I think PVA are the European equivalent of ATSC streams, similar but not quite the same. And I have never worked with one so dunno what it would take.

BTW, I previously griped that MPEGDEC3 did not handle HDTV/ATSC streams but I think that maybe the only problem is if I try to crop in DVD2AVI and then use MPEG2DEC3. I'm doing an HDTV clip now and it seems fine (no cropping).

Final question? Does the deblocking in MPEG2DEC3 depend on the quants used for each block?

- Tom

springl
28th November 2002, 02:32
@Marc FD
Mpeg2Dec3 0.93 solved the problem of "strobo effect",thanks.
There is another method to solve it: if the parameter
"Field_Operation" in .d2v file is set to 1 (corresponding to FORCE FILM in dvd2avi, I think) all the versions of Mpeg2Dec3 ( 0.92 and prior) work without strange effects.I don't know if this solution works for all the people wiht "NTSC/FILM and interlaced/progressive frames" source material;with my source this solution is a valid alternative.
Not all the problems relative to this kind of source are still solved!! I noted that with certain sequences of frames the decoding is very slow (10-15 frames) and the restart correctly,a typical sequence is 0 0 ... 0 1 0 1 0 1 0 ... where 0<--->pf==0 and 1<--->pf==1 in debugview.
Last note: it seems to me that the resolution of Mpeg2Dec3 output in YV12 much lower than in YUY2(with YV12toYUY2 ) and YV12 output has more mosquito noise than YUY2.
What about?
Thx for your work.
Tix

Rrrough
28th November 2002, 09:10
PVA is an MPEG-2 transport stream format used by european digital satellite TV. you can find a basic document here. (http://www.technotrend.de/download/av_format_v1.pdf )

cheers

lighty
28th November 2002, 14:13
Originally posted by springl

Last note: it seems to me that the resolution of Mpeg2Dec3 output in YV12 much lower than in YUY2(with YV12toYUY2 ) and YV12 output has more mosquito noise than YUY2.

I haven't noticed any quality degradation and I looked hard...
BTW- what do you mean that resolution is lower? AFAIK- Resolution is same for YV12 as well as YUY2 and it only depends on the script what will you do with it...

Gannjunior
28th November 2002, 18:22
Hi,
I'm doing some tests with avs 2.50 + mpeg3dec3 0.92.
I've tried it on "Shining":i've done a complete encoding with divx 5.02.One with only Qpel and Pe2,the other with any tool.Resolution at 720x528.As encoder VdubMod.Fast rec...etc.Both encodings,made in 2pass,arrive at the end with any problem.The size I wanted is perfectly followed.BUT...my problem is that the film is perfect until 16 minute after the begin.From that point until end,I see the same frame that goes back and forward.
I've done another complete encoding with avs 2.07 and it's all ok(only slower ;) ).
Today i've done another encoding with 2.50 on another film: the same problem from sixteenth minute to the end.
Any Suggestion?

TIA

ciao!

Marc FD
28th November 2002, 19:22
>BTW, I previously griped that MPEGDEC3 did not handle HDTV/ATSC streams
>but I think that maybe the only problem is if I try to crop in DVD2AVI
>and then use MPEG2DEC3. I'm doing an HDTV clip now and it seems fine (no
> cropping).

avoid to change anything in DVD2AVI. i ignore many parameter, and something may pass trought. i think i'll remove the croping stuff in a next verison. and some other small changes. but it's very low priority.

>Final question? Does the deblocking in MPEG2DEC3 depend on the quants >used for each block?

yes, of course ^_^

>Field_Operation

all fields operations are working in 0.93

> Not all the problems relative to this kind of source are still >solved!! I noted that with certain sequences of frames the decoding is >very slow (10-15 frames) and the restart correctly,a typical sequence >is 0 0 ... 0 1 0 1 0 1 0 ... where 0<--->pf==0 and 1<--->pf==1 in >debugview.

hybrid sequences. MPEG2Dec is buffering a lot and playing with fields. i've optimised the stuff, and it should be faster than a regular MPEG2Dec.

>and YV12 output has more mosquito noise than YUY2.

lol. that's details ^^
MPEG2Dec YV12->YUY2 convertion is vertically blurring chroma a bit.


for transport streams, you need to make manual changes to the .d2v file.

lighty
28th November 2002, 19:33
Originally posted by Gannjunior
Any Suggestion?

Pls read this thread more carefuly. Use mpeg2dec3_0.93b. You can download it form Marc FD's site. Look for link in his sig.

trbarry
28th November 2002, 22:17
avoid to change anything in DVD2AVI. i ignore many parameter, and something may pass trought. i think i'll remove the croping stuff in a next verison. and some other small changes. but it's very low priority.

Marc -

Are you sure you really want to remove the cropping support? (not resize, which would be hard, and shouldn't be done in MPEG2DECx)

There are probably only half a dozen instructions somewhere in store.cpp that support the cropping by gimmicking the start offset and size. Likely the only problem is the adjustment for vertical cropping is off by a factor of 2 for YV12 instead of YUY2. I am goint to still support in in MPEG2DEC2 when I finally get around to it. (except I"m also using yours now ;) )

But if we are to remove the cropping support I have an alternate proposal. It would be nice if some of the parms (resize, cropping, etc.) that can be nicely and interactively set in DVD2AVI just be passed on to Avisynth where they would appear as variables, which could be referred to in functions and scripts.

So if there were vars like "DVD2AVI_Crop_Left", DVD2AVI_Horiz_Size, etc., then the actual work could be done in Avisynth after IVTC/deinterlacing where it belongs, and possibly after other filters. We could write our own custom scripts and still refer to the choices made interactively in DVD2AVI where you can see what you are cropping/sizing. Even choices like Force Film or PC/TV scale could be passed on, for whatever use.

Just a thought.

- Tom

Marc FD
29th November 2002, 17:36
>Are you sure you really want to remove the cropping support?

in fact, no. if i do something with MPEG2Dec3, it'ld only be bugfixes.

>There are probably only half a dozen instructions somewhere in >store.cpp that support the cropping by gimmicking the start offset and >size.

or call Crop() after MPEG2Source.

>Likely the only problem is the adjustment for vertical cropping is off >by a factor of 2 for YV12 instead of YUY2. I am goint to still support >in in MPEG2DEC2 when I finally get around to it. (except I"m also >using yours now )

please take MPEG2Dec3 v0.93 source code and work on it. i'm not going to update the code, so YOU could continue to improve it. (like adding proper cropping).

>But if we are to remove the cropping support I have an alternate
>proposal. It would be nice if some of the parms (resize, cropping,
>etc.) that can be nicely and interactively set in DVD2AVI just be
>passed on to Avisynth where they would appear as variables, which
>could be referred to in functions and scripts.

for me, Avisynth/VirtualDub is interactive enough. i don't like DVD2AVI ^^.

>So if there were vars like "DVD2AVI_Crop_Left", DVD2AVI_Horiz_Size, >etc., then the actual work could be done in Avisynth after >IVTC/deinterlacing where it belongs, and possibly after other filters. >We could write our own custom scripts and still refer to the choices >made interactively in DVD2AVI where you can see what you are >cropping/sizing. Even choices like Force Film or PC/TV scale could be >passed on, for whatever use.

if a filter can create global vars (sh0dan do you know more about that ?) it would be very easy to parse that from the DVD2AVI project file.

CruNcher
29th November 2002, 19:38
@Trbarry Marc_Fd and Nic :)

I tested Save-Oe with Transport Stream support on a recorded PVA file and i saw only some visual errors can't make a pic even not with hypersnap i couldn't even save it to AVI No Compress its allways produceing a 0 byte file and demuxing isn't working i think because of the different File System a PVA file uses but a Picture is there
i think the errors caused by seek problems in the PVA file ? it would be nice if DVD2AVI and fillters build up on it would support demuxing and playing of PVA files people then don't need to use PVAstrumento anymore :)

Maybe this could be off help http://home.t-online.de/home/michael-ring/DVD2AVI_PVAView-src-1.0.zip

trbarry
29th November 2002, 21:22
please take MPEG2Dec3 v0.93 source code and work on it. i'm not going to update the code, so YOU could continue to improve it. (like adding proper cropping).

Well, er, uhmmmmmm ...... that is kinda like feeding a stray cat. I'm afraid it might sort of make me responsible for it again and MPEG2DECx has never really been my top priority. It is much too much fun trying to talk you into doing all the work. ;)

But I must admit you have done an admirable job of it with all these enhancements.

If it is okay with you I would like to sometime merge all the changes in your new version back into the save-oe Sourceforge project. But I guess I was waiting to see when/if you lost interest and I would not be doing anything in a timely enough fashion to help the current Avisynth 2.5.

DVD2AVI & MPEG2DEC are funny projects, often orphaned for some reason. Somebody takes them and runs with them for awhile and then for awhile they just sit. But I'm real happy with your recent changes. When I got the project from OGO the cropping was busted too, so I guess I'm used to fixing it. ;)

@Sh0dan -

Is it easily possible somehow to pass back global vars from MPEGDEC to Avisynth like I suggested above? Is it like MPEG2Source creates a clip that could just have some more vars set by MPEG2DECx and referred to like other clips attributes?

- Tom

trbarry
29th November 2002, 21:33
Cruncher -

I'm afraid you are going to have to find someone who knows and uses PVA files to get support for those. Currently I'm pretty sure we look for the x'47' (IIRC) ATSC transport stream flags to identify US HDTV streams.

- Tom

Gannjunior
30th November 2002, 13:16
@Lighty
Pls read this thread more carefuly

I've not asked anything of strange and I've not asked nothing that has been treated many times...There's no answer about my problem in the others posts.And mpeg2dec3 0.93b isn't gone out one month ago...

However I've done the same encoding using mpeg2dec3 0.93b and I've had the same problem explained some post ago.I've also opened Vdub and the I've had the same problem even when I scroll DVD by Vdub.
So,dear Lighty,I've read CAREFULLY the thread and I've not seen any answer that could help me to solve my problem(If you have seen one,tell me :rolleyes: ).For that reason,I've posted my question 8 messages ago!

Regards

Wilbert
30th November 2002, 13:28
I'm afraid you are going to have to find someone who knows and uses PVA files to get support for those. Currently I'm pretty sure we look for the x'47' (IIRC) ATSC transport stream flags to identify US HDTV streams.
Anyone knows about PVA files and is willing to help Tom?

edit: maybe BB knows enough about this stuff and is willing to help you?

Bulletproof
18th December 2002, 03:01
There seems to be a major problem in the post processing of MPEG2DEC3. There are tiny distorted blocks in the video on edges of things. Sometimes there are several of them, I made screenshots so you could see. I'm using an AMD Athlon CPU. The IDCT changes do not make a difference. However, on Jackei's page (Author of DVD2AVI), he has a similar type of distortion in his program when using the IEEE-1180 reference IDCT with distorted blocks, I don't know if they are related, you can see that problem here: http://arbor.ee.ntu.edu.tw/~jackei/dvd2avi/idctref/

This is with CPU=4:

http://www.boomspeed.com/boya/bad.png

This is with CPU=0 (post processing off):

http://www.boomspeed.com/boya/good.png

Marc FD
18th December 2002, 14:18
well, i can only suppose things.
are you using iPP = true ??

BTW, the bug as nothing to do with what jackei's refers to.
it's really not easy to see, but i dunno why it's here.
i hope it's not my bad implementation ^__^

Bulletproof
18th December 2002, 21:07
Yes I was using iPP=TRUE, I have not checked yet if it happens with it off, but 99% of my material is interlaced so I always keep it on.

Marc FD
19th December 2002, 16:00
use separatefields, you'll see it does the job right.
as i writed in the readme, using iPP=true activates field-based PP.

i think deinterlacing will more or less remove these artifacts.

Bulletproof
25th December 2002, 07:22
On a somewhat related note, I just installed DivX 5.02, I had 5.01 installed for a while, and it's default post processing setting is up 1 notch. I noticed while playing a video today that it has the same exact problem with showing those blocks in frames, and this is from progressive video. After disabling post processing they dissapeared.

Acaila
1st January 2003, 19:15
@Marc FD:

When I use this filter (v0.94) I get the following output in debugview for every frame:
00000089 3.00058924 [1180] 1st-pass: size:106 total-kbytes:2 inter quant:2 MPEG kblocks:0 mblocks:0
00000090 3.00147482 [1180] MPEG2Dec3 log> pf = 1
00000091 3.01606831 [1180] MPEG2Dec3 log> fo = 0
00000092 3.01617335 [1180] MPEG2Dec3 log> top_field_first = 1
00000093 3.01622667 [1180] MPEG2Dec3 log> progressive_frame = 1

Now, since I get 4 extra lines for every frame it is increasing my disk usage, and in fact I believe it's actually slowing down my encodes because fps keeps dropping to zero every once in a while due to memory swapping. I've searched the readme that comes with it, but I haven't been able to find a way to disable MPEG2Dec3 from outputting these extra lines. Maybe I've overlooked something, but could you please tell me how to disable this extra info?

iago
1st January 2003, 19:32
@Acaila,

In DebugView, go to

Edit -> Filter/Highlight -> Exclude

and type in "mpeg2dec3". That's all! ;)

regards,
iago

Acaila
1st January 2003, 19:35
Hadn't even thought of that. Thanks :)

cweb
2nd January 2003, 10:23
Can you update the software you are using for your card? Updated
software should be able to save directly in MPEG-2. My hauppauge's
software does that. I never save in PVA. If I use PVA and PVAstrumento
I'd lose some bits of the video and/or audio, and that's not good.

I save in MPEG2 and then use DVD2AVI (the original or the improved
one by Tom) plus mpeg2dec3/avisynth 2.5 currently. The results are
great.

I would try updating the software (driver plus recording utility).
You can use a third party recording software such as Progdvb.


Originally posted by CruNcher
@Trbarry Marc_Fd and Nic :)

I tested Save-Oe with Transport Stream support on a recorded PVA file and i saw only some visual errors can't make a pic even not with hypersnap i couldn't even save it to AVI No Compress its allways produceing a 0 byte file and demuxing isn't working i think because of the different File System a PVA file uses but a Picture is there
i think the errors caused by seek problems in the PVA file ? it would be nice if DVD2AVI and fillters build up on it would support demuxing and playing of PVA files people then don't need to use PVAstrumento anymore :)

Maybe this could be off help http://home.t-online.de/home/michael-ring/DVD2AVI_PVAView-src-1.0.zip

CruNcher
2nd January 2003, 19:49
Can you update the software you are using for your card? Updated
software should be able to save directly in MPEG-2. My hauppauge's
software does that. I never save in PVA. If I use PVA and PVAstrumento
I'd lose some bits of the video and/or audio, and that's not good.

i use Progdvb a long time now mpeg-2 recording looks stable but there is now another problem with mpeg2dec3 Yv12, Marc has a test clip of the "repeating frame" bug and is investigating it. The problem recording directly to Mpeg-2 its more vurnearable to send errors loseing complete gops the bits loseing problem was corrected as i know in the new pvastrumento version 2.25

cweb
3rd January 2003, 17:06
I never get errors when I record to mpeg-2. Of course, I get errors
if I try to record something while doing something computation intensive, so when recording I try not to do anything else with the PC.
As a result there aren't problems usually with the recording and you
can say I never use pvastrumento even though I did install it and I
do update it.

I did update the dvb-s drivers from the ones which were supplied, so
perhaps that helps.

Originally posted by CruNcher
i use Progdvb a long time now mpeg-2 recording looks stable but there is now another problem with mpeg2dec3 Yv12, Marc has a test clip of the "repeating frame" bug and is investigating it. The problem recording directly to Mpeg-2 its more vurnearable to send errors loseing complete gops the bits loseing problem was corrected as i know in the new pvastrumento version 2.25

MrBunny
5th January 2003, 23:15
Just to suppliment what Acaila was saying about mpeg2dec3 debugview output. Even if iago's method manages to disable the debugview from actually outputting the lines to the screen, mpeg2dec3 is still "sending" those lines to debugview. Although it's probably very minor, it's probably still results in a performance hit. I was wondering if it would be possible to have an option to disable that output.

Thanks