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

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

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

Heroflex
Recruit
Posts: 4
Joined: Fri Aug 07, 2020 3:50 pm

Post by Heroflex » Fri Aug 07, 2020 4:07 pm

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.

User avatar
ual002
XWAU Member
Posts: 983
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » 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.
Image Image Image Image Image

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » 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();
}

Heroflex
Recruit
Posts: 4
Joined: Fri Aug 07, 2020 3:50 pm

Post by Heroflex » 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!

Heroflex
Recruit
Posts: 4
Joined: Fri Aug 07, 2020 3:50 pm

Post by Heroflex » Fri Aug 07, 2020 4:45 pm

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!

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Fri Aug 07, 2020 5:59 pm

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
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Heroflex
Recruit
Posts: 4
Joined: Fri Aug 07, 2020 3:50 pm

Post by Heroflex » Fri Aug 07, 2020 7:42 pm

Thanks! You guys are great!

User avatar
Q
Ensign
Posts: 456
Joined: Sat Dec 28, 2002 12:01 am
Contact:

Post by Q » Fri Aug 07, 2020 7:53 pm

https://www.xwaupgrade.com/phpBB3/viewt ... le#p170290
Scroll to the bottom for the download link of all the cutscene videos upscaled to 1080P.
"I like work; it fascinates me. I can sit and look at it for hours."

Post Reply