na_game_tool 0.4.0 release

At last a new version, now with over a hundred various formats being supported!

About a third of them are console formats of mostly raw variety (you need just to figure out how tile data is represented) but some of them required some reverse engineering as well (e.g. Road Avenger employs LZ77-based compression). Another third comes from known sources (either The Wiki or ScummVM source code. Last third is from my reverse-engineering efforts on DOS games.

What’s next? I don’t make plans, but I like the idea (suggested by Paul of librempeg fame) to make the tool more versatile. So version 0.5.0 should at least support extracting data from game archives: some of the currently supported video formats can be found only inside large game archives, so why not provide a way to obtain the files as well?

Beside that, I’ll probably focus on more complex codecs, namely the ones that are based on other codecs like Cinepak, JPEG or Smacker. I’m not sure I’ll be able to find another dozen formats to RE but at least there should be something new beside merely archive extraction.

Meanwhile grab the current version here (or don’t, it shan’t make a difference).

14 Responses to “na_game_tool 0.4.0 release”

  1. Sembiance says:

    Awesome! Updated dexvert to use the new version and now discmaster is re-processing the CDs that have some files in these new formats. Thanks again for creating this tool!

    One thing, with this Trilobyte VDX: https://sembiance.com/fileFormatSamples/video/trilobyteVDX/FH.GJD
    After converting the video with ‘na_game_tool -ifmt vdx FH.GJD -ofmt avi out.avi’ the output appears messed up starting at 1m 20s. Not sure if this is normal or not.

  2. Paul says:

    The github profile of supported dexvert formats could mention librempeg too, as it supports even formats that dexvert are not aware of, among others. For example known sonarc 16bit and unknown PCA (Perfect Clarity Audio).

  3. Kostya says:

    @Sembiance

    That’s libavformat for you—too long AVI file with palette changes and it will decide it’s unsynchronised and will switch to a different mode that ignores palette changes. If you invoke na_game_tool FH.GJD out.avi -an it will create AVI without an audio track and it will play fine (or decode as image sequence and around frame 1200 you’ll see it’s fine). I ranted about it in https://codecs.multimedia.cx/2024/12/some-words-about-alien-isolation-cda2/ some time ago.

    P.S. What you call video/surfaceTensionGameVideo looks suspiciously like Compro Games VID format (that I called Soul Hunt VID after the first game I’ve seen it in) that even na_game_tool 0.3.0 should be able to decode (saner part).

    P.P.S. I agree with Paul, librempeg supports some formats like obscure lossless audio compressors or console formats that are hardly supported by anything else, so it’s worth looking at.

  4. Paul says:

    Oh, I must stop be lazy and finally update AVI demuxer to resolve that bug.

  5. Kostya says:

    And I need to support non-interleaved AVIs properly. Eventually.

  6. Paul says:

    About non-interleaved AVI bug, the AVI files created by na_game_tool does not produce idx1 chunk thus there is no way to filter out or ignore palette packets, or I’m missing something here?

  7. Kostya says:

    They produce idx1 chunks just fine (and OpenDML index chunks as well), it’s just libavformat does not care about chunk flags (which explicitly say when the chunk should not contribute to the total track duration) when reading index.

  8. Paul says:

    i can not find idx1 chunk when converting above linked file with na_game_tool.
    What is signalling in newer OpenDML index chunks for AVIIF_NO_TIME?

  9. Sembiance says:

    @Kostya

    Thanks for the info about libavformat being at fault here.

    As for video/surfaceTensionGameVideo, awesome! You are correct, the samples I have do convert ok as soulhunt except SCREEN22.VID is a bit messed up and NZLOGO.VID doesn’t seem to convert.

    @Paul I’ll look into getting librempeg support added to dexvert. I’m always on the lookout for other conversion programs so discmaster can convert more file formats 🙂

  10. Kostya says:

    Good catch, OpenDML indices do not have such flags, only size/offset fields (and it was not intended for paletted images). And yes, I’m lazy and produce either old-style index or OpenDML one depending on file size (but not both).

    Still no excuse for the demuxer to not recognize ‘XXpc’ chunks as palette change.

    P.S. Even funnier situation with https://discmaster.textfiles.com/view/16124/PCF84.ISO/Critical/shoplift/shoplift.exe/Shoplift.avi – it can’t be demuxed properly at all (with libavformat of course). If you look into the file with hex viewer you’ll see frames data always starting with “30 01 01 00” byte sequence, if you extract them with “-f image2 -c:v copy” you’ll get random bits of PCM data instead. Old MPlayer demuxer works fine, mine as well.

  11. Kostya says:

    @Sembiance

    It’s probably one of those weird newer files with quantisation matrix being stored in quants.ini in text from (so it was too much hassle to support it).

  12. Sembiance says:

    I’m working on adding librempeg support to dexvert and I’ve got 3 questions:

    #1: Is there any documentation as to which formats librempeg supports that ffmpeg doesn’t? If no docs exist for this, I assume I would just do run it with -formats and compare that list to what ffmpeg produces?

    #2: Are there particular configure flags I should enable to ensure I compile in support for the new formats?

    #3: Are there any formats that it supports much better than ffmpeg in which case I should use librempeg instead?

  13. Sembiance says:

    Looks like with ‘mostly’ default configure options, the new ‘formats’ supported in librempeg are:
    aif Asobo Studio Games AIF
    apv APV raw bitstream
    astb Capcom ASTB (Audio Stream)
    baf BAF (Bizarre Creations Bank File)
    bcwav BCWAV (NintendoWare CWAV)
    bfwav BFWAV (NintendoWare FWAV)
    bnsf BNSF (Bandai Namco Sound Format)
    dat DAT (Digital Audio Tape)
    ealayer3 Electronic Arts Layer 3
    g728 raw G.728
    halpst HAL Labs
    hvqm2 HVQM2
    hvqm4 HVQM4
    idsp IDSP (Inevitable Entertainment)
    ilda ILDA Image Data Transfer Format
    macbinary QuickTime / MacBinary
    mcraw MotionCam RAW
    mipu MIPU Video
    msnd PS2 MSND
    pda PlayDate Audio
    rfb RFB
    smp Sample Vision Audio
    sndb Capcom SNDB (Sound Bank)
    tac tri-Ace PS2
    ueba Unreal Engine Bink Audio
    utk Maxis UTK
    xpcm Circus XPCM

    With new codecs being:
    apv Advanced Professional Video
    braw Blackmagic RAW
    dnxuc DNxUncompressed / SMPTE RDD 50
    hvqm2 HVQM2 Video
    hvqm4 HVQM4 Video
    ilda ILDA Image Data Transfer Format
    jpegxl_anim JPEG XL animated
    mcraw MotionCam RAW
    proresraw ProRes RAW
    rfb RFB (Remote FrameBuffer)
    rfbw RFBW Video
    rv60 RealVideo 6.0
    svg Scalable Vector Graphics
    vicar VICAR (Video Image Communication And Retrieval)
    adpcm_circus ADPCM Circus
    adpcm_ima_escape ADPCM IMA Acorn Escape
    adpcm_ima_hvqm2 ADPCM IMA HVQM2
    adpcm_ima_hvqm4 ADPCM IMA HVQM4
    adpcm_ima_magix ADPCM IMA Magix
    adpcm_ima_pda ADPCM IMA PlayDate
    adpcm_ima_xbox ADPCM IMA Xbox
    adpcm_n64 ADPCM Silicon Graphics N64
    adpcm_psxc ADPCM Playstation C
    adpcm_pt ADPCM Wwise Platinum
    ahx CRI AHX
    dwvw DWVW (Delta Word Variable Width)
    ealayer3 Electronic Arts Layer3 (decoders: ealayer3 ealayer3float)
    ealayer3multi Electronic Arts Layer3 multichannel (decoders: ealayer3multi ealayer3multifloat)
    g719 G.719
    g728 G.728
    lhcelp L&H CELP
    pca PCA (Perfect Clarity Audio)
    pcm_dat PCM DAT (NonLinear 12bit PCM)
    sonarc Sonarc (Speech Compression)
    tac tri-Ace audio
    utk Electronic Arts MicroTalk
    utk_r3 Electronic Arts MicroTalk Revision 3
    wwvorbis Wwise Vorbis
    ivtv_vbi ivtv VBI captions

    Not sure if any are missing due to not explicitly opting in with an -enable-option to configure.

  14. Paul says:

    All new codecs decoders and formats are covered with default configure option. So above list is almost complete, just dnxuc (this is just parser – no decoder exist even in ffmpeg – need to check what happened there), svg, apv, rv60 and ivtv_vbi are already in latest ffmpeg, and ac-4 is not listed as librempeg one.

    #1 yes.
    #2 no
    #3 some EXR images are better supported, and MJPEG is less buggy, probably there is more but I cant dig right now…

Leave a Reply