GithubHelp home page GithubHelp logo

tamk1s / thwimp Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 40.82 MB

A dual-GUI/CLI utility which views, rips, and helps create THP video files for Mario Kart Wii. Can be modified for usage with other games

Home Page: http://www.eaglesoftltd.com/retro/Nintendo-Wii/thwimp

License: GNU General Public License v3.0

Visual Basic .NET 100.00%

thwimp's People

Contributors

logoffon avatar tamk1s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nnn1590 logoffon

thwimp's Issues

Improve GUI, documentation

Rewrite documentation and GUI layout, data shown for conciseness, better clarity on operation. Make operation of application easier to follow/understand

  • Readme manual
  • Webpage
  • MKWiiki (update links/article)

THP Viewer enhancements

If THP Viewer does not already do so, allow ffplay to use the Crop Settings to playback a particular area/time chunk of the THP

Error parsing string into Single

Whenever I try to launch it, I got the "Data file parsing/I/O error!
Error parsing string into Single" alert popping up...

Therefore, even if I set everytrhing properly, I can't use the program at all, the THP tab doesn't work (only displays 0 in all areas, except description)

Here's the log:

MsgBox: title: Data file parsing/ I/O error! msg: Error parsing string into Single icon: DefaultButton1, OkOnly, Critical

THP Not Being Produced Properly

For some reason, after the program produced the first THP on my PC, every time I tried making a THP, (I keep trying indiv_team.thp btw) the file size is always 80 bytes, and it would crash VLC every time I tried to play it.

I have tried setting Digs to 1 at some point, and have changed the JPG Quality several times, yet for some reason, it still produces a broken file.

If I could get help, that would be great.
Thanks.

THP Rip/Decoder enhancements

xModify THP Decoder group box with an array of radio buttons similar to THP Encoder, showing the physical array of subvideo frames.
xAllow user to click a radio button, which will adjust the crop area for cell.
xAdd a NUD to allow user to select a multiplicity for a cell, and fields for start/end frame ranges (time)
xAllow Rip button to rip a subvideo from start to end frame range

All of this will allow users to rip subvideos (both cells and time multiplicity cells)

Lingering File I/O from StreamReaders/Writers

Various functions that open StreamReaders/Writers and have Try/Catch blocks do not all close lingering ones in the Catch block (some close after the Catch block). If program execution stops due to an error message box that appears within the Catch block, and if the user tries accessing the file or quits application, the file may be locked for write access. (Requiring something like Unlocker utility to fix.)

Fix this issue by ensuring closing of all StreamReaders/Writers within the affected Catch blocks. Additionally, for all StreamWriters that fail to fully write a file, delete the corrupted file.

THP encoding optimization

When a THP video file requires dummy padding frame files for encoding, the FFMPEG conversion from BMP -> MP4 dummy videos is buggy, and usually creates videos sized larger than the Trunc_Frame limit. This in turn causes the final mp4 video file to be larger than the (trunc_frame * num_of_mults) limit, causing wasted time and temporary HDD space when ripping BMP/JPG frames for THP encoding. Thwimp lazily "fixes" problem by discarding extra frames.

Fix it by either fixing the BMP -> MP4 conversion to created the correct length video files, or just require the user to created pre-defined dummy video instead.

Error finding, copying and/or hacking Irfranview INI file! / want to double check the settings.

Been trying to get a thp file for a rom hack, but got an error after setting up my settings.

Admittedly I was still confused on the settings, so I'll post the settings here.

640,352,2,1,2,5,10,336,250,24396,24396,0,0,29.97,0,1,1,32000; The video I want to encode is 640x352, no control needed. The game is for GameCube, so no need for any sub divs either, I just want to encode the video itself. and the fps is in 29.97.

Merge chkRip_Type functionality into Crop Settings

Now that Crop Settings has been refactored with the radio button system:
*Merge "Rip to MP4+Dum" functionality into the new system
*If video has dummy frames and "Dum" radio button is selected, enable a new checkbox. Should read "Don't rip frames" if unchecked, "Rip frames" if checked.
*Only enable chkRip_Type if video has audio.

JPG Quality bug

Setting the JPG Quality too low (around <75%) may also cause THPConv to reject the JPG files created by Thwimp for conversion.

Bug occurred with such JPG Quality on battle_cup_retro.thp conversion in Hover Pack project in MKWii_Tracks repo, needs more digging into/further verifications

Include co-utilities within application

Make application include or download from web (like wget) most of the co-utilities in the application

Remove need to point to directories/executable of co-utilities once feature is integrated

