Log in

View Full Version : WMP9 and XviD RC1 problems


DavidW
31st January 2004, 03:15
I'm still having the same flip with RC1 that I did with Beta 3. Near the end of a movie in Windows Media Player 9 the video will flip and stay that way until you close WMP9 and reopen it.

I'm also having a problem with the decoder causing WMP9 to crash once per Windows session. Usually the first time I play an XviD movie after booting my system up, the movie will play for approx 1 minute and crash. If it doesn't crash there it usually will crash when it gets to the end of the movie where the video flips.

I've had this problem on three completely different systems so far so I'm fairly certain that it's not a problem with system software or configuration.

The crash produces the following event under the application event log:


Event Type: Error
Event Source: Application Error
Event Category: None
Event ID: 1000
Date: 1/30/2004
Time: 7:20:57 PM
User: N/A
Computer: *******
Description:
Faulting application wmplayer.exe, version 9.0.0.2980, faulting module xvidcore.dll, version 0.0.0.0, fault address 0x0004ed8b.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 77 6d 70 ure wmp
0018: 6c 61 79 65 72 2e 65 78 layer.ex
0020: 65 20 39 2e 30 2e 30 2e e 9.0.0.
0028: 32 39 38 30 20 69 6e 20 2980 in
0030: 78 76 69 64 63 6f 72 65 xvidcore
0038: 2e 64 6c 6c 20 30 2e 30 .dll 0.0
0040: 2e 30 2e 30 20 61 74 20 .0.0 at
0048: 6f 66 66 73 65 74 20 30 offset 0
0050: 30 30 34 65 64 38 62 0d 004ed8b.
0058: 0a .


Hope this helps someone develop a more stable decoder for WMP9. Let me know if there is anything else I can help you with. I know close to nothing about the encoding process. If not for Gordian Knot I'd never be able to encode a movie at all. =) So if you need settings, like Iframs Bframes, quants or whatever (I don't know what any of that is) it's safe to assume that I'm using whatever settings are default in the Gordian Knot package.

Thanks for a great codec, and sorry to be whining about what I've heard everyone one repeatedly say is the worst media player around. But if you're planning to go mainstream with this codec you're gonna have to fix compatibility bugs with WMP9 anyway. There are just too many people who use it on an everyday basis.

By the way. Are there any good tutorials or guides that would help me learn more about these I-frames, B-frames, quants etc.?

Thanks,
David

mikeX
31st January 2004, 03:31
i can't help you with wmp9, but i have to say that you can find almost anything you need about video encoding in the doom9 forum, the 'search' button is your friend, it might take a lot of time and a lot of reading, but most of everything you 'll ever need to know has been asked about and answered somewhere in the forum

a very helpful starting point for me (explaining the very basics of video encoding) was also the help file that came with virtualdubmod (but it isn't there anymore since 1.5.10, so look it up in earlier versions like 1.5.4.1)

concerning the forum you can start by browsing through the stickies and the faqs of the various forum categories for useful info and links

you can also have a look at the post i made in this thread for some useful thread links:

http://forum.doom9.org/showthread.php?s=&threadid=69505

(i found the "understanding a quantization matrix" thread especially 'enlightening' although it may be a bit advanced, better look at the help file i mentioned earlier first)

good luck!

DavidW
31st January 2004, 06:15
Anyone know of a different decoder (codec) I can use that may not have the problems with the video flip in WMP9?

Before RC1 I was using Nic's decoder from 7-16-2003 and it was playing the Beta 3 encoded movies with no problems. (Actually I'm not sure I watched one the whole way through to check for audio/video sync problems)

But now the movies I've encoded with RC1 lose sync between audio and video frequently and earlier versions of Keopi's build have major jitter issues in WMP9.

If I didnt have so many movies that I've ripped using RC1 already I'd just go back to Beta 3 and Nic's decoder. But I didn't play test the RC1 decoder enough before I ripped like 8 movies from DVD and I'd hate to go back and remake all of those movies if there is gonna be a RC2 that fixes this anytime soon.

Thanks in advance,
David

sysKin
31st January 2004, 06:23
If you didn't use GMC and used mod16 resolutions, older decoder should work correctly.

As for WMP9 problems, it seems that my recent directshow changes do fix some of the them. You can get most recent dshow build from
http://hompepages.ihug.com.au/~syskin/xvid.ax4.zip

Unzip the file and replace your winnt\system32\xvid.ax with it.

Don't forget to tell how it went :)

Radek

DavidW
31st January 2004, 06:47
sysKin,

Actually I've already done that. Your code correctd the flip after it occurs (flips it back after a second), but it does not prevent the flip from occuring. It also has no affect on the media player crash.

But thanks for the new code. This is the first time I've really used any open source program that I liked. Consequently it's the first time I've gotten to experience first hand the great flexibilty open source gives us by allowing any one to make the program better.

Oh yeah, I don't know what GMC and mod16 are. Sorry. :rolleyes:

Thanks again,
David

DavidW
3rd February 2004, 06:59
GMC = Global Motion Compensation?

I'm not using GMC unless Gordian Knot does it automatically without notifying the user. It's not checked under the XviD codec settings when I start the encoding.

