Author Topic: FF7 movies decoding enhancement  (Read 16910 times)

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
FF7 movies decoding enhancement
« on: 2007-01-01 19:54:30 »
I'm trying to enhance the look of movies and so far I have no luck. Let me explain.
I was able to get these two ingame playbacks:

1. decoding by original TrueMotion decoder
2. decoding by ffdshow filter


1                                                                                  2

Both are bad.
1. TrueMotion decoding has this strange grainy overlay...it's not that bad on this scaled picture but click it for fullscreen and you'll see what I mean (especially the black area). That's the way it looks in game. I don't like the grains and I don't know how to disable this overlay in TM. Any suggestions?
2. You can see that with this ffdshow decoding the colours are too glowy. It looks ugly and besides that considerably mismatches ingame colours. There are those scenes where game switches between FMV and game engine and with those glowy colour it feels like a fist in the eye. Unfortunately with the newer versions of ffdshow you can't even use this decoding anymore (this "black screen and Eidos theme heard" issue that's been showing up lately in the forums).

Now if I play the movies in Media player or BSplayer with TrueMotion decoding it does not have this grainy overlay...observe:

No dots. That's the way I want it to look in game. But how?

I've come to idea that maybe encoding all the videos with another codec (e.g. xvid) could do the job. So I've loaded it in VirtualDub to recompress it with xvid. It uses this TrueMotion 2X version 2.5.2.2 for VFW to load videos. Even then it's noticable that the video has stains in the place of grains (mainly visible in the black areas). It's better than this grainy overlay but still not that good and clean as in common player. I can try any codec with any settings the stains will be there on the recompressed video. Like on this xvid TMsample.avi (2.6 Mb).

I admit I am not very experienced with those encoding/decoding things so please, give me some pointers. How can I load the videos in VirtualDub without the stains...like the players do? Or even better how can I make the game playback the original TM videos without the grainy overlay and still without ridiculous colours?

I'm still wondering how comes that with newer ffdshow the game cannot run the movies as before even when Media Player has no problems (although it's the same old glowy-colours story). I've tampered with the latest ffdshow decoder settings and the only thing I was able to achieve was this:

..which makes the game use the grainy TrueMotion decoder even when ffdshow is set to use "libavcodec" for decoding. The same goes for DV settings. When I removed TrueMotion codec the game was not able to handle the movies. As if it was referring only to TrueMotion decoder itself. Strangely enough Media player was using only ffdshow as a decoder with this settings.
Could someone experienced with ffdshow explain me that, please?

« Last Edit: 2007-01-01 20:00:29 by miracle.flame »

Borde

  • *
  • Posts: 891
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #1 on: 2007-01-01 21:41:43 »
I haven't got much experience with ffdshow, but I can tell why you will never get the movies to look the way you want without modifyging the engine: color depth. Final Fantasy works with a 16 bpp color mode. There is a patch to switch to 32 bpp, and you will notice movies look slightly better. Unfortunately, you will also notice a wide vertical line in the middle of the movies and many more graphical glitches in-game.
If you could at least use higher resolution movies, you could reduce the gainyness greatly (try playing the game at 320x240 to see what I mean).
I know The Saint was working to improve the 32bpp support, but I have no idea how is it comming along.
Sorry for not being able to provide you with more useful info.
« Last Edit: 2007-01-01 21:43:17 by Borde »

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #2 on: 2007-01-03 18:23:59 »
I see.
Well after realizing that one cannot get more than 16 bit coulors in game I was back to square one. I've tried Cetra to boost color depth and it looked exactly the same as in VirtualDub (like that TMsample.avi) but there were those issues you've mentioned.

If you could at least use higher resolution movies, you could reduce the gainyness greatly (try playing the game at 320x240 to see what I mean).
I've just tried that and couldn't see any difference. Original resolution of the FMVs is 320x224 so if the game scales it up in 640x480 mode it should look pretty much the same as in 320x240. The same goes for 1280x960 with hi-res patch.

I know The Saint was working to improve the 32bpp support, but I have no idea how is it comming along.
Sorry for not being able to provide you with more useful info.
Which project are you talking about?  :?

I took a different approach and wanted to enhance 16 bpp video as much as possible. If I reencode the videos normally..with xvid for example, the game will translate it into 16 bit mode by itself and it wouldn't look good.
But with these settings in Virtualdub...:

1. Video -> color depth -> Output format to compressor/display = 16 bit RGB (555)
2. Video -> filters ->
  • levels -> input levels [0;1.100;255]   - to match the game colors even more
  • temporal smoother=6   - for better look and reducing noise

