Add mc32 script ref

ABelliqueux 2021-10-14 17:09:15 +02:00
parent 80d0732a8f
commit 1df83e2beb

48
STR.md

@ -28,14 +28,17 @@ Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, u8, 70
### Video to AVI
Use Virtualdub or ffmpeg :
Use Virtualdub or ffmpeg+mencoder :
```bash
ffmpeg -i $INPUT.MKV -vcodec rawvideo -pix_fmt bgr24 -vf scale=320:240,setsar=1:1 -acodec pcm_u8 -ar 44100 -r 15 $OUTPUT.avi
ffmpeg -i $INPUT.MKV -vcodec rawvideo -pix_fmt bgr24 -vf scale=320:240,setsar=1:1 -acodec pcm_u8 -ar 44100 -r 15 tmp.avi
mencoder tmp.avi -ovc copy -o $OUTPUT.avi
```
### AVI to STR
#### Via the Graphic interface
Use [`MC32.EXE`](http://psx.arthus.net/tools/pimp-psx.zip) to convert the AVI file to STR using these settings :
```
@ -47,8 +50,37 @@ MDEC: version 2
![MC32-avi-str](https://wiki.arthus.net/assets/MC32-avi-str.png)
**If `MC32.exe` crashes when hitting the 'Go' button, you have to open the ffmpeg AVI file in virtualdub, then save it again ; `File > Save as AVI...` or `F7` key, then retry.**
#### Via the command line
`MC32` can be used with a script to avoid using a graphical interface. The script syntax is described in PsyQ's documentation file ['Datavconv.pdf', p.34](http://psx.arthus.net/sdk/Psy-Q/DOCS/Devrefs/Dataconv.pdf).
Here is an example script to convert a video + audio AVI file to str;
```
Avi2strMdecAv(
path/to/input.avi, # Input file name
path/to/output.str, # Output file name
x2, # CD-ROM speed
15fps, # Frame rate
1, # Number of channels
2, # MDEC version
TRUE, # LeapSector
37.8KHz, # Frequency of Sound
Stereo # Stereo or Mono
);
```
Create a file with that content and save it with the `scr` extension; e.g : myscript.scr
You can then run this script with the following command :
```bash
mc32.exe -s myscript.scr
```
See here for a full reference of the scripting language : [https://psx.arthus.net/sdk/Psy-Q/DOCS/MC32.SCR](https://psx.arthus.net/sdk/Psy-Q/DOCS/MC32.SCR)
You should now have a STR file and a XA file that you have to interleave in `MC32`:
```
@ -60,6 +92,16 @@ CD-ROM speed : Double Speed;
![MC32-avi-str-interleave](https://wiki.arthus.net/assets/MC32-avi-str-interleaved.png)
#### MC32.EXE crashes
MC32 doesn't seem to like ffmpeg's AVI files and often crashes when hitting the 'Go' button. In order to prevent crashing, you should re-save the avi file with `mencoder` :
```bash
mencoder file.avi -ovc copy -o file_clean.avi
```
You can also use `virtualdub` ; open the ffmpeg AVI file in virtualdub, then save it again ; `File > Save as AVI...` or `F7` key, then retry.
### Finding a video's frame count
With `ffmpeg` :