Post subject: Automatic encoding script (unix)
Former player
Joined: 2/19/2007
Posts: 424
Location: UK
I know some of you have made systems like this before - dehacked, for example. But I just make one myself, and thought some of you might find the setup useful. Basically, the goal is to be able to automatically encode a snes9x smv file:
smvenc movie.smv movie.mkv
with no other input needed. The smvenc script is defined here: http://folk.uio.no/sigurdkn/smvenc It depends on snes2mkv, which encodes from the raw video and audio snes9x dumps: http://folk.uio.no/sigurdkn/snes2mkv It also uses a few other small tools for extracting information from the smv file: http://folk.uio.no/sigurdkn/bread.cpp http://folk.uio.no/sigurdkn/smvcrc.cpp Additionally, an assumption is that a directory with symlinks from checksum to rom exists. I.e. if you have a snes rom /home/foo/roms/X.smc with checksum 05fbb855, then you should have a directory containing a symlink named 05fbb855 pointing at that file, and similar for the other roms you want the script to handle. The purpose of this is to avoid having to specify the rom yourself. The rom crc can be computed this way: http://folk.uio.no/sigurdkn/romcrc.cpp And that's it, I think. You'll have to edit the hard-coded path to the index directory to point at your own directory in smvenc. Also, you need snes9x-1.43 rerecording, Xvfb and ffmpeg. I made most of this before I automated the encoding itself, since I wanted to be able to play an smv file simply by clicking on a link to it. But that is something I haven't gotten to work, since firefox refuses to look at anything but the mime type when determining what to do with a file, and smvs don't have an associated mime type. Stupid firefox.
Publisher
Joined: 4/23/2009
Posts: 1283
cool tool, thanks for your work!
Post subject: Re: Automatic encoding script (unix)
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
amaurea wrote:
The rom crc can be computed this way: http://folk.uio.no/sigurdkn/romcrc.cpp
That won't work if the ROM dump you have is interleaved, nor will it work for BS dumps. I can also add it requires them to be decompressed.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Post subject: Re: Automatic encoding script (unix)
Former player
Joined: 2/19/2007
Posts: 424
Location: UK
Nach wrote:
That won't work if the ROM dump you have is interleaved, nor will it work for BS dumps. I can also add it requires them to be decompressed.
Yes, that's right. At least on the compression. As for interleaved and BS, I'm not familiar with those, so I'll take your word it doesn't work there either. I wrote this "romcrc.cpp" a long time ago, so I am a bit fuzzy on it, but I think I read the algorithm bsnes uses (which I forgot to credit, sorry), and then simplified it down to the minimum I thought necessary, which was apparently a bit too far. So you can easily make a more general version by not simplifying it like that, if you don't already have one. That said, it has worked for the roms I have tried it on.
Former player
Joined: 2/19/2007
Posts: 424
Location: UK
I've hacked up a proof-of-concept for an automatic encoding service: http://84.208.109.225/~sigurdkn/cgi-bin/smvlist It is quite limited: Only supports snes9x-rr-1.43 movies with the most common sync settings, might occasionally use the wrong rom due to the issue Nach pointed out (but I haven't had this happen myself), and runs on my laptop, which is not always on or connected to the internet. But anyway, feel free to give it a shot. The usage should be quite self-explanatory: Just select an .smv file, and push submit to have it encoded. This is up for testing purposes, so don't hesitate to upload. Edit: OK, taking this down now, as I'm going for a long trip, and nobody tried uploading any smv for encoding.