Thwimp CLI

  • Research into how to make a Visual Basic application have both a GUI and CLI in one app (if possible).
  • Running application from cmdline should accept some input variables, and dump values into the app's vars appropriately for usage, then remotely call onClick events on the buttons for triggering stuff.
  • Messageboxes should be suppressed,and at end-of-button clicks, quit application with thrown exitcodes. Exitcode = bit (0=pass, 1= failure).
  • If no/wrong param structure, run CLI Help action
    - Must fix issues #5 , #6 , #7 , #8, #10 first!

AppForm

CLI usage:

Main actions:

Rip:

thwimp.exe rip /s options.txt /L /tNNN [[/p A1N_preset] || [/c csv_cropvals]] /n snd_bit /o folder

View:

thwimp.exe view /s options.txt /L /tNNN [[/p A1N_preset] || [/c csv_cropvals]] /n snd_bit

Encode:

thwimp.exe encode /s options.txt /L /tNNN /f trunc_frame_val [/d digs] /q jpgqual /i input_folder [/o output_folder]

Help:

thwimp.exe help

Param values:

- options.txt
-- INI file with Options paths (CRLF delimited)

  1. THP Root Path (THPRoot)
  2. FFMPEG Exe Path (FFMpeg)
  3. FFPlay Working Directory (FFplay_wdir)
  4. Irfanview Exe (irfanview)
  5. THPConv exe (thpconv)
  6. Path to folder of data files to use (optional, 0 to use defaults, dataDir)
  7. audio
  8. audio_bgm
  9. log_msgBox
  10. log_Full

-/L
-- Pipe cmdprompt commands rip by thwimp into a log file (log.txt) at the CD

- /tNNN
-- ID of THP files to use from datafiles
-- ID From THP file combo box
-- 0-based, 3-digit ID

- /p A1N_preset
-- Valid preset string ID to use from Crop Setting section in THP Viewer/Ripper section
-- Valid A1N values
--- A1_N to A6_N, B1_N to B6_N
---- MS Excel A1N notation for cells, _N = multiplicity ID for each cell
--- Special values
---- All = all special preset
---- Dum = dummy special preset

-/c csv_cropvals
-- Manual crop settings values (csv, no spaces)

  1. xpos
  2. ypos
  3. width
  4. height
  5. time_start
  6. time_end

-n snd_bit
-- Use DirectSound? (0=false, anything else = true)

-/o Output folder
-- output folder to place ripped/encoded files
-- May be optional based on the Thwimp CLI action
--- Required for rip
--- Optional for Encode (unused = use /i input folder)

-/f trunc_frame_val
-- Number of frames to truncate to (per multiplicity)

-/d digs
-- Number of digits for JPG filenaming
-- Optional
-- If unused, will use digsOf(trunc_frame * multplicity)

-/q jpgqual
-- JPG Quality as percent (no % sign)

-/i input_folder
-- Input folder for THP Encoding input files

Error parsing string into single

Well, the error is as the title says...

This problem occurs when I try to encode a thp file either through the GUI or the CLI.

What I've done to minimize the chance of this error:
-Copied the files in directories without spaces(directly on the root of the drive)
-I've moved all the needed files in the Thwimp directory (only FFmpeg, ffplay, and ffprobe on a subdirectory ff)

but after these actions, I still get this error.

Here's some basic info

OS: Win 10 with set Bulgarian UI language

Settings file:
[Thwimp.ini v1.2.0.0]
THPRoot = D:\wbfs\DATA\files\thp
FFMpegDir = C:\THWIMP\ff
FFplay_wdir = C:\THWIMP\ff
irfanview = C:\THWIMP\i_view32.exe
thpconv = C:\THWIMP\THPConv.exe
dataDir = 0
audio = 1
audio_bgm = 1
log_msgBox = 1
log_Full = 1

The file path selected for encoding is C:\single_top and all files are named like this (single_top_A1_1.mp4) and are the same resolutions/framerates as their original subvideos

There's nothing in the logfile even with the full log turned on, only this is saved:
MsgBox:
title: Error during Encoding!
msg: Error parsing string into Single
icon: DefaultButton1, OkOnly, Critical
Line number: 4762

Thanks in advance.

Questions about Thwimp and Encoding THP with a new subvideo causes ridiculously high framerates??

Hello there!

I just started using Thwimp in order to attempt to mod Mario Kart Wii.
I got all the files I needed for Thwimp, and set up the configuration correctly.

I first decided to try and rip a THP into MP4s and then re-encode it into a THP to know if it works correctly.
So I ripped all battle\battle_select.thp subvideos individually, and renamed them from:

  1. "battle_select_A1.mp4" to "battle_select_A1_1.mp4"
  2. "battle_select_A2.mp4" to "battle_select_A2_1.mp4"