mod16???? I still don't know what it is. A quick search seemed to point to mod16 being a set of resolutions you resize your movie to. If you could point me in the right direction it would be greatly appreciated.

Thanks,
David

sysKin
3rd February 2004, 07:08
Originally posted by DavidW
mod16???? I still don't know what it is. A quick search seemed to point to mod16 being a set of resolutions you resize your movie to. If you could point me in the right direction it would be greatly appreciated.Yes, it's about resolutions being multiplies of 16. Old dev-api-3 had a bug in this area and encoded/decoded incorrectly - so you can't use old dev-api-3 decoder in such cases.

In all other cases you can use dev-api-3 decoder perfectly ok.

I wonder if changing output data to VIDEOINFOHEADER would fix that WMP9 problem... if I'll make the change, will you help testing it? :)

DavidW
3rd February 2004, 07:42
Suuure. :) I mess my system up at least twice a day anyway. No seriously... I'm always trying to make this computer do things it was never meant to do.

Just send it to me via email, or send me a link. Whatever is easiest for you.

Thanks again,
David

sysKin
3rd February 2004, 08:06
OKay it was enough to glance at the code to spot a bug (amazing, isn't it) - of course in a piece I had written (which is why it's so amazing).

So, first - a fixed version at http://homepages.ihug.com.au/~syskin/xvid.ax6.zip

Second, a "compatibility" version which uses older VIDEOINFOHEADER. Does not support aspect ratio in matroska or anywhere else, but works with this funny player that needed it and - please test - might fix the WPM9 problem. If it's so, I'll make an option out of it.

http://homepages.ihug.com.au/~syskin/xvid.ax_compat.zip

:)
Radek

sysKin
3rd February 2004, 15:36
I'm thinking noone actually uses WMP9. It's a very good thing, but doesn't help with my debugging... I really need to know if the 6th build fixes anything, and if not - does compatibility build fixes anything.

A thought crossed my mind today. Let me quote irc:
23:59:00 : (@sysKin): if aspect ratio is not specified, it should be equal to resolution right?
23:59:10 : (@sysKin): for a square pixel
23:59:36 : * sysKin waits for confirmation
00:00:10 : (@sysKin): so let's say we're talking about directshow here
00:00:17 : (@sysKin): anyone noticed a missing bit?
00:00:24 : (@sysKin): I guess not
00:00:46 : (@sysKin): vertical resolution can be negative to indicate vertical flip of rgb colorspaces
00:01:10 : (@sysKin): so now the aspect ratio is not resoluton but abs() of it
00:01:36 : * sysKin takes bets: will it solve WMP9 flipping problems

I need a tester for all this.

Radek