...I got this (21 MB). You can try it in game and tell me what you think. I'd say it's better than worst. Definitely more acceptable than those grains or loud colors.
I'll put the file down after some time so you won't accuse me of distributing illegal material.  :roll:

If you are using newer ffdshow filter you'd want to disable decoding of Xvid or even better enable overlay mixer like on the above pic. Otherwise you will get black screen with background theme heard.
I have a tip for those who run in this accidentally. As you know you can't alt+tab or ctrl+alt+del out of it and other keys won't help neither. Wrong... if you are able to put your computer into suspended mode by pressing "sleep key" this can help you. Press that key and wait. After about 20 seconds all will suspend and when you "wake up" you'll be able to terminate ff7.exe via task manager. It's better than hard reset.

I'd like to hear any other suggestions of improving the videos.
« Last Edit: 2007-01-05 23:04:16 by miracle.flame »

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #3 on: 2007-01-03 23:44:29 »
All you are doing is playing with the old data.  Sure you can clean it up a bit. Unless you are using something like fractal interpolation and such you can't really enhance the resolution all that much. You are dealing with too little data to improve on the AVI.  The playstation Video's are actually higher resolution (24bit versus 16 bit) than the PCs.  Pretty much you can't remake the video's even if you wanted to.  I recomend searching the forums because this has been tried before.  There is a gross lack of the original data to start with.  If you have the Playstation version it's best to extract the movies from that and use those with the PC, however the PC version will be missing sounds some sound was added to the movies because of issues with playing MIDI sequences in the middle of a movie.

Cyb

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #4 on: 2007-01-04 01:41:11 »
You are possibly referring to this topic? I am aware. And especially that message is the one I agree with most.

Let's get this straight. There are two programmed movie limitations in FF7PC. Resolution up to 320x240 and 16 bit color depth.
PC version movies ARE in fact 24 bit colored. But the game displays them only in 16 bit colors. That's what makes them so crappy.
The same goes for resolution. I am able to resize the PC movies with smart filters and they would look much better but the game code won't accept anything higher than 320x240. So even if the PS version (which I don't have) is in higher res and deeper color depth that would be of no avail.

I've made some progress so far and I think there will be more. If only a could figure out how to use ffdshow as encoder in VirtualDub. There are some nice filters I'd like to try. But everytime I try to save avi using ffdshow for compression I get this error message "The source image format is not acceptable".  Why's that? :|

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #5 on: 2007-01-04 03:41:29 »
Well that is a problem with virtual dub, likely you should ask on Doom9 forums.  The on thing is I can't use FFDshow to scale the image output of mplayer (mutter) I use MPC (media player classic) it worked beautifully before I got this new video card (sigh).

Cyb

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #6 on: 2007-01-05 23:56:16 »
I've learned that Indeo 5.10 codec works miracles to movies that are to be displayed in 16 bit colors. It uses some sort of overlay filter composed of colored grains (which are static and unobtrusive contrary to TrueMotion grains) and through this the movies look almost like in 24 bit colors. It's fantastic!

With minor improvements with VirtualDub filters...

1. don't change color depth settings as in my first try
2. Video -> filters ->
  • levels -> input levels [4; 1.000; 255]   - to reduce noise considerably
  • HSV adjust -> saturation 115%   - to regain saturation lost due to that overlay filter..so the colors match ingame
  • temporal smoother=5   - additional noise reduction and smoothness
Oh and having checked "scalability" in Indeo configuration seems to have great impact on improving quality although I wonder why.

...here is the result. You may compare with the first one. It's the best output I've seen. You have to use it in game to see the difference.
I think that's it. Unless there is a way to use higher resolution videos I think nothing much more can be improved. And as Borde mentioned that would demand altering the game code.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #7 on: 2007-01-06 03:05:25 »
Well the only way to improve the video would be to redo it from scratch. That's not possible anymore.  (I think it was originally done with Alias on an SGI all the information used in the animation have been gone since the PS1 version went gold in 1997 Square apparently learn a valuable lesson of what NOT to do for retaining data for there games after this but the original data is GONE ).

Unless someone wants to do a massive and difficult project of making models for these scenes you can't make a very good high rez video for FF7. Even THEN the engine itself will be the obstacle.  This does not include Q-gears, but with Q-gears the problem then becomes another issue.  That's pretty much it.

Cyb

