ZMBV Codec Bug

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

ZMBV Codec Bug

Postby Roxor » 2006-5-14 @ 01:01

This bug appears to affect the ZMBV codec that comes with the Windows version of DOSBox 0.65.

Encode a video file with DOSBox under x86 Windows - File plays correctly with the ZMBV codec.

Encode a video file with DOSBox under x64 Windows - File played with the ZMBV codec has the red and blue in the pallete swapped.

Evidently this bug only seems to manifest itself under x64 Windows, suggesting that x64 Windows may have trouble handling the output from the codec.
User avatar
Roxor
Newbie
 
Posts: 55
Joined: 2006-2-14 @ 13:17

Re: ZMBV Codec Bug

Postby Kronuz » 2006-5-14 @ 03:34

Hey, how did you manage to get ZMBV running under Windows x64!! ?
Kronuz
"Time is of the essence"
User avatar
Kronuz
Member
 
Posts: 103
Joined: 2005-11-23 @ 19:27

Re: ZMBV Codec Bug

Postby Roxor » 2006-5-14 @ 22:35

Kronuz wrote:Hey, how did you manage to get ZMBV running under Windows x64!! ?


Some fiddling around with my codec pack's settings and a lot of luck. By default ZMBV is disabled in the K-Lite Codec Pack's settings even if you've installed it through the link supplied with DOSBox.
User avatar
Roxor
Newbie
 
Posts: 55
Joined: 2006-2-14 @ 13:17

Re: ZMBV Codec Bug

Postby Qbix » 2006-5-15 @ 06:23

so maybe the k-lite version of ZMBV codec is broken ?
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10099
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: ZMBV Codec Bug

Postby HunterZ » 2006-5-15 @ 15:46

Is there an official site where the latest version of ZMBV is maintained?

An interesting page: http://wiki.multimedia.cx/index.php?tit ... ture_Codec
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 5950
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: ZMBV Codec Bug

Postby Harekiet » 2006-5-15 @ 20:49

The ffdshow zmbv decompression just seems somewhat bugged with swapping some colors, complain to them :)
User avatar
Harekiet
DOSBox Author
 
Posts: 1034
Joined: 2002-7-01 @ 07:14
Location: Fryslan

Re: ZMBV Codec Bug

Postby Kronuz » 2006-5-16 @ 02:21

I've tried to make it work in Windows x64 without any luck... could someone post more specific details on how to get it going working please? :P
Thanks. :happyhappy:
Kronuz
"Time is of the essence"
User avatar
Kronuz
Member
 
Posts: 103
Joined: 2005-11-23 @ 19:27

Re: ZMBV Codec Bug

Postby jbprime » 2006-6-16 @ 01:22

In XP x64, after I installed the ZMBV codec using the DosBox link, I couldn't get the videos to play. I poked around in my registry a bit and tried to mirror the registry entries of my Divx codec (had to update a drivers.desc registry key and something under ControlSet002), but I'm more inclined to believe I fixed it by copying the zmbv.dll file from my Windows/System32 folder (where it installed) my Windows/SysWOW64 folder. I'd try copying the file first before messing with the registry.
jbprime
Newbie
 
Posts: 1
Joined: 2006-6-16 @ 01:14

Re: ZMBV Codec Bug

Postby Kronuz » 2006-6-16 @ 03:06

It seems the ffdshow zmbv decompression is inverting the blue with the red decoding pixels as BGR instead of RGB. I think that's the problem... perhaps the ZMBV "specs" say something about the pixel encoding format?
Kronuz
"Time is of the essence"
User avatar
Kronuz
Member
 
Posts: 103
Joined: 2005-11-23 @ 19:27

Re: ZMBV Codec Bug

Postby Kronuz » 2006-6-16 @ 04:26

Okay, I've fixed the libavcodec that comes with ffdshow...
I'm attaching a patch here, but I'll also send an email to the libavcodec guys to see if they can fix the issue in their source code too.

Although, honestly, I think the bug is in not in the ffdshow zmbv implementation but in the one we're using...
zmbv.cpp file, lines 491-493 are:
Code: Select all
  *w++=palette[c*4+2];
  *w++=palette[c*4+1];
  *w++=palette[c*4+0];

I think they should be:
Code: Select all
  *w++=palette[c*4+0];
  *w++=palette[c*4+1];
  *w++=palette[c*4+2];


Anyway, for a fix in the ffdshow, just copy and apply the patch to wherever the libavcodec.dll file is...
It should be in:
C:\Program Files\K-Lite Codec Pack\ffdshow

(or something like that)
Attachments
libavcodec_ZMBV_fix_by_Kronuz.zip
libavcodec ZMBV fix
(40.35 KiB) Downloaded 3150 times
Kronuz
"Time is of the essence"
User avatar
Kronuz
Member
 
Posts: 103
Joined: 2005-11-23 @ 19:27

Re: ZMBV Codec Bug

Postby Roxor » 2006-6-17 @ 06:19

Mate, this patch is EXACTLY what was needed. Now I can watch ZMBV encoded video with the correct colours. Thanks a billion!
User avatar
Roxor
Newbie
 
Posts: 55
Joined: 2006-2-14 @ 13:17

Re: ZMBV Codec Bug

Postby dissonant » 2007-3-10 @ 08:36

This looks like a pretty old thread, but I'm stuck. I still have the red/blue colour inversion.

I tried the patch, but it says: No matches found or file(s) already patched. I'm using K-Lite Codec Pack 2.85, which seems to have a libavcodec.dll file that's newer than this thread. I'm using plain old Windows XP SP2.

Any updates or ideas?