DavidW
3rd February 2004, 22:39
Sorry if my cry for attention over in the xvid.org forum (http://www.xvid.org/modules.php?op=modload&name=phpBB2&file=viewtopic&p=6828#6828) forum offended you sysKIn. I was really just posting the Divx/support comment to see if anyone was even reading the thread.

I still plan on testing your new code as soon as I can. I wanted to do it last night but I had to get some shut eye before work today. After Karate class tonight I'll give it a go and let you know what I find out.

Thanks again for your great support, :D
David

DavidW
4th February 2004, 06:39
I haven't completed testing of the compatibility build file yet, but the new fixed version (6) does not fix the flip or the WMP9 crash. (Same fault address in the event log and everything)

So far I know the compatiblity build does not fix the video flip and I'm still testing for the crash but I should be able to let you know by tomorrow.

Thanks again,
David

DavidW
4th February 2004, 07:30
Nope the compatibility build just crashed too. Different fault address this time though.

Faulting application wmplayer.exe, version 9.0.0.2980, faulting module xvidcore.dll, version 0.0.0.0, fault address 0x00084b7c.

--David

sysKin
4th February 2004, 10:24
Thank you DavidW. Too bad it didn't help :(

The crash in xvidcore.dll is creepy. Maybe I should install wmp9 to trace it...

vass-iliskus
4th February 2004, 21:38
Hi sysKin,

I guess you've already spotted the ZeroMemory issue in DS decoder, have you ? Anyway it, or anything else in the filter could barely cause crash in xvidcore.dll, the problem is probably content dependent.
BTW, I have 9.00.00.2980 too, and it works just fine, it even respects the PAR, whereas WMP8 did not (almost).

DavidW
4th February 2004, 21:49
In otherwords you think it's the movies I'm playing? Or should I say the settings I used to encode them?

Well, I'll be willing to try any encoding settings you want to give me but I did not have these problems on pre Beta3 decoders.

I use Gordian Knot and I don't really mess with any of the default settings other than final size for the movie file and aspect ratio, so keep that in mind.

I also have this problem on movies encoded with Keopi's stable release, Beta 3, and RC1. If that makes any difference.

What settings do you recommned I use to encode files?

Thanks,
David

vass-iliskus
4th February 2004, 22:00
No, I'm not going to recommend anything, I'm no settings guru. Just thinking.

There shouldn't be "wrong" settings anyway, in the sense that codec is supposed to cope with any data it created itself.

BTW, did you tried different players, just to be sure ?

DavidW
4th February 2004, 22:10
I tried Media Player Classic and it works without flips or crashing.

Well, at least without flipping. Sometimes the crash is hard to reproduce. But I usually play a movie to fall asleep to at night and when I wake in the morning the WMP9 has always crashed. I'll try MPC tonight and see if it crashes.

--David

sysKin
5th February 2004, 05:16
Originally posted by vass-iliskus
I guess you've already spotted the ZeroMemory issue in DS decoder, have you ?Oh? I don't even know what that is. Tell me tell me ~~~~
Anyway it, or anything else in the filter could barely cause crash in xvidcore.dll, the problem is probably content dependent.
[/B]Yes, which is why I downloaded WMP9 today. Crash in the core should never ever happen (maybe with the exception of damaged file, xvid is not secured against that). Wanted to fix it as soon as possible.

I can't reprocuce the crash or flipping however :( It all works fine. I also discovered that WMP9 is the 4th worst player I've ever seen on windoze LOL (after quicktime, realplayer/realone and divx player).

Perhpas you could cut a small piece of video which makes it crash?

Radek

DavidW
5th February 2004, 05:24
I'll try to get one to you tomorrow... hmmm.. maybe Friday. Busy schedule right now. Sorry.

--David

snowcrash
5th February 2004, 05:48
Just wanted to say that I also see the video flipping problem with WMP9 and XVID RC1. So it's not just you, DavidW. As for the crashes, I think I've seen that a few times, but I'm not sure about that since I've stopped using WMP9 as my main media player since the flipping issue came up with XVID beta3. And I don't understand why people are always bashing WMP9 as a media player. AFAIC, it's a nice player with many useful features and I'd still be using it as my main player if it wasn't for this annoying XVID problem (which I blame more on XVID than I do on WMP9, btw).

vass-iliskus
5th February 2004, 06:43
Originally posted by sysKin
Oh? I don't even know what that is. Tell me tell me


HRESULT CXvidDecoder::GetMediaType(int iPosition, CMediaType *mtOut)
{
[...]
VIDEOINFOHEADER2 * vih = (VIDEOINFOHEADER2 *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2));
if (vih == NULL)
{
return E_OUTOFMEMORY;
}

ZeroMemory(vih, sizeof (VIDEOINFOHEADER));


All the data laying at the end of VIDEOINFOHEADER2 is left uninitialized. That's last 24 bytes of BITMAPINFOHEADER, I guess. You're lucky enough to put something into most of them, but biClrUsed and biClrImportant are left in undefined state.
Nothing *that* important, but this is what that call to ZeroMemory is supposed to do after all, isn't it ?

sysKin
5th February 2004, 06:47
I'm bashing WMP9 because I opened it (for the first time in my life), dragged an avi file on it and couldn't drop it to start playing. Some IE webpage was there and the whole window didn't accept drag&dropped files.

Okay this is no MS helpline :) . Let me put this clear that I'd like to resolve the WMP9 issue - especially the xvidcore crash sounds very bad. Anyone who can help is welcome to do so.

Radek

sysKin
5th February 2004, 06:50
@vass-iliskus

Thanks a lot, I fixed that very recently - it's the bug I was talking about some posts back in this thread. xvid.ax6.zip from my webspace has it fixed.

Thanks - and if you see more, tell me as soon as you can :)

vass-iliskus
5th February 2004, 11:00
@sysKin:

If the problem is indeed with the content, and it happens only somewhere towards the end of the file, then the main difficulty is to identify that certain piece.

I'd suggest to build another xvid.ax :) with HRESULT CXvidDecoder::Transform(IMediaSample *pIn, IMediaSample *pOut) eclosed within a try-catch (or __try-__except) block, and when exception is caught - just dump the result of pIn->GetMediaTime() into some text file, giving the exact location of the piece.

David could left it play at night, just like he usually do :) (or use .avs with something like DirectShowSource("smth.avi", fps=250)), and on the next morning the dump will contain all we need to cut the piece.

BTW, it is a shame neither xvidcore.dll nor xvid.ax define it's own dll base address, DLL relocation is a bad thing.

In the meantime, you can try to build RC1 xvidcore.dll with debug information (not the debug configuration), but it must be compiled using the same compiler and the same settings as Koepi's RC1, you know... The address of the crash in RC1 is posted above, you can use it and the build with debug information to find where exactly it crashes. It might shed some light too.

sysKin
6th February 2004, 04:43
Okay just to report some (lack of) progress.

I've read people telling about the second video in a playlist having wrong colours. I checked colorspaces used and couldn't see anything wrong - first had YUY2, second had YUY2.

I really need a way to reproduce these problems...

