Page 1 of 1

[Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 4:07 pm
by Heroflex
Hello there.

I'm new here and first I want to say thank you to the all the contributors of this project for their work.

I have most of the standard upgrades installed and am mightily impressed.

I noticed that there is a hook for replacing cutscene movies, which are by default in .snm format, and that Mr. Ansel has provided a .NET library for 'handling' these files.

I have an idea but I also have a knowledge gap that I need help with.

I would like to take the original cutscenes and dump them frame by frame in their highest possible quality and original resolution. Then I would like to use AI upscaling and interpolation to make higher resolution and frame rate videos.

I know how to do the upscaling and interpolation but I don't know how to manipulate the SNM files and I don't know what to do with this https://github.com/JeremyAnsel/JeremyAnsel.Xwa.Snm

Would anyone here be willing to help me or point me in the right direction please?

Thanks.

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 4:23 pm
by ual002
I think if you dig, you can find someone already used an AI to upscale the default vids. I'm not sure where exactly to point you though, but I have seen the vids.

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 4:29 pm
by JeremyaFr
Hello and welcome

You can use XwaSnmConverter to convert a SNM file to a AVI or MP4 file.

To use the library directly and process the frames one by one, you can do that with some code that looks like that:

Code: Select all

var snm = SnmFile.FromFile(filename);

snm.BeginPlay();

try
{
  while (snm.RetrieveNextFrame(out byte[] audioData, out byte[] videoData))
  {
    if (videoData != null)
    {
      // process video data
    }

    if (audioData != null)
    {
      // process audio data
    }
  }
}
finally
{
  snm.EndPlay();
}

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 4:44 pm
by Heroflex
ual002 wrote:
Fri Aug 07, 2020 4:23 pm
I think if you dig, you can find someone already used an AI to upscale the default vids. I'm not sure where exactly to point you though, but I have seen the vids.

I just found this https://www.youtube.com/watch?v=CiKzBP0F_zs but they're all edited together and there's no download link. I have left a comment asking if they're available separately to download, fingers crossed they do and if they don't then I'll ask permission to download the full video and split it myself.

Thanks for the tip!

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 4:45 pm
by Heroflex
JeremyaFr wrote:
Fri Aug 07, 2020 4:29 pm
Hello and welcome

You can use XwaSnmConverter to convert a SNM file to a AVI or MP4 file.

To use the library directly and process the frames one by one, you can do that with some code that looks like that:

Code: Select all

var snm = SnmFile.FromFile(filename);

snm.BeginPlay();

try
{
  while (snm.RetrieveNextFrame(out byte[] audioData, out byte[] videoData))
  {
    if (videoData != null)
    {
      // process video data
    }

    if (audioData != null)
    {
      // process audio data
    }
  }
}
finally
{
  snm.EndPlay();
}
Thank you very much Jeremy!

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 5:59 pm
by Ace Antilles
Heroflex wrote:
Fri Aug 07, 2020 4:44 pm
ual002 wrote:
Fri Aug 07, 2020 4:23 pm
I think if you dig, you can find someone already used an AI to upscale the default vids. I'm not sure where exactly to point you though, but I have seen the vids.

I just found this https://www.youtube.com/watch?v=CiKzBP0F_zs but they're all edited together and there's no download link. I have left a comment asking if they're available separately to download, fingers crossed they do and if they don't then I'll ask permission to download the full video and split it myself.

Thanks for the tip!
Marco has already made better hd versions of the cutscenes. I plan to host them asap to make them more visible for people.
I will find an post the forum link later.
That doesn't mean that you may not be able to do even better quality ones though :)

You can convert the videos to an editable Avi etc as Jeremy says above. No need to get poor YouTube conversions

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 7:42 pm
by Heroflex
Thanks! You guys are great!

Re: [Help] How to use Jeremy Ansel's SNM .NET library?

Posted: Fri Aug 07, 2020 7:53 pm
by Q
https://www.xwaupgrade.com/phpBB3/viewt ... le#p170290
Scroll to the bottom for the download link of all the cutscene videos upscaled to 1080P.