3DS:BAX/makebax: Difference between revisions

From Hacks Guide Wiki
(Create page explaining how to create .BAX animations using makebax)
 
m (→‎Section I - Installing ffmpeg and makebax: wrap tabber lists in <span> to fix rendering)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Page WIP|notes=
{{Page WIP|notes=
* Needs note about what Mac/Linux users should do
* Needs instructions for macOS and Linux users
** Note that since the makebax <code>release.zip</code> only provides Windows binaries, these OSes will likely need some form of Wine in their instructions.
* Might need troubleshooting info
* Might need troubleshooting info
* This page might make more sense as 3DS:BAX/makebax since it will only be about that
* Instructions on creating animations need to be finished
}}
}}
'''makebax''' is a command-line utility for converting <code>.IVF</code> video files into <code>.BAX</code> animations to be used with [[3DS:BAX|BAX]] and played on a Nintendo 3DS.
'''makebax''' is a command-line utility for converting <code>.IVF</code> video files into <code>.BAX</code> animations to be used with [[3DS:BAX|BAX]] and played on a Nintendo 3DS.
Line 10: Line 9:


=== What You Need ===
=== What You Need ===
* The latest release of BAX from its {{GitLab|Wolfvak/BAX/-/releases|GitLab page}} (The <code>release.zip</code> file)
* The latest release of {{GitLab|Wolfvak/BAX/-/releases|makebax}} (files vary depending on your OS)
* The latest release of [https://ffmpeg.org/download.html ffmpeg] installed on your computer
* The latest release of [https://ffmpeg.org/download.html ffmpeg] installed on your computer


=== Instructions ===
=== Instructions ===
# Open a terminal on your computer
====Section I - Installing ffmpeg and makebax====
# Use ffmpeg to transcode your desired video into IVF format
For FFmpeg:
#* For example, if your video is a file named <code>input.mp4</code>, the command would be something like <code>ffmpeg -i "/path/to/input.mp4" -f ivf "/path/to/output.ivf"</code>
<tabber>
|-|Windows=
 
<span>
# On the ffmpeg website, click on the Windows icon and then the <code>Windows builds by BtbN</code> option
# On that page, download the file whose name ends with <code>win64-gpl.zip</code>
# Once it's downloaded, extract the file to a folder
# Move the folder to any place of your choosing, but make sure to choose a place where you won't move it again
#*Once you have the folder in the correct place, enter the <code>bin</code> folder inside it. Then, click on the address bar and copy the file path that appears in its place
# Open the Windows search bar and find the Control Panel
# In the Control Panel, click on the search bar and type <code>environment</code>
# Choose the option that says "Edit environment variables for your account"
# In the window that opens, find the option named <code>Path</code>, click on it, and click '''Edit...'''
# In the window that opens, click '''New''', paste the file path you copied earlier, then press Enter and click '''OK'''
 
</span>
|-|macOS=
 
WIP
|-|Linux=
 
In a terminal window, use your system's package manager (such as <code>apt</code>, <code>dnf</code> or <code>pacman</code>) while sudo or root to install ffmpeg.
</tabber>
----
For makebax:
<tabber>
|-|Windows=
 
<span>
# Download <code>release.zip</code> from the makebax releases page.
# Extract the <code>release.zip</code> to a folder and move it to any location of your choice
</span>
|-|macOS=
 
WIP
|-|Linux=
 
WIP
WIP
</tabber>


====Section II - Converting the video====
# Copy the video you wish to convert into the makebax folder
# Inside that folder, hold SHIFT and right-click anywhere in the empty space - in the resulting menu, click the option that opens a terminal, Command Prompt, or PowerShell window
# Use ffmpeg to transcode your desired video into IVF format
#* For example, if your video is a file named <code>input.mp4</code>, the command would be <code>ffmpeg -i "input.mp4" -f ivf "converted.ivf"</code>
#* The video must have a resolution of 400x240, 320x240, or 720x240. If it doesn't meet the requirements, instead do <code>ffmpeg -i "input.mp4" -f ivf -vf scale=<WIDTH>:240,fps=<FRAMERATE> "converted.ivf"</code> - <code><WIDTH></code> must be 400, 320 or 720 and <code><FRAMERATE></code> must be a number between 1 and 60.
# Use makebax to convert your <code>.IVF</code> file to a <code>.BAX</code> file
#* When running the command, put the full filename of one of the makebax <code>.EXE</code>s (e.g. <code>makebax-win64.exe</code>) before the command.
#* If you named your converted video <code>converted.ivf</code>, the command would be <code><makebax EXE filename> "converted.ivf" "output.bax"</code>
# Copy <code>output.bax</code> to <code>sdmc:/bax/</code> on your console's SD card
{{success|You have created a usable .BAX file. It will be played (chosen at random, if you already had a .BAX file before this) when your 3DS next boots.}}
== Command Line Usage ==
== Command Line Usage ==
<code>makebax "input.ivf" "output.bax" [-s n] [-c l] [-b back_color] [-a "Author"] [-i "Info"]</code>
{{info|Put the filename of either makebax <code>.exe</code> before the command, and make sure you're running this from inside the makebax release folder.}}
<code><makebax EXE filename> "/path/to/input.ivf" "/path/to/output.bax" [-s n] [-c l] [-b back_color] [-a "Author"] [-i "Info"]</code>


Parameters enclosed in <code>[ ]</code> are optional.
Parameters enclosed in <code>[ ]</code> are optional.

Latest revision as of 09:49, 26 August 2023

makebax is a command-line utility for converting .IVF video files into .BAX animations to be used with BAX and played on a Nintendo 3DS.

Creating .BAX Animations

What You Need

  • The latest release of makebax (files vary depending on your OS)
  • The latest release of ffmpeg installed on your computer

Instructions

Section I - Installing ffmpeg and makebax

For FFmpeg:

  1. On the ffmpeg website, click on the Windows icon and then the Windows builds by BtbN option
  2. On that page, download the file whose name ends with win64-gpl.zip
  3. Once it's downloaded, extract the file to a folder
  4. Move the folder to any place of your choosing, but make sure to choose a place where you won't move it again
    • Once you have the folder in the correct place, enter the bin folder inside it. Then, click on the address bar and copy the file path that appears in its place
  5. Open the Windows search bar and find the Control Panel
  6. In the Control Panel, click on the search bar and type environment
  7. Choose the option that says "Edit environment variables for your account"
  8. In the window that opens, find the option named Path, click on it, and click Edit...
  9. In the window that opens, click New, paste the file path you copied earlier, then press Enter and click OK

WIP

In a terminal window, use your system's package manager (such as apt, dnf or pacman) while sudo or root to install ffmpeg.


For makebax:

  1. Download release.zip from the makebax releases page.
  2. Extract the release.zip to a folder and move it to any location of your choice

WIP

WIP

Section II - Converting the video

  1. Copy the video you wish to convert into the makebax folder
  2. Inside that folder, hold SHIFT and right-click anywhere in the empty space - in the resulting menu, click the option that opens a terminal, Command Prompt, or PowerShell window
  3. Use ffmpeg to transcode your desired video into IVF format
    • For example, if your video is a file named input.mp4, the command would be ffmpeg -i "input.mp4" -f ivf "converted.ivf"
    • The video must have a resolution of 400x240, 320x240, or 720x240. If it doesn't meet the requirements, instead do ffmpeg -i "input.mp4" -f ivf -vf scale=<WIDTH>:240,fps=<FRAMERATE> "converted.ivf" - <WIDTH> must be 400, 320 or 720 and <FRAMERATE> must be a number between 1 and 60.
  4. Use makebax to convert your .IVF file to a .BAX file
    • When running the command, put the full filename of one of the makebax .EXEs (e.g. makebax-win64.exe) before the command.
    • If you named your converted video converted.ivf, the command would be <makebax EXE filename> "converted.ivf" "output.bax"
  5. Copy output.bax to sdmc:/bax/ on your console's SD card
OOjs UI icon information-constructive.svg You have created a usable .BAX file. It will be played (chosen at random, if you already had a .BAX file before this) when your 3DS next boots.

Command Line Usage

OOjs UI icon information-progressive.svg Put the filename of either makebax .exe before the command, and make sure you're running this from inside the makebax release folder.

<makebax EXE filename> "/path/to/input.ivf" "/path/to/output.bax" [-s n] [-c l] [-b back_color] [-a "Author"] [-i "Info"]

Parameters enclosed in [ ] are optional.

  • input.ivf is the input IVF file path, the size must have a resolution of either 400x240 (top screen only), 320x240 (bottom screen only) or 720x240 (both screens side-by-side). Input must be an IVF container with a VP8/VP9 stream.
  • output.bax is the path to the BAX file that will be created.
  • s sets the block size. n is the number of frames that are processed per iteration. The higher the number, the more memory is used on runtime (and the less often disk accesses are required). Defaults to 48.
  • c sets the compression level. Should be between 1 (lowest) and 16 (highest). Defaults to 6.
  • b sets the background color. bg_color should be the 16-bit integer representation of an RGB565 color. Defaults to zero (black). Refer to this site for more information.
  • a sets the Author string. It doesn't affect the player at all, but it's nice to include some metadata. Maximum length is 32 ASCII characters (or as much UTF-8 fits in there).
  • i is the same as above but for Information. Maximum length is 192 ASCII characters.

Notes

  • IVF is a simple container for VP8/VP9 streams, unable to contain more than one stream. It was chosen as the input format due to it being both simple and straightforward to work with.
  • Although it should be compatible with big endian platforms (PowerPC, Microblaze, etc) this has not been properly tested yet. Please report any issues regarding compilation/usage on big endian platforms.
  • While having libav* support would be ideal, it's less than fit due to it's programming complexity (easy to make mistakes with) and labyrinth of dependencies (requires X11 libs, so it's unusable from servers, f.e.).
  • For best performance, the block size should be an integer multiple of the number of available hardware threads (logical processors). This is why the default block size is 48: it's a multiple of the most common PO2 and MO6 multithread setups.
  • BAX files should not surpass the 32MiB mark. makebax doesn't enforce this limit, but BAX does.