Just a quick check: I have WMP 9.00.00.2980 and DirectX 9.0b (4.09.0000.0902), windoze 2k sp4 and ATI drivers 6.14.10.6414 (that's 12/12/2003 official). Perhaps you should give your specs, too (I mean everyone who has WMP9 problems, except for one guy on some thread, you know which one - don't worry if you don't)

Radek

DavidW
6th February 2004, 21:07
sysKin,

I just read the other thread that wh00t started about this issue and his flips seemed to have been resolved by your latest fix. So I was wondering if maybe I didn't install/register the new file properly.

I replaced the previous version of xvid.ax in C:\WINDOWS\SYSTEM32 with the new file then ran "regsvr32.exe xvid.ax" to register the new file. Is that all I'm supposed to do? Also, I'm not sure if I ran regsvr32.exe with the complete path to xvid.ax or not. Does that matter?

My system specs: (Three systems)

OS: Windows XP Pro SP1
Processor: 2.45Ghz Pentium 4 / 500Mhz Pentium III / 550Mhz Pentium III
Video Card/Drivers: ATI Radeon 9000 Pro 128MB / Geforce 2MX 32MB
Video Player: WMP9 9.0.0.2980
DirectX: 9b

I'm not sure about video driver versions I'll have to check that when I get home and then I'll edit this post with that information.

I'm actually not sure the encoding system (2.4Ghz) has DirectX9b installed now that I think of it. It's not relevant to the encoding process is it?

--David

sysKin
7th February 2004, 03:48
Originally posted by DavidW
I just read the other thread that wh00t started about this issue and his flips seemed to have been resolved by your latest fix. So I was wondering if maybe I didn't install/register the new file properly.Please, let's not mention the other thread anymore ;) It makes me wonder, maybe I should stop being a developer and so many things would stop being my fault. The bestest solution to heal the world, it seems.
I replaced the previous version of xvid.ax in C:\WINDOWS\SYSTEM32 with the new file then ran "regsvr32.exe xvid.ax" to register the new file. Is that all I'm supposed to do? Also, I'm not sure if I ran regsvr32.exe with the complete path to xvid.ax or not. Does that matter?No, it doesn't. You could even not register it, because the previous xvid.ax was registered. You did everything right...

The only thing you can check (to be 1000% sure) is that xvid.ax is being used. Go to file->properties and make sure it says "XviD MPEG-4 Video Decoder" under "video codec". But I'm sure it does.

@everyone with this problem: do you all have windows XP?

I'm actually not sure the encoding system (2.4Ghz) has DirectX9b installed now that I think of it. It's not relevant to the encoding process is it?No, DX is only used for video display.

The most funny thing is, xvid.ax is almost identical to the decoder used in dev-api-3. Especially the compatibility version - same code, same output.
The crash in xvidcore indicates that it might not be a problem with .ax fater all, but rather with the core.

Ah, I played with WMP9 a bit more. Have you seen how it can't seek or fast-forward with "video mixing renderer" disabled? But only with XviD! This is strange, because I always thought seeking has nothing to do with decoder - it's a splitter thingy.
I'll try to resolve this mistery, maybe it will help with the main problem. Any help from anyone more experienced with dshow is appreciated - I have never programmed directshow before, at all.

Radek

sysKin
7th February 2004, 05:22
As pointed out by jcsston (thanks a lot!) it is possible that two decoders will interfere with each other - in the area of picture flipping.
It is possible that WMP9 opens a second decoder during playback (don't ask me what for) and then second decoder changes picture flip setting in the first.

Please check this out ASAP: http://syskin.cjb.net/xvid.ax7.zip

:)

snowcrash
7th February 2004, 07:48
Well, today I did a clean install of Windows XP, installed WMP9 and then XVID RC1 and now I'm not seeing any flipping in XVID videos. So I guess I have to apologize, apparently the problem is not caused by XVID itself, but must be due to some interaction with other software. I'll keep an eye on it and see if it comes back.