Wuz

  • *
  • Posts: 85
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #8 on: 2007-01-06 09:51:19 »
just tried your opening avi... pretty good to see it ingame without the grainyness :)

CkRtech

  • *
  • Posts: 18
    • View Profile
    • http://foxyford83.proboards20.com/
Re: FF7 movies decoding enhancement
« Reply #9 on: 2007-01-07 18:51:40 »
I've made some progress so far and I think there will be more. If only a could figure out how to use ffdshow as encoder in VirtualDub. There are some nice filters I'd like to try. But everytime I try to save avi using ffdshow for compression I get this error message "The source image format is not acceptable".  Why's that? :|

Quite a few codecs will not allow a resolution that is not in their "relm of acceptable resolutions" or is not within a proper aspect ratio. Obviously, any movie can be stretched to fill up a standard screen & maintain the 4:3 aspect ratio....but the codecs may require that the movie itself be 4:3 because it is going to assume that pixels are all perfectly square.

If the original resolution is 320x224, then you are dealing with an aspect ratio of 1.43 instead of 1.333.

The thing that is odd is that I am assuming that you are doing an image transform to 320x240 before attempting to save the movie & it is still not allowing that.

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #10 on: 2007-01-08 23:24:01 »
I've tried to rezise the video to 320x240, save and then open it to see if ffdshow would accept it now. No, it didn't. When choosing encoder there are these lines written by fddshow:
Code: [Select]
Couldn't find compatible format.
Possible reasons:
* Codec may only support YUV
* Codec might be locked
* Codec might be decompression-only

I am satisfied with the Indeo output now but thanks for the info anyway.



EDIT: Just noticed that Indeo encoded videos are displayed jerky in game if I have Anti-aliasing turned on on my ATI Radeon 9600. If you are experiencing strange Indeo movies playback turn off your forced AA.

EDIT2: This was caused by OSD fps of ATI Tray Tools. It's better to turn it off instead of AA.
« Last Edit: 2007-01-15 12:50:36 by miracle.flame »

Salk

  • *
  • Posts: 570
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #11 on: 2007-01-11 08:51:13 »
I succeded pretty well in creating my own library of higher quality movies for the PC version of Final Fantasy VII. It was several months ago so I don't really remember what tools I have been using save VirtualDub and some filters that I have been looking for on the web (one of it being highly optimized for AMD64 processing capabilities).

I have only tested it on the Opening scene and of course Introduction as well and it works flawlessly.

As size, the files are *smaller* than the original ones thanks an effective use of video compression.

Still, the total amount is slightly over 500 Mbs (compared to over 800 Mbs of the original, lower quality ones).

For copyright reasons, I would not be able to make my movies public but let me just say that the improvement over the original PC counterparts is pretty much high, keeping in consideration the limitation of the resolution of course.  :wink:

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #12 on: 2007-01-11 09:12:56 »
A small sample of your opening wouldn't hurt. I've posted here an entire file you know. If someone is to blame one then I am certainly the first to go.
Let's compare your output with mine.

Salk

  • *
  • Posts: 570
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #13 on: 2007-01-11 09:37:46 »
I have no space to upload my file at.

I might send it to you privately. PM me if you are interested.  :-)

lparcshinoda

  • *
  • Posts: 56
  • The story never ends ...
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #14 on: 2007-01-11 14:49:53 »
Would be fine to have an enhanced video database available for everybody here....  :|

Salk

  • *
  • Posts: 570
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #15 on: 2007-01-11 15:06:31 »
It would be nice, yes but illegal from what I got to read in different topics.

If somebody can instead prove me wrong about this then by all means do it!

I and miracle.flame will try and create a enhanced video database to see if we can bring the quality of the video to another level, desipte the limitation of the low resolution but this doesn't mean that we will make it public.

Sorry about that...

lparcshinoda

  • *
  • Posts: 56
  • The story never ends ...
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #16 on: 2007-01-11 16:01:57 »
yes, very illegal  :-D but not if we manage to get a simple way the decode the videos in the right way. A decoding expert would be nice in this case to post a little guide  :lol:

twipley

  • *
  • Posts: 51
    • View Profile
    • custom user page on wikipedia
Re: FF7 movies decoding enhancement
« Reply #17 on: 2007-09-09 06:24:55 »
I've learned that Indeo 5.10 codec works miracles to movies that are to be displayed in 16 bit colors. It uses some sort of overlay filter composed of colored grains (which are static and unobtrusive contrary to TrueMotion grains) and through this the movies look almost like in 24 bit colors. It's fantastic!