Edit: Well, I got it to work by uninstalling K-Lite and installing the latest Defilerpak beta. Then installing ZMBV after that. Hooray!
User avatar
dissonant
Newbie
 
Posts: 1
Joined: 2007-3-10 @ 08:28

Re: ZMBV Codec Bug

Postby DosFreak » 2007-3-10 @ 11:57

Yep, never install klite again. It always does weird crap like that.
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"People like coldplay and voted for the nazis, you can't trust people."
User avatar
DosFreak
l33t++
 
Posts: 9066
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: ZMBV Codec Bug

Postby Roxor » 2007-3-11 @ 05:01

You might find this shader for Media Player Classic useful:

15=red-blue swap|ps_1_1|sampler s0 : register(s0);\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = tex2D(s0, tex);\n\treturn float4 (c0[2],c0[1],c0[0],0);\n}

Just add this to the end of the shader list in mplayerc.ini and change the number 15 at the start to something else if your list of shaders doesn't end at 14.

When playing a video file where the red and blue are swapped, just load up this shader, and PRESTO! Problem solved.
User avatar
Roxor
Newbie
 
Posts: 55
Joined: 2006-2-14 @ 13:17

Re: ZMBV Codec Bug

Postby romantic » 2007-10-26 @ 02:46

Currently running fully updated Windows XP SP2 and too got problems recording with the “zombie” codec. Tried out all I could think of and the forum stuff – nothing has helped, so I tried reinstalling some programmes and eventually made it work, though in the Prince of Persia I the arrows at the bottom left of the screen while viewing recorded game now look not so sharp as before (even at low resolution there appear squares, rather than arrows, and in the same time arrows at the bottom right look fine).

Anyway here what brought right colours back in my case: first I have uninstalled the DOSBox and the ZMBV codec, then uninstalled the K-Lite Codec Pack which had informed me that the ZMBV codec was broken and prompted to remove any sign of it from the registry, which I of course agreed to. Then I installed the DOSBox again without installing the “zombie” codec and then installed K-Lite Codec Pack 3.5.3.

At present I’m able to capture right coloured video from the DOSBox without installing the ZMBV codec (which comes with it) at all. Although, when playing recorded videos with Media Player Classic from the K-Lite Codec Pack 3.5.3, the arrows in the bottom left of the monitor appear blur, after encoding video files into .mpg format, the arrows looks very sharp even in the full screen mode. The arrows remain sharp also after encoding the .mpg file into .vob or .avi one.

Hope this information will be helpful. In case you have questions, feel free to post them, and I’ll lay out some more details.
To be happy, just make the others feel the same way!
User avatar
romantic
Newbie
 
Posts: 6
Joined: 2007-10-26 @ 01:37
Location: Ελλάς

Re: ZMBV Codec Bug

Postby wd » 2007-10-26 @ 06:27

As noted above the k-lite decoder is bugged.
wd
DOSBox Author
 
Posts: 10818
Joined: 2003-12-03 @ 21:23

Re: ZMBV Codec Bug

Postby romantic » 2007-10-26 @ 21:57

As far as I’m concerned the K-Lite decoder is not bugged, but the KMPlayer one may be. Since my last post I’ve messed around with codec a little bit more and solved the problem with sharpness during playback on the Media Player Classic.

The thing which no one messing with codec should ever forget is not to mix together different codec patches, that is installing one and only one version of the same codec at a time.

My mistake was mixing together the ZMBV codec from K-Lite Codec Pack and the same codec from the DOSBox single codec patch. Because during playback the Media Player Classic uses codec not only from its internal directory, but also from the “system32” system folder, the conflict occurs as DOSBox ZMBV codec installs itself in the “system32” folder, and as a result the Media Player Classic try to use for playing back of the video files two ZMBV codec at the same time. That’s why if someone tries to play the same video encoded by DOSBox “zombie” codec on the Windows Media Player which doesn’t have a ZMBV codec of its own, but uses only the one installed in the “system32” folder, the colours will show up right. Unlike the Media Player Classic and the Windows Media Player, the KMPlayer uses codec only from its internal directory, and that is why it doesn’t get affected by the DOSBox ZMBV codec installed to “system32” folder.

Other important thing is that DOSBox encodes video with right colours no matter what, because it uses for encoding video files not the ZMBV codec installed to “system32” folder needed only for playing back recorded videos, but built in ZMBV codec, just like the KMPlayer uses only built in codec for media files playback. To check if it’s true, try not installing the DOSBox “zombie” codec – you will still be able to capture videos and to play them with right colours on the Media Player Classic, as I did (but you won’t be able to play videos with the Windows Media Player, because it does not have a ZMBV codec of its own). The only problem will be the rather bad sharpness, which can be solved simply by not installing the ZMBV codec which comes with the K-Lite Codec Pack.

To do that, while installing a K-Lite Codec Pack, make sure to deselect the function of playing the ZMBV and a few other codec at the bottom of the last window before starting the installation, since you won’t be able to disable this codec after installation is completed. After installing a K-Lite Codec Pack go to its “Video decoder configuration” and check if ZMBV codec is disabled, if not reinstall the Codec Pack and deselect the ZMBV codec playback function. In this way, for playing back videos encoded with a ZMBV codec, the Media Player Classic and Windows Media Player will use the ZMBV codec supplied by the DOSBox after you install it to the “system32” folder, and the video will be coloured and sharp at the same time.
To be happy, just make the others feel the same way!
User avatar
romantic
Newbie
 
Posts: 6
Joined: 2007-10-26 @ 01:37
Location: Ελλάς


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 0 guests