vass-iliskus
7th February 2004, 08:39
As pointed out by jcsston (thanks a lot!) it is possible that two decoders will interfere with each other - in the area of picture flipping.
It is possible that WMP9 opens a second decoder during playback (don't ask me what for) and then second decoder changes picture flip setting in the first.


Not only it is possible, that's exactly what happens !
Look here:


00000027 7.52616184 [1612] Constructor
00000028 7.52624510 [1612] joinfiltergraph, cfgDlgHwnd:0
00000029 7.52628616 [1612] CheckInputType
00000030 7.52632444 [1612] FORMAT_VideoInfo: width:712, height:432, AvgTimePerFrame:400000
00000031 7.74690191 [1612] XVID, 712, 432
00000032 7.75416652 [1612] XVID 00BD0510 Constructor
00000033 7.75851763 [1612] XVID 00BD0510 CheckInputType
00000034 7.76052459 [1612] XVID 00BD0510 SetMediaType
00000035 7.76097381 [1612] XVID 00BD0510 GetMediaType
...
00000044 7.76407504 [1612] XVID 00BD0510 GetMediaType
00000045 7.76413790 [1612] joinfiltergraph, cfgDlgHwnd:0
00000046 7.76417785 [1612] XVID 00BD0510 GetMediaType
00000047 7.76418930 [1612] XVID 00BD0510 CheckTransform
00000048 7.76422562 [1612] XVID 00BD0510 SetMediaType
00000049 7.76428373 [1612] XVID 00BD0510 ChangeColorspace
00000050 7.76431753 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000051 7.76435301 [1612] YUY2
00000052 7.76439073 [1612] CheckInputType
00000053 7.76442481 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000054 7.76446476 [1612] YUY2, 712, 432
00000055 7.76450191 [1612] XVID 00BD0510 GetMediaType
00000056 7.76451309 [1612] XVID 00BD0510 CheckTransform
00000057 7.76454885 [1612] XVID 00BD0510 SetMediaType
00000058 7.76458405 [1612] XVID 00BD0510 ChangeColorspace
00000059 7.76461981 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000060 7.76465361 [1612] YVYU
00000061 7.76471200 [1612] CheckInputType
00000062 7.76474608 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000063 7.76478547 [1612] YVYU, 712, 432
00000064 7.76482318 [1612] XVID 00BD0510 GetMediaType
00000065 7.76483436 [1612] XVID 00BD0510 CheckTransform
00000066 7.76487012 [1612] XVID 00BD0510 SetMediaType
00000067 7.76492739 [1612] XVID 00BD0510 ChangeColorspace
00000068 7.76496063 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000069 7.76499555 [1612] UYVY
00000070 7.76503215 [1612] CheckInputType
00000071 7.76506595 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000072 7.76510478 [1612] UYVY, 712, 432
00000073 7.76514194 [1612] XVID 00BD0510 GetMediaType
00000074 7.76515311 [1612] XVID 00BD0510 CheckTransform
00000075 7.76518887 [1612] XVID 00BD0510 SetMediaType
00000076 7.76522407 [1612] XVID 00BD0510 ChangeColorspace
00000077 7.76525983 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000078 7.76529363 [1612] IYUV
00000079 7.76535146 [1612] CheckInputType
00000080 7.76538554 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000081 7.76542494 [1612] IYUV, 712, 432
00000082 7.76546237 [1612] XVID 00BD0510 GetMediaType
00000083 7.76547382 [1612] XVID 00BD0510 CheckTransform
00000084 7.76550930 [1612] XVID 00BD0510 SetMediaType
00000085 7.76556657 [1612] XVID 00BD0510 ChangeColorspace
00000086 7.76560010 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000087 7.76563474 [1612] YV12
00000088 7.76567134 [1612] CheckInputType
00000089 7.76570542 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000090 7.76574425 [1612] YV12, 712, 432
00000091 7.76578113 [1612] XVID 00BD0510 GetMediaType
00000092 7.76579230 [1612] XVID 00BD0510 CheckTransform
00000093 7.76582778 [1612] XVID 00BD0510 SetMediaType
00000094 7.76586298 [1612] XVID 00BD0510 ChangeColorspace
00000095 7.76589874 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000096 7.76593254 [1612] RGB32
00000097 7.76599065 [1612] CheckInputType
00000098 7.76602445 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000099 7.76606356 [1612] , 712, 432
00000100 7.76610072 [1612] XVID 00BD0510 GetMediaType
00000101 7.76611189 [1612] XVID 00BD0510 CheckTransform
00000102 7.76614765 [1612] XVID 00BD0510 SetMediaType
00000103 7.76620436 [1612] XVID 00BD0510 ChangeColorspace
00000104 7.76623761 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000105 7.76627253 [1612] RGB24
00000106 7.76630913 [1612] CheckInputType
00000107 7.76634293 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000108 7.76643261 [1612] , 712, 432
00000109 7.76649993 [1612] XVID 00BD0510 GetMediaType
00000110 7.76651194 [1612] XVID 00BD0510 CheckTransform
00000111 7.76654910 [1612] XVID 00BD0510 SetMediaType
00000112 7.76658430 [1612] XVID 00BD0510 ChangeColorspace
00000113 7.76662034 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000114 7.76665442 [1612] RGB555
00000115 7.76671197 [1612] CheckInputType
00000116 7.76674577 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000117 7.76678488 [1612] , 712, 432
00000118 7.76682204 [1612] XVID 00BD0510 GetMediaType
00000119 7.76683321 [1612] XVID 00BD0510 CheckTransform
00000120 7.76686897 [1612] XVID 00BD0510 SetMediaType
00000121 7.76692596 [1612] XVID 00BD0510 ChangeColorspace
00000122 7.76695977 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000123 7.76699441 [1612] RGB565
00000124 7.76703128 [1612] CheckInputType
00000125 7.76706509 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000126 7.76710392 [1612] , 712, 432
00000127 7.76723382 [1612] XVID 00BD0510 GetMediaType
00000128 7.76724612 [1612] XVID 00BD0510 GetMediaType
00000129 7.76728411 [1612] XVID 00BD0510 CheckTransform
00000130 7.76732127 [1612] XVID 00BD0510 SetMediaType
00000131 7.76735647 [1612] XVID 00BD0510 ChangeColorspace
00000132 7.76739250 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000133 7.76750006 [1612] YUY2
00000134 7.76753749 [1612] XVID 00BD0510 GetMediaType
...
00000143 7.76787636 [1612] XVID 00BD0510 GetMediaType
00000144 7.76791687 [1612] DecideBufferSize
00000145 7.77184363 [1612] XVID 00BD0510 CheckTransform
00000146 7.77196515 [1612] XVID 00BD0510 CheckTransform
00000147 7.77197689 [1612] Destructor
00000148 7.77477780 [1612] XVID 00BD0510 GetMediaType
00000149 7.77484708 [1612] XVID 00BD0510 CheckTransform
00000150 7.77488591 [1612] XVID 00BD0510 SetMediaType
00000151 7.77494514 [1612] XVID 00BD0510 ChangeColorspace
00000152 7.77497978 [1612] XVID 00BD0510 ChangeColorspace, flip 80000000
00000153 7.77502699 [1612] YUY2
00000154 7.77507085 [1612] XVID 00BD0510 CheckTransform
00000155 7.77513315 [1612] DecideBufferSize
00000156 7.77517534 [1612] XVID 00BD0510 GetMediaType
00000157 7.77525523 [1612] XVID 00BD0510 CheckTransform
00000158 7.77529882 [1612] XVID 00BD0510 GetMediaType
...
00000176 7.77599751 [1612] XVID 00BD0510 GetMediaType
00000177 7.77627827 [1612] XVID 00BD0510 CheckTransform
00000178 7.78003517 [1612] XVID 00BD0510 CheckTransform
00000179 7.82868409 [1612] XVID 00BD0510 Transform
00000180 7.82877349 [1612] XVID 00BD0510 ChangeColorspace
00000181 7.82941407 [1612] XVID 00BD0510 ChangeColorspace, flip 0
00000182 7.83758494 [1612] YUY2
00000183 7.83774362 [1612] B-Frame decoder lag
00000184 7.85403284 [1612] XVID 00BD0510 Transform
00000185 7.85417504 [1612] B-Frame decoder lag
00000186 7.85434294 [1612] XVID 00BD0510 Transform
00000187 7.85581212 [1612] B-Frame decoder lag
00000188 7.86051412 [1612] XVID 00BD0510 Transform
...
00000400 15.86506162 [1612] XVID 00BD0510 Transform
00000401 15.89918607 [1612] Constructor
00000402 15.90036667 [1612] joinfiltergraph, cfgDlgHwnd:0
00000403 15.90045355 [1612] CheckInputType
00000404 15.90049238 [1612] FORMAT_VideoInfo: width:712, height:432, AvgTimePerFrame:400000
00000405 15.90058262 [1612] XVID, 712, 432
00000406 15.90174170 [1612] XVID 00BD0510 Transform
00000407 15.92279047 [1612] XVID 0160E190 Constructor
00000408 15.92377718 [1612] XVID 0160E190 CheckInputType
00000409 15.92383026 [1612] XVID 0160E190 SetMediaType
00000410 15.92428703 [1612] XVID 0160E190 GetMediaType
...
00000419 15.92463204 [1612] XVID 0160E190 GetMediaType
00000420 15.92479575 [1612] joinfiltergraph, cfgDlgHwnd:0
00000421 15.92485414 [1612] XVID 0160E190 GetMediaType
00000422 15.92489325 [1612] XVID 0160E190 CheckTransform
00000423 15.92493012 [1612] XVID 0160E190 SetMediaType
00000424 15.92496532 [1612] XVID 0160E190 ChangeColorspace
00000425 15.92500108 [1612] XVID 0160E190 ChangeColorspace, flip 80000000
00000426 15.92504466 [1612] YUY2
00000427 15.92506869 [1612] CheckInputType
00000428 15.92510557 [1612] FORMAT_VideoInfo2: width:712, height:432, AvgTimePerFrame:0, aspectX:712, aspectY:432, controlFlags:0
00000429 15.92514160 [1612] YUY2, 712, 432
...
00000502 15.92784446 [1612] XVID 0160E190 GetMediaType
00000503 15.92797353 [1612] XVID 0160E190 GetMediaType
00000504 15.92801320 [1612] XVID 0160E190 CheckTransform
00000505 15.92805035 [1612] XVID 0160E190 SetMediaType
00000506 15.92808527 [1612] XVID 0160E190 ChangeColorspace
00000507 15.92812103 [1612] XVID 0160E190 ChangeColorspace, flip 80000000
00000508 15.92815484 [1612] YUY2
00000509 15.92823557 [1612] XVID 0160E190 GetMediaType
...
00000518 15.92860014 [1612] XVID 0160E190 GetMediaType
00000519 15.92861132 [1612] DecideBufferSize
00000520 15.92864680 [1612] XVID 0160E190 CheckTransform
00000521 15.93220116 [1612] XVID 0160E190 CheckTransform
00000522 15.93230899 [1612] Destructor
00000523 15.94029632 [1612] XVID 00BD0510 Transform
...
00000578 18.01974134 [1612] XVID 00BD0510 Transform
00001562 289.15863329 [1612] XVID 00BD0510 Destructor
00001563 289.16307687 [1612] XVID 0160E190 Destructor


First, the instance of CXvidDecoder was created at 00BD0510,
and after various manipulations it was left playing with
rgb_flip setting 0 (line 181).

Then, another instance was created at 0160E190. After all, it is
legitimate to create as many XviD decoders as desired, isn't it ?
This new instance receives SetMediaType calls, and through
ChangeColorspace modifies rgb_flip, which (being a global variable)
afects the first (main) decoder, making it flip the picture being
played (as rgb_flip is used in Transform).

By making rgb_flip class member the problem is solved (tested).
Did you do the same in xvid.ax7 ?

Conclusion: global variables are EVIL.

[edit] 02/06 CVS source does not use rgb_flip in Transform anymore,
so it seems to solve the flipping problem too, since it does not
flip at all. Is that true ? I wonder if such behavior is correct ?

sysKin
7th February 2004, 09:21
Originally posted by vass-iliskus
By making rgb_flip class member the problem is solved (tested).
Did you do the same in xvid.ax7 ?

Conclusion: global variables are EVIL.Yes exactly, I made it a class variable and I commited the code too. I wonder why it was a global variable in the first place - we all do everything we can to avoid them, for obvious reasons.

Your debug output made me wonder - why it used rgb_flip in YUY2 colourspace at all? Was it RC1 code (it had it wrong)? Current code can only activate rgb_flip for RGB colorspaces - which might be why I can't reproduce that.
01/06 CVS source does not use rgb_flip in Transform anymore,
so it seems to solve the flipping problem too, since it does not
flip at all. Is that true ? I wonder if such behavior is correct ? It does:

m_frame.output.csp &= ~XVID_CSP_VFLIP;
m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0);