With minor improvements with VirtualDub filters...

1. don't change color depth settings as in my first try
2. Video -> filters ->
  • levels -> input levels [4; 1.000; 255]   - to reduce noise considerably
  • HSV adjust -> saturation 115%   - to regain saturation lost due to that overlay filter..so the colors match ingame
  • temporal smoother=5   - additional noise reduction and smoothness
Oh and having checked "scalability" in Indeo configuration seems to have great impact on improving quality although I wonder why.

...here is the result. You may compare with the first one. It's the best output I've seen. You have to use it in game to see the difference.
I think that's it. Unless there is a way to use higher resolution videos I think nothing much more can be improved. And as Borde mentioned that would demand altering the game code.
Okay, I've encoded all my videos...
but now how do I disable the decoding of Indeo 5 in FFDShow?

I am only able to disable filtering of Indeo 2 and Indeo 3 codecs...
Please help, as I'm not very experimented in this field! :S

twipley

  • *
  • Posts: 51
    • View Profile
    • custom user page on wikipedia
Re: FF7 movies decoding enhancement
« Reply #18 on: 2007-09-09 16:53:53 »

One got to disable decoding of the codec (e.g. XVID or Indeo 5) in FFDShow, right?
Because right now I'm using default FFDShow video-decoding settings, but the videos played in the game engine seem worse than usual.

In fact, the colors are too intense...
So... what is the tweak I'm missing, there?



You can see that with this ffdshow decoding the colours are too glowy. It looks ugly and besides that considerably mismatches ingame colours. There are those scenes where game switches between FMV and game engine and with those glowy colour it feels like a fist in the eye. Unfortunately with the newer versions of ffdshow you can't even use this decoding anymore (this "black screen and Eidos theme heard" issue that's been showing up lately in the forums).

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #19 on: 2007-09-10 06:48:35 »
First.. you don't have to disable Indeo encoding if your videos are indeed encoden in Indeo. They are playing just fine. Just make sure you've pointed the path to YOUR videos and not the original from cd.

Second.. I don't know which version of ffdshow are you using but the one causing saturated colours is pretty old. With late ffdshow you should get black screen with sounds in the backqround issue. But that applies to the original TrueMotion encoded videos!

twipley

  • *
  • Posts: 51
    • View Profile
    • custom user page on wikipedia
Re: FF7 movies decoding enhancement
« Reply #20 on: 2007-09-10 21:14:33 »
Well then something is going weird.
I definitely have the latest version of K-Lite Standard installed,

and I've overwritten the movies contained in the images of my CDs,
so definitely this isn't the problem either.


I'll try to review the whole thing later,
and post feedback *if* things happen to get working.

twipley

  • *
  • Posts: 51
    • View Profile
    • custom user page on wikipedia
Re: FF7 movies decoding enhancement
« Reply #21 on: 2007-09-10 22:19:52 »
Having no codec registered / no codec pack installed / FFDShow uninstalled / having restarted XP :

Now I'm fairly confident the only traces of codecs on my PC are the native ones.
I could try a fresh VMWare install but I already have formatted and installed XP anew not so long ago.

So here are the results:
- opening the movie in WMP11, colors are still too glowy;
- when its run by the game engine, the end result is the same.


So... if it's not the codecs, it should be my encoding, right?
I've precisely used the very same settings as the final ones published by miracle.flame

VirtualDub's encoding has been verified, and here is GSpot's report:
[img=http://img299.imageshack.us/img299/4793/ff7movieencodingsqp9.jpg]

So... what more can I say? :S

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #22 on: 2007-09-10 22:49:34 »
what about a sample of that glowy colors?

twipley

  • *
  • Posts: 51
    • View Profile
    • custom user page on wikipedia
Re: FF7 movies decoding enhancement
« Reply #23 on: 2007-09-10 23:36:01 »
Since I presume this page will be seen by people who have actually bought the game, here is the opening movie, encoded with VirtualDub:

http://files-upload.com/files/494504/opening%20INDEO.rar
Password: qhimm
Size: 24 MBs

miracle.flame

  • *
  • Posts: 164
  • ^_^
    • View Profile
Re: FF7 movies decoding enhancement
« Reply #24 on: 2007-09-11 00:01:33 »
The coulours are indeed glowy but they and hard-encoded. They must've been glowy already when you've opened the original in VirtualDub. Problably wrong VFW codec used to load up video. Tweak tweak tweak.