THPConv: Difference between revisions

From Super Mario Galaxy wiki
Jump to navigation Jump to search
m (minor format edits)
(edited page styles)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Tools]]{{SDK Reference}}
[[Category:Tools]]{{SDK Reference}}
<hr style="background-color:transparent;">


'''THPConv.exe''' is a prebuilt Win32 console application that Nintendo provides in the Wii and GCN SDKs. It is used to convert sequential JPEG images into a THP video format (with an option to include audio into it from a WAV audio file) and to include/replace audio of an existent THP video. It needs the '''dsptool.dll''' file to work.
'''THPConv.exe''' is a prebuilt Win32 console application that Nintendo provides in the Wii and GCN SDKs. It is used to convert sequential JPEG images into a THP video format (with an option to include audio into it from a WAV audio file) and to include/replace audio of an existent THP video. It needs the '''dsptool.dll''' file to work.
Line 11: Line 9:
So you may use either '''THPConv.exe''' or '''THPConvD.exe''' to make/edit THP files (be sure to have the respective '''dsptoolD.dll''' for '''THPConvD.exe''').
So you may use either '''THPConv.exe''' or '''THPConvD.exe''' to make/edit THP files (be sure to have the respective '''dsptoolD.dll''' for '''THPConvD.exe''').


Linux users can use [https://www.winehq.org/ Wine] to run both program.
Linux users can use [https://www.winehq.org/ Wine] to run both programs.


<br>
== Converting Sequential JPEG files to THP Movie Data ==


<h1><b>Converting Sequential JPEG files to THP Movie Data</b></h1>
=== Description ===


<hr style="background-color:transparent;">
The following describes how to use the THPConv tool to convert '''Sequential JPEG files''' to '''THP movie data''':


<h2><b>Description</b></h2>
<code>THPConv.exe -j &lt;*.jpg&gt; -d &lt;outputfile&gt; [-&lt;option&gt; &lt;argument&gt;]</code>


<hr style="background-color:transparent;">
Options description:
 
The following describes how to use the <code>THPConv</code> tool to convert '''Sequential JPEG files''' to '''THP movie data''':
 
<pre>THPConv.exe -j &lt;*.jpg&gt; -d &lt;outputfile&gt; [-&lt;option&gt; &lt;argument&gt;]</pre>
 
Options Description:
 
<hr style="background-color:transparent;">


<table border="1" cellpadding="3" cellspacing="0">
<table border="1" cellpadding="3" cellspacing="0">
Line 40: Line 30:
<th align="center" width="50" bgcolor="#FFFFCC">-j</th>
<th align="center" width="50" bgcolor="#FFFFCC">-j</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;*.jpg&gt;</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;*.jpg&gt;</td>
<td>Specifies the input files (sequential JPEG files). Wildcard characters ("*") can be used. This argument must <strong>always be specified</strong>.</td>
<td>Specifies the input files (sequential JPEG files). Wildcard characters ("*") can be used. This argument must always be specified.</td>
     </tr>
     </tr>


Line 46: Line 36:
<th align="center" width="50" bgcolor="#FFFFCC">-d</th>
<th align="center" width="50" bgcolor="#FFFFCC">-d</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;outputfile&gt;</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;outputfile&gt;</td>
<td>Specifies the output file (THP file). This argument must <strong>always be specified</strong>.</td>
<td>Specifies the output file (THP file). This argument must always be specified.</td>
     </tr>
     </tr>
 
   
</table>
<br>
<table border="1" cellpadding="3" cellspacing="0">
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-s</th>
<th align="center" width="50" bgcolor="#FFFFCC">-s</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;wavefile&gt;<br>&lt;wavefile&gt;<br>......</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;wavefile&gt;&lt;wavefile&gt;......</td>
<td>Specifies the audio file (WAV file) that will be converted to THP audio data. When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified.</td>
<td>Specifies the audio file (WAV file) that will be converted to THP audio data. When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified.</td>
     </tr>
     </tr>
Line 67: Line 54:
<th align="center" width="50" bgcolor="#FFFFCC">-o</th>
<th align="center" width="50" bgcolor="#FFFFCC">-o</th>
       <td align="center" width="100" bgcolor="#E6E6FA">-</td>
       <td align="center" width="100" bgcolor="#E6E6FA">-</td>
<td>THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the <code>THPConv</code> tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.</td>
<td>THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the THPConv tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.</td>
     </tr>
     </tr>


Line 73: Line 60:
<th align="center" width="50" bgcolor="#FFFFCC">-non</th>
<th align="center" width="50" bgcolor="#FFFFCC">-non</th>
       <td align="center" width="100" bgcolor="#E6E6FA" rowspan="3">-</td>
       <td align="center" width="100" bgcolor="#E6E6FA" rowspan="3">-</td>
<td rowspan="3">Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify <b>-odd</b>. When interlace starts from an even numbered field, specify <b>-even</b>. If this argument is not specified, the THP video data format is automatically set to non-interlaced (<b>-non</b>).</td>
<td rowspan="3">Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify -odd. When interlace starts from an even numbered field, specify -even. If this argument is not specified, the THP video data format is automatically set to non-interlaced (-non).</td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 95: Line 82:
</table>
</table>


<br>
=== Example ===


<h2><b>Example</b></h2>
<code>THPConv.exe -j test*.jpg -d output.thp</code>


<hr style="background-color:transparent;">
When this example is executed from a command line, the sequential JPEG files in the current directory (test001.jpg, test002.jpg, test003.jpg, etc.) are converted to THP video data and collected into a single THP movie data file (output.thp). No WAV audio is specified so the THP video will be just video without audio.


<pre>THPConv.exe -j test*.jpg -d output.thp</pre>
{{ note |
<p>When this example is executed from a command line, the sequential JPEG files in the current directory (test001.jpg, test002.jpg, test003.jpg, etc.) are converted to THP video data and collected into a single THP movie data file (output.thp). No WAV audio is specified so the THP video will be just video without audio.</p>
* When converting sequential JPEG files to THP movie data, the names of the specified input files must have the extension ".jpg" or ".jpeg".
* Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.
}}


<br>
== Changing THP Audio Data in THP Movie Data ==


<h2><b>Notes</b></h2>
Note that some of the commands options above are the same here (being those '''-s''', '''-d''', '''-r''', '''-o''', '''-non''', '''-even''', '''-odd''', '''-v''', '''-h''').


<hr style="background-color:transparent;">
=== Description ===


<p><b>NOTE 1:</b> When converting sequential JPEG files to THP movie data, the names of the specified input files must have the extension ".jpg" or ".jpeg".</p>
Below are the instructions for using the THPConv tool to change the THP audio data in '''THP Movie Data'''.
<p><b>NOTE 2:</b> Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.</p>


<br>
<code>THPConv.exe -c &lt;inputfile&gt; -s &lt;wavefile&gt; &lt;wavefile&gt;... -d &lt;outputfile&gt; [-&lt;option&gt; &lt;argument&gt;]</code>
 
<h1><b>Changing THP Audio Data in THP Movie Data</b></h1>
 
<hr style="background-color:transparent;">
 
Note that some of the commands options above are the same here. (being those '''-s''', '''-d''', '''-r''', '''-o''', '''-non''', '''-even''', '''-odd''', '''-v''', '''-h''')
 
<br>
 
<h2><b>Description</b></h2>
 
<hr style="background-color:transparent;">
 
<p>Below are the instructions for using the <code>THPConv</code> tool to change the THP audio data in '''THP Movie Data'''.</p>
 
<pre>THPConv.exe -c &lt;inputfile&gt; -s &lt;wavefile&gt; &lt;wavefile&gt;... -d &lt;outputfile&gt; [-&lt;option&gt; &lt;argument&gt;]</pre>


Options Description:
Options Description:
<hr style="background-color:transparent;">


<table border="1" cellpadding="3" cellspacing="0">
<table border="1" cellpadding="3" cellspacing="0">
Line 144: Line 114:
<th align="center" width="50" bgcolor="#FFFFCC">-c</th>
<th align="center" width="50" bgcolor="#FFFFCC">-c</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;inputfile&gt;</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;inputfile&gt;</td>
<td>Specifies the input file (THP file). This argument must <strong>always be specified</strong>.</td>
<td>Specifies the input file (THP file). This argument must always be specified.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-s</th>
<th align="center" width="50" bgcolor="#FFFFCC">-s</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;wavefile&gt;<br>&lt;wavefile&gt;<br>......</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;wavefile&gt;&lt;wavefile&gt;......</td>
<td>Specifies the replacing sound file ('''WAV file'''). <br>When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified. If a THP file format that does not support multitracks is input, the output file will be in a format that supports multitracks.</td>
<td>Specifies the replacing sound file ('''WAV file'''). When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified. If a THP file format that does not support multitracks is input, the output file will be in a format that supports multitracks.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-d</th>
<th align="center" width="50" bgcolor="#FFFFCC">-d</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;outputfile&gt;</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;outputfile&gt;</td>
<td>Specifies the output file (THP file). If this argument is not given, the <code>THPConv</code> tool will <strong>overwrite the input file.</strong></td>
<td>Specifies the output file (THP file). If this argument is not given, the THPConv tool will overwrite the input file.</td>
     </tr>
     </tr>
</table>
<br>
<table border="1" cellpadding="3" cellspacing="0">
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-r</th>
<th align="center" width="50" bgcolor="#FFFFCC">-r</th>
Line 168: Line 131:
<td>Specifies the movie's frame rate. Frame rates from 1.0 to 59.94 can be specified. If nothing is specified, the default value (29.97) is used.</td>
<td>Specifies the movie's frame rate. Frame rates from 1.0 to 59.94 can be specified. If nothing is specified, the default value (29.97) is used.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-o</th>
<th align="center" width="50" bgcolor="#FFFFCC">-o</th>
       <td align="center" width="100" bgcolor="#E6E6FA">-</td>
       <td align="center" width="100" bgcolor="#E6E6FA">-</td>
<td>THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the <code>THPConv</code> tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.</td>
<td>THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the THPConv tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-non</th>
<th align="center" width="50" bgcolor="#FFFFCC">-non</th>
       <td align="center" width="100" bgcolor="#E6E6FA" rowspan="3">-</td>
       <td align="center" width="100" bgcolor="#E6E6FA" rowspan="3">-</td>
<td rowspan="3">Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify <b>-odd</b>. When interlace starts from an even numbered field, specify <b>-even</b>. If this argument is not specified, the THP video data format will be automatically set to non-interlaced (<b>-non</b>).</td>
<td rowspan="3">Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify -odd. When interlace starts from an even numbered field, specify -even. If this argument is not specified, the THP video data format will be automatically set to non-interlaced (-non).</td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 186: Line 147:
<th align="center" width="50" bgcolor="#FFFFCC">-even</th>
<th align="center" width="50" bgcolor="#FFFFCC">-even</th>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-trk</th>
<th align="center" width="50" bgcolor="#FFFFCC">-trk</th>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;track No.&gt;<br>&lt;wavefile&gt;</td>
<td align="center" width="100" bgcolor="#E6E6FA">&lt;track No.&gt;&lt;wavefile&gt;</td>
<td>If you only want to replace a single audio track dataset, use this option instead of <b>-s</b>. The first argument is the audio track number to replace (0-), the second argument is the sound file (WAV file) that will make the replacement. Using this option invalidates the <b>-r</b>, <b>-o</b>, <b>-non</b>, <b>-odd</b>, and <b>-even</b> options. This option can only be used with the THP file formats that support multitracks.</td>
<td>If you only want to replace a single audio track dataset, use this option instead of -s. The first argument is the audio track number to replace (0-), the second argument is the sound file (WAV file) that will make the replacement. Using this option invalidates the -r, -o, -non, -odd, and -even options. This option can only be used with the THP file formats that support multitracks.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-v</th>
<th align="center" width="50" bgcolor="#FFFFCC">-v</th>
Line 198: Line 157:
<td>Turns on Verbose mode.</td>
<td>Turns on Verbose mode.</td>
     </tr>
     </tr>
     <tr>
     <tr>
<th align="center" width="50" bgcolor="#FFFFCC">-h</th>
<th align="center" width="50" bgcolor="#FFFFCC">-h</th>
Line 204: Line 162:
<td>Displays the option list.</td>
<td>Displays the option list.</td>
     </tr>
     </tr>
</table>
</table>


<br>
{{ note |
 
* When the THPConv tool replaces audio data in existing THP movie data, the old THP audio data is deleted. Once the THP audio data is deleted, it cannot be restored. If no output file is specified when the audio data is replaced, the THPConv tool will overwrite the THP movie data. When replacing the audio data, be sure to create a backup file or to specify an output file; this will prevent accidental deletion of your data.
<h2><b>Notes</b></h2>
* If the replacement WAV file has a longer playback time than the THP movie data, the section of the replacement WAV file that is longer than the THP movie data will not be converted. If the playback time of the THP movie data is longer than the wave file, the remaining section will be silent.
 
* If the THP movie data specified as the input data does not contain audio data, this operation will add THP audio data to the specified file.
<hr style="background-color:transparent;">
* If you want the THP movie data to contain more than one audio track dataset, make sure that the channel counts and playback frequencies for all audio track datasets are the same.
 
* Unlike the Nintendo GameCube, audio data on the Wii console is output at a set playback frequency (48,000 Hz or 32,000 Hz).
<p><b>NOTE 1:</b> When the <code>THPConv</code> tool replaces audio data in existing THP movie data, the old THP audio data is deleted. Once the THP audio data is deleted, it cannot be restored. If no output file is specified when the audio data is replaced, the <code>THPConv</code> tool will overwrite the THP movie data. When replacing the audio data, be sure to create a backup file or to specify an output file; this will prevent accidental deletion of your data.</p>
}}
 
<p><b>NOTE 2:</b> If the replacement WAV file has a longer playback time than the THP movie data, the section of the replacement WAV file that is longer than the THP movie data will not be converted. If the playback time of the THP movie data is longer than the wave file, the remaining section will be silent.</p>


<p><b>NOTE 3:</b> If the THP movie data specified as the input data does not contain audio data, this operation will add THP audio data to the specified file.</p>
== Compatible file formats for THPConv ==


<p><b>NOTE 4:</b> If you want the THP movie data to contain more than one audio track dataset, make sure that the channel counts and playback frequencies for all audio track datasets are the same.</p>
=== Sequential JPEG File Format ===


<p><b>NOTE 5:</b> Unlike the Nintendo GameCube, audio data on the Wii console is output at a set playback frequency (48,000 Hz or 32,000 Hz).</p>
==== Description ====


<br>
The THPConv tool can convert a group of sequential JPEG files having sequence numbers at the end of their filenames (indicating the playback order) to THP movie data. When interleaving audio data in sequential JPEG files, you must either specify the WAV files by using the -s option at the time the sequential JPEG files are converted, or add the WAV files after conversion.
The following restrictions apply to groups of sequential JPEG files that can be handled with the THPConv tool:


<h1><b>Compatible file formats for THPConv</b></h1>
* All JPEG files to be collected into a single THP movie dataset must have the same number of pixels in the horizontal and vertical directions.
* The group of sequential JPEG files must have sequence numbers (corresponding to frame numbers) appended to the end of their filenames.
* The number of the JPEG file corresponding to the initial frame of the THP movie data can be any number. However, the numbers of all files thereafter must be sequential.
* Please add leading zeros to the frame numbers appended to the filenames so that they all match the number of digits in the last frame.


<hr style="background-color:transparent;">
The following restrictions apply to each file in a group of sequential JPEG files:


<h2><b>Sequential JPEG File Format</b></h2>
* Only the JPEG baseline DCT format is supported.
* Only sequential encoding is supported.
* Only supports a sample rate of 4:2:0.
* The pixel counts in both the horizontal and vertical directions must be a multiple of 16.
* The maximum pixel count in the horizontal direction is 672 dots. There is no restriction on the pixel count in the vertical direction.


<hr style="background-color:transparent;">
If the sequential JPEG files do not meet these requirements, the THPConv tool will output an error and stop processing.


<h3><b>Description</b></h3>
==== Example ====
<hr>


<hr style="background-color:transparent;">
To create four seconds of THP movie data at 30 FPS from sequential JPEG files, the numbers of the sequential JPEG files (testxxx.jpg) should look like the following:


<p>The <code>THPConv</code> tool can convert a group of sequential JPEG files having sequence numbers at the end of their filenames (indicating the playback order) to THP movie data. When interleaving audio data in sequential JPEG files, you must either specify the WAV files by using the <b>-s</b> option at the time the sequential JPEG files are converted, or add the WAV files after conversion.
<br>
<br>
The following restrictions apply to groups of sequential JPEG files that can be handled with the <code>THPConv</code> tool:</p>
<blockquote>
<table border="0">
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>All JPEG files to be collected into a single THP movie dataset must have the same number of pixels in the horizontal and vertical directions.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th> The group of sequential JPEG files must have sequence numbers (corresponding to frame numbers) appended to the end of their filenames.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th> The number of the JPEG file corresponding to the initial frame of the THP movie data can be any number. However, the numbers of all files thereafter must be sequential.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th> Please add leading zeros to the frame numbers appended to the filenames so that they all match the number of digits in the last frame.</th>   
    </tr>
</table>
</blockquote>
<p>The following restrictions apply to each file in a group of sequential JPEG files:</p>
<blockquote>
<table border="0">
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>Only the JPEG baseline DCT format is supported.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>Only sequential encoding is supported.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>Only supports a sample rate of 4:2:0.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>The pixel counts in both the horizontal and vertical directions must be a multiple of 16.</th>   
    </tr>
    <tr align="left">
      <th width="10" valign="top">-</th>
<th>The maximum pixel count in the horizontal direction is 672 dots. There is no restriction on the pixel count in the vertical direction.</th>   
    </tr>
</table>
</blockquote>
<p>If the sequential JPEG files do not meet these requirements, the <code>THPConv</code> tool will output an error and stop processing.</p>
<br>
<h3><b>Example</b></h3>
<hr>
<hr style="background-color:transparent;">
<p>To create four seconds of THP movie data at 30 FPS from sequential JPEG files, the numbers of the sequential JPEG files (testxxx.jpg) should look like the following:</p>
<blockquote>
<table border="0">
<table border="0">
     <tr align="center">
     <tr align="center">
Line 354: Line 252:
<td width="180">test120.jpg</td>
<td width="180">test120.jpg</td>
     </tr>
     </tr>
</table>
</table>
</blockquote>
<br>
<h2><b>WAV file format</b></h2>
<hr style="background-color:transparent;">
<h3><b>Description</b></h3>
<hr>
<hr style="background-color:transparent;">
<p>The <code>THPConv</code> tool can convert a general WAV file to THP audio data and interleave it with THP movie data. The following restrictions apply to WAV files that can be converted by the <code>THPConv</code> tool.</p>
<blockquote>
- <b>They must be non-compressed 16-bit PCM data.</b><br>
- <b>Monaural (one channel) and stereo (two channels) are supported.</b>
</blockquote>
<p>If the wav file does not meet these requirements, the <code>THPConv</code> tool will output an error and stop processing.</p>
<br>


<h3><b>Notes</b></h3>
=== WAV file format ===
<hr>


<hr style="background-color:transparent;">
==== Description ====


<p>
<strong><b>NOTE 1:</b></strong> Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.
</p>


<p>
The THPConv tool can convert a general WAV file to THP audio data and interleave it with THP movie data. The following restrictions apply to WAV files that can be converted by the THPConv tool:
<b>NOTE 2: </b> WAV files having a playback frequency other than 48,000Hz or 32,000Hz can be specified in <code>THPConv</code>. When playing THP movie data created with such WAV files, use <code>THPPlayerStrmAX</code>.<br><br>Even if you created THP movie data specifying wav files with a playback frequency of 48,000Hz or 32,000Hz, if the playback frequency setting on the Wii is different, use <code>THPPlayerStrmAX</code>.
</p>


<p>
* They must be non-compressed 16-bit PCM data.
<b>NOTE 3:</b> If you want the THP movie data to contain more than one audio data set, make sure the channel counts and playback frequencies for all data sets are the same.
* Monaural (one channel) and stereo (two channels) are supported.
</p>


<br>
If the wav file does not meet these requirements, the THPConv tool will output an error and stop processing.


{{ note |
* Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.
* WAV files having a playback frequency other than 48,000Hz or 32,000Hz can be specified in THPConv. When playing THP movie data created with such WAV files, use <code>THPPlayerStrmAX</code>.Even if you created THP movie data specifying wav files with a playback frequency of 48,000Hz or 32,000Hz, if the playback frequency setting on the Wii is different, use <code>THPPlayerStrmAX</code>.
* If you want the THP movie data to contain more than one audio data set, make sure the channel counts and playback frequencies for all data sets are the same.
}}
<!--
<!--
= Creating a THP video for SMG =
= Creating a THP video for SMG =

Latest revision as of 17:03, 10 May 2024

This page contains content/info from the Revolution SDK. This is to be considered 100% true.

THPConv.exe is a prebuilt Win32 console application that Nintendo provides in the Wii and GCN SDKs. It is used to convert sequential JPEG images into a THP video format (with an option to include audio into it from a WAV audio file) and to include/replace audio of an existent THP video. It needs the dsptool.dll file to work.

There is a similar program called THPConvD.exe included alonside THPConv.exe and according to the Wii SDK docs:

there is no difference in how the two behave. Normally you should use THPConv.exe. THPConvD.exe remains in order to maintain compatibility with past systems.

So you may use either THPConv.exe or THPConvD.exe to make/edit THP files (be sure to have the respective dsptoolD.dll for THPConvD.exe).

Linux users can use Wine to run both programs.

Converting Sequential JPEG files to THP Movie Data

Description

The following describes how to use the THPConv tool to convert Sequential JPEG files to THP movie data:

THPConv.exe -j <*.jpg> -d <outputfile> [-<option> <argument>]

Options description:

Option Argument Description
-j <*.jpg> Specifies the input files (sequential JPEG files). Wildcard characters ("*") can be used. This argument must always be specified.
-d <outputfile> Specifies the output file (THP file). This argument must always be specified.
-s <wavefile><wavefile>...... Specifies the audio file (WAV file) that will be converted to THP audio data. When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified.
-r <framerate> Specifies the movie's frame rate. Frame rates from 1.0 to 59.94 can be specified. If nothing is specified, the default value (29.97) is used.
-o - THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the THPConv tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.
-non - Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify -odd. When interlace starts from an even numbered field, specify -even. If this argument is not specified, the THP video data format is automatically set to non-interlaced (-non).
-odd
-even
-v - Turns on Verbose mode.
-h - Displays the option list.

Example

THPConv.exe -j test*.jpg -d output.thp

When this example is executed from a command line, the sequential JPEG files in the current directory (test001.jpg, test002.jpg, test003.jpg, etc.) are converted to THP video data and collected into a single THP movie data file (output.thp). No WAV audio is specified so the THP video will be just video without audio.

  • When converting sequential JPEG files to THP movie data, the names of the specified input files must have the extension ".jpg" or ".jpeg".
  • Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.

Changing THP Audio Data in THP Movie Data

Note that some of the commands options above are the same here (being those -s, -d, -r, -o, -non, -even, -odd, -v, -h).

Description

Below are the instructions for using the THPConv tool to change the THP audio data in THP Movie Data.

THPConv.exe -c <inputfile> -s <wavefile> <wavefile>... -d <outputfile> [-<option> <argument>]

Options Description:

option argument Description
-c <inputfile> Specifies the input file (THP file). This argument must always be specified.
-s <wavefile><wavefile>...... Specifies the replacing sound file (WAV file). When specifying more than one file for the argument, data is allocated to audio tracks in the order it is specified. If a THP file format that does not support multitracks is input, the output file will be in a format that supports multitracks.
-d <outputfile> Specifies the output file (THP file). If this argument is not given, the THPConv tool will overwrite the input file.
-r <framerate> Specifies the movie's frame rate. Frame rates from 1.0 to 59.94 can be specified. If nothing is specified, the default value (29.97) is used.
-o - THP movie data can internally store offsets to each frame data as a table. If this argument is specified, the THPConv tool will create an offset table in the THP data. If this argument is not specified, the THP movie data, no offset table will be created in the THP movie data.
-non - Specifies the THP video data format. When interlace starts the video data from an odd numbered field, specify -odd. When interlace starts from an even numbered field, specify -even. If this argument is not specified, the THP video data format will be automatically set to non-interlaced (-non).
-odd
-even
-trk <track No.><wavefile> If you only want to replace a single audio track dataset, use this option instead of -s. The first argument is the audio track number to replace (0-), the second argument is the sound file (WAV file) that will make the replacement. Using this option invalidates the -r, -o, -non, -odd, and -even options. This option can only be used with the THP file formats that support multitracks.
-v - Turns on Verbose mode.
-h - Displays the option list.
  • When the THPConv tool replaces audio data in existing THP movie data, the old THP audio data is deleted. Once the THP audio data is deleted, it cannot be restored. If no output file is specified when the audio data is replaced, the THPConv tool will overwrite the THP movie data. When replacing the audio data, be sure to create a backup file or to specify an output file; this will prevent accidental deletion of your data.
  • If the replacement WAV file has a longer playback time than the THP movie data, the section of the replacement WAV file that is longer than the THP movie data will not be converted. If the playback time of the THP movie data is longer than the wave file, the remaining section will be silent.
  • If the THP movie data specified as the input data does not contain audio data, this operation will add THP audio data to the specified file.
  • If you want the THP movie data to contain more than one audio track dataset, make sure that the channel counts and playback frequencies for all audio track datasets are the same.
  • Unlike the Nintendo GameCube, audio data on the Wii console is output at a set playback frequency (48,000 Hz or 32,000 Hz).

Compatible file formats for THPConv

Sequential JPEG File Format

Description

The THPConv tool can convert a group of sequential JPEG files having sequence numbers at the end of their filenames (indicating the playback order) to THP movie data. When interleaving audio data in sequential JPEG files, you must either specify the WAV files by using the -s option at the time the sequential JPEG files are converted, or add the WAV files after conversion.

The following restrictions apply to groups of sequential JPEG files that can be handled with the THPConv tool:

  • All JPEG files to be collected into a single THP movie dataset must have the same number of pixels in the horizontal and vertical directions.
  • The group of sequential JPEG files must have sequence numbers (corresponding to frame numbers) appended to the end of their filenames.
  • The number of the JPEG file corresponding to the initial frame of the THP movie data can be any number. However, the numbers of all files thereafter must be sequential.
  • Please add leading zeros to the frame numbers appended to the filenames so that they all match the number of digits in the last frame.

The following restrictions apply to each file in a group of sequential JPEG files:

  • Only the JPEG baseline DCT format is supported.
  • Only sequential encoding is supported.
  • Only supports a sample rate of 4:2:0.
  • The pixel counts in both the horizontal and vertical directions must be a multiple of 16.
  • The maximum pixel count in the horizontal direction is 672 dots. There is no restriction on the pixel count in the vertical direction.

If the sequential JPEG files do not meet these requirements, the THPConv tool will output an error and stop processing.

Example

To create four seconds of THP movie data at 30 FPS from sequential JPEG files, the numbers of the sequential JPEG files (testxxx.jpg) should look like the following:

Frame 1 : test001.jpg
Frame 2 : test002.jpg
Frame 3 : test003.jpg
… :
Frame 51 : test051.jpg
Frame 52 : test052.jpg
… :
Frame 118 : test118.jpg
Frame 119 : test119.jpg
Frame 120 : test120.jpg

WAV file format

Description

The THPConv tool can convert a general WAV file to THP audio data and interleave it with THP movie data. The following restrictions apply to WAV files that can be converted by the THPConv tool:

  • They must be non-compressed 16-bit PCM data.
  • Monaural (one channel) and stereo (two channels) are supported.

If the wav file does not meet these requirements, the THPConv tool will output an error and stop processing.

  • Unlike the Nintendo GameCube, audio data is output at the set playback frequency (of 48,000 Hz or 32,000 Hz) on the Wii.
  • WAV files having a playback frequency other than 48,000Hz or 32,000Hz can be specified in THPConv. When playing THP movie data created with such WAV files, use THPPlayerStrmAX.Even if you created THP movie data specifying wav files with a playback frequency of 48,000Hz or 32,000Hz, if the playback frequency setting on the Wii is different, use THPPlayerStrmAX.
  • If you want the THP movie data to contain more than one audio data set, make sure the channel counts and playback frequencies for all data sets are the same.