Kinda complicated way but, well, works ;>

Thanks a lot for your tests - if it's really fixed, I'll make Koepi release RC2 :D

Radek

PS. I'm still worried about the crash.

vass-iliskus
7th February 2004, 09:32
Originally posted by sysKin
Your debug output made me wonder - why it used rgb_flip in YUY2 colourspace at all? Was it RC1 code (it had it wrong)?
Yes, it was RC1 code, as it was originally complained about...

Current code can only activate rgb_flip for RGB colorspaces - which might be why I can't reproduce that.
It does:

m_frame.output.csp &= ~XVID_CSP_VFLIP;
m_frame.output.csp |= rgb_flip^(g_config.nFlipVideo ? XVID_CSP_VFLIP : 0);
What do you call "current code" ? xvid_20040206 sources from xvid.org do not have that code :confused:

Kinda complicated way but, well, works ;>
It looks very similar to RC1 ;)

m_frame.output.csp &= ~XVID_CSP_VFLIP;
m_frame.output.csp |= rgb_flip^(PPSettings.bFlipVideo ? XVID_CSP_VFLIP : 0);
But nothing like that in xvid_20040206...

sysKin
7th February 2004, 09:45
Originally posted by vass-iliskus
What do you call "current code" ? xvid_20040206 sources from xvid.org do not have that code :confused:I just downloaded the "latest" tarball and well, it's ancient :D It looks like cvs-head or maybe even dev-api-3, but bitstream version is 0015 (cvs-head had 0009 I think, current dev-api-4 has 0028). No idea what this is.