Notice: It seems like I have to rip each subvideo manually in order for the re-encode to work afterwards.
Ripping a THP into a single MP4 by selecting "All" in the Special Presets instead of ripping each subvideo individually
seems to make re-encoding not possible. If I am wrong in this assessment please let me know!
It would be nice to not have to rip each one individually for re-encoding.
Perhaps I can do it in batch through the CLI mode, but I may not want to have to do that.

Anyway I did this and it seemed to work perfectly fine.
It ripped each subvideo fine, and I was able to re-encode into a new THP!

Problem is when I tried editing one of the subvideos.

I'm not sure which editing software you use to create/edit subvideos yourself but this is what I did...

  1. I put the original subvideo in VEGAS Pro 17.
  2. I created a new track with a test video, and resized it to fit the screen via Track Motion.
  3. I then tried rendering to 496x120 59.94fps. Vegas only let me render at a minimum of 496x144.
  4. I then put the new rendered video into Handbrake.
  5. I changed the dimensions from 496x144 to 496x120, and removed any automatic cropping.
  6. I removed the empty audio track in handbrake so there wouldn't be any audio track.
  7. I set the framerate to a constant 59.94 fps
  8. I set the average bitrate to 451 kbps.
  9. I then exported it to a new mp4.

Once done, I renamed this newly crafted mp4 to "battle_select_A2_1.mp4" and replaced the original subvideo.
I then finally tried encoding a THP with this new subvideo. (I left all the options for encoding set to default.)
FFmpeg opened and...

https://ibb.co/vs3yc3C

That can't be good...

This goes on for a while and even gets into the millions of frames so I pressed "q" to cancel it.

This is the properties for the first unedited subvideo "battle_select_A1_1.mp4":
https://ibb.co/JsgqWJ2

This is the properties for the second edited subvideo "battle_select_A2_1.mp4":
https://ibb.co/0cD1kdP

I tried to keep them as similar as possible. I'm not sure what the issue is.
Here's the edited MP4: https://www.file.io/download/xYDvwkJhNmej

One more question... is "multiplicity" kind of like... the number of subvideos... inside subvideos?
I just started using this tool so it's a lot to take in...

I may initiate a pull request to fix some of the issues I have with the program myself if you're busy.

Let me know if you can help me out with my issue or answering my questions! ❤️

P.S. Can you please keep the deleting of temporary files to a minimum? Make it optional to delete them via checkbox?
My first time trying out the software I ran the encode on my desktop and there are a bunch of files on my desktop.
It definitely deleted some of my JPGs and possibly MP4s I had on my desktop.
Luckily I don't think any of them are too important to me but still...
Maybe add a warning to the user guide or something...

Irfanview path bug

If the Irfanview path contains spaces in it, THPConv conversion will fail. Probably due to forgetting to enclose some cmd prompt commands in Thwimp with "double quotes".

Bug tested and verified on battle_cup_retro.thp conversion in Hover Pack in MKWii_Tracks repo

Mission Mode THP support

Implement support for Mission Mode THPs

  • Figure out video specs for the deleted videos (screenshots?)
  • Implemented specs data into MKWii Default data fileset
  • Add support in INI files/code handlers for unknown frame size counts to support them
  • Test changes in a My Stuff/DVD ISO mod

Improper FPS for encoded THPs

The command ran for encoding the THP with THPConv does not have its -r framerate param; set this so that encoded THP is set to proper FPS value

Progress bars

Add progress bars to THP Encoding

2 bars: top/bottom.

Top shows total progress (by encoding steps), bottom shows progress for this step. Refer to step commentary in the THP Encode main subroutine

KeepInRange parsing bugs

Within the THP Viewer/Ripper section, if a MaskedTextBox is focused on, cleared to empty (a bunch of underscores "_") , and the user focuses elsewhere, various
"Error Parsing String into <T>"
errors will throw.

These are caused by overzealous error trapping/custom TryParse func calls in KeepInRange function, and validating stuff onChange. Full error cause needs found and fixed. Similar errors may exist for other validations in the THP tab (THP Encoder section)

Failed to find "[Others]" marker in i_view32.ini file within Irfanview exe folder

the i_view32.ini in the Irfanview install directory does not have the [Others] section and the %APPDATA%\IrfanView directory is empty. i initially installed the x64 version of Irfanview, but then uninstalled it and installed the x86 version, if this has any effect.

i had this error on both v1.2a and b, and i can now test on the new release

edit: exact same errors on the new release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.