It seems that cvs is the only reliable way to get the current code :(

Radek

vass-iliskus
7th February 2004, 14:44
That's nice :) Switching to cvs...

BTW, rgb_flip is not the only global object. When CXvidDecoder is created, it calls xvid_global_func(0, XVID_GBL_INIT, &init, NULL).
I saw nothing suspicious in xvid_gbl_init(), still you obviuosly can answer this better - what happens when it is called in the middle of a frame decoding ?

DavidW
7th February 2004, 17:03
Posted by sysKin:

Please check this out ASAP: http://syskin.cjb.net/xvid.ax7.zipI must not have been fast enough. It says that the file does not exist. :(Posted by snowcrash:

Well, today I did a clean install of Windows XP, installed WMP9 and then XVID RC1 and now I'm not seeing any flipping in XVID videos. So I guess I have to apologize, apparently the problem is not caused by XVID itself, but must be due to some interaction with other software. I'll keep an eye on it and see if it comes back. @sysKin,
Hmmm... I'm tempted to do the same and see if it resolves my problems, but I'll hold off if you want me to so that you can finish troubleshooting the crash.Posted by sysKin:

Thanks a lot for your tests - if it's really fixed, I'll make Koepi release RC2 I can't get to your xvid.ax7 file, and there is an RC2 released today. Does that means it's fixed?! Hopefully I'll be able to finish downloading it in a few minuites and give it a try. (Maybe my computer is messed up again. First I can't download your ax7 code, now Keopi's site is downloading extremely slow.)Posted by sysKin:
PS. I'm still worried about the crash. I appreciate all your help and efforts, but I wouldn't be too worried about it. I haven't seen anyone else complain about a crash in WMP9. Snowcrash said he wasn't even sure if he had crashes or not.

I'll post back soon and let everyone know how the RC2 build works for me.

--David

DavidW
7th February 2004, 17:28
Well, RC2 appears to have fixed the flip but I still get the .5 - 2 second slow down occuring in the same spot right before the flip used to occur and I had it crash once afterwards also.

Event Type: Error
Event Source: Application Error
Event Category: None
Event ID: 1000
Date: 2/7/2004
Time: 10:21:13 AM
User: N/A
Computer: *******
Description:
Faulting application wmplayer.exe, version 9.0.0.2980, faulting module xvidcore.dll, version 0.0.0.0, fault address 0x00071088.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 77 6d 70 ure wmp
0018: 6c 61 79 65 72 2e 65 78 layer.ex
0020: 65 20 39 2e 30 2e 30 2e e 9.0.0.
0028: 32 39 38 30 20 69 6e 20 2980 in
0030: 78 76 69 64 63 6f 72 65 xvidcore
0038: 2e 64 6c 6c 20 30 2e 30 .dll 0.0
0040: 2e 30 2e 30 20 61 74 20 .0.0 at
0048: 6f 66 66 73 65 74 20 30 offset 0
0050: 30 30 37 31 30 38 38 0d 0071088.
0058: 0a .
I was also finally able to get your new xvid.ax file downloaded. Should I install that one or was that code already in RC2?

I'm trying to get together a small clip that I can get to you to reproduce the problem with. All of my movies are 1 - 3 hours long and I'm not familiar with splitting one so please be patient.

Also, is there somewhere I can upload this to you? I don't have means of getting anything larger than 1MB to you.

Thanks again,
David

DavidW
7th February 2004, 17:58
Ah... more information to shed some light on the slow down/crash problem.

The slow down only seems to occur when another movie is queued up to play after the curent move OR when the current movie is set to repeat. I'm pretty sure the same will be true for the crash since it often happens around that same time, but I can't confirm that.

I'm deffinitely not knowledgable enough about the programming side of this stuff, but it's seems like it may be something to do with the XviD codec loading up the first couple hundred frames of the next video?

Maybe that was what the global variable thing was about. Maybe WMP9 launched another instance of the XviD codec to start processing the next video and the second instance is conflicting with the first?

Just an idea.
Posted by sysKin:

Ah, I played with WMP9 a bit more. Have you seen how it can't seek or fast-forward with "video mixing renderer" disabled? But only with XviD! This is strange, because I always thought seeking has nothing to do with decoder - it's a splitter thingy.

I'll try to resolve this mistery, maybe it will help with the main problem. Any help from anyone more experienced with dshow is appreciated - I have never programmed directshow before, at all.
I have noticed that, and while it is slightly annoying, I didn't think it was worth bothering anyone about. Someone told me that I didn't have enough I-frames for it to do the skipping but I encoded a movie with an I-frame every second and it still wouldn't do it. (shrug).

It would be nice to be able to skip forward in a movie using the media center remote though. so if you want to take a stab at it, it'd be appreciated.

--David

vass-iliskus
7th February 2004, 20:33
Originally posted by DavidW
Faulting application wmplayer.exe, version 9.0.0.2980, faulting module xvidcore.dll, version 0.0.0.0, fault address 0x00071088.

That's interpolate8x8_halfpel_h_xmm

movq mm0, [eax] (COPY_H_SSE_RND0)

DavidW
9th February 2004, 15:38
@sysKin,

Are you still interested in having me help you with testing fixes and/or reproducing this crash with WMP9?

If not, I'm going to format and relaod my systems soon and see if that helps any. I just don't want to resolve the problem before you have a chance to give it another shot (if you want to).

--David

sysKin
9th February 2004, 16:36
Originally posted by DavidW
Are you still interested in having me help you with testing fixes and/or reproducing this crash with WMP9?

If not, I'm going to format and relaod my systems soon and see if that helps any. I just don't want to resolve the problem before you have a chance to give it another shot (if you want to).
At this moment I have to say it's VERY weird. I have no idea if I'll resolve the problem. By accident maybe.

I have to reinstall my system too (can't even code now, it b0rked completely) so I'll be busy...

Not really good news, is it.
Radek

DavidW
9th February 2004, 16:49
<snicker>

Looks like you have te same problem I do with messing your system up on a regular basis. :)

I usually just keep a ghost copy of the base install so that I can format and reload quickly, but I've been messing with network installs and such lately at work so I'm planning on using that method this time. It will be at least this weekend, but probably next week sometime before I can start doing that. (Valentines Day on a weekend... blech...)

Do you think there is any truth to my theory that WMP9 loads a second instance of the decoder to process the next movie's first frames and that may be causing the problem?

Anyway, good luck with your reload.

--David

sysKin
9th February 2004, 17:09
Originally posted by DavidW
Do you think there is any truth to my theory that WMP9 loads a second instance of the decoder to process the next movie's first frames and that may be causing the problem?I'm sure if it - what I don't understand is why it causes a crash. The core is thredsafe by all means, and it is perfectly OK to run as many initializations and decoders as many you want. Unless we missed something.

Hell I don't even know if it's the first or second decoder that crashes. And I'm not good enough to find out.

But mostly, I am really sick of this 1.0 version. Bughunting is *not* fun...

DavidW
9th February 2004, 17:44
I know what you mean. I've been deploying Windows XP here at work lately and every little thing that comes up witha problem recently is my fault. Regardless of wether or not it has anything to do with Windows XP, it's my fault becasue it didn't happen before Windows XP was on the system.

Anyway, you won't hear anymore from me on this crash thing. I'm happy with the decoder as long as it doesn't crash anytime I play a movie. I just won't have playlists of long movies (seems to happen mostly on 3 hour movies) or loop them.

My goal is to have a movie library on my network. I rarely will want to watch two or more movies back to back anyway. :)

Let me know when/if you ever want to give it another try and I'll be happy to help in any way that I can. Until then I'll lay low and give you a break on this thread.

--David