Post subject: Encoding with snes9x 1.51 linux is broken?
Former player
Joined: 3/23/2006
Posts: 211
I can't seem to get encoding working with snes9x 1.51. snes9x just freezes at frame 293 every time (it hangs with zero cpu activity), then when I kill snes9x mencoder goes on to encode a tiny (8k) avi with nothing in it. Doing exactly the same thing (but with an old-format smv of course) works with snes9x-improvement7. Before I start I run:
rm output*
rm videostream* audiostream*
mkfifo videostream1.dat
mkfifo audiostream1.dat
Then I open two terminals open, in one I run:
./snes9x sup.smc -dumpstreams -maxframes 4842 -r 7 -stereo -autodemo /home/ajh02/pythonSnesBot2/marioMC1.smv
in the other I run:
~/MPlayer/mplayer/mencoder -demuxer rawvideo -rawvideo format=bgr32:w=256:h=224:fps=60 videostream1.dat -ovc x264 -x264encopts bitrate=448:pass=1:me=umh:psnr:frameref=15:subq=7:direct_pred=auto:bframes=6:b_pyramid:weight_b:partitions=all:keyint=500 -o output.avi -audio-demuxer rawaudio -rawaudio rate=48000:samplesize=2:channels=2 -cache 65536 -audiofile audiostream1.dat -oac pcm -channels 1 -srate 4000
anyone got any idea whats wrong? Is snes9x 1.51 broken?
do not forget to *ENJOY THE SAUCE*
Post subject: Re: Encoding with snes9x 1.51 linux is broken?
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
As usual, I patched snes9x-1.51 for my own version before even attempting to use its built in AVI recording mechanism. List of changes: - Adds ignoreframes support - Adds Blargg's NTSC filter support - Reads snes9x.cfg from $HOME/.snes9x/ directory by default now - Adds nesvideos-piece (Bisqwit's AVI recording mechanism) - Adds tiletracker for creating GIF animations (not completely patched in yet) http://bisqwit.iki.fi/src/snes9x-1.51-nesvideo-patch-bisqwit.txt.gz Startup script example... (RUNSNES)
FLAGFILE="`pwd`/s.status"
# Which file do you want to place your audio and video in.
VIDEO_RESULT="`pwd`/test0.avi"

VIDEO="-ovc x264 -x264encopts crf=0:me=dia:turbo=2:frameref=4"
AUDIO="-oac mp3lame -lameopts mode=1:preset=71:aq=0"
VIDEO="$VIDEO -vf decimate=4:64:128:1 -nocache"

EXE="snes9x-1.51"
OPTS="-upanddown"

rm -f "$FLAGFILE"
VIDEO="mencoder \
        - -o '$VIDEO_RESULT' \
        -mc 0 \
        NESVSETTINGS \
        $VIDEO \
        $AUDIO \
        >&1 | tee mencoder.log"
$EXE $OPTS \
        -videologcmd "$VIDEO" \
        -autodemo "$1" "$2"
Script invocation:
./RUNSNES ./smw.smv ./smw.smc
Disclaimer: Not so much tested in production yet.
Former player
Joined: 3/23/2006
Posts: 211
Thanks, but when I try to compile it I get: "unix/nesvideos-piece.cc:14:16: gd.h: No such file or directory" There isn't a file called gd.h in the patch, and both "locate gd.h" and "find -name gd.h" find nothing. I assume this is some "gif drawing" package I don't have installed...
do not forget to *ENJOY THE SAUCE*
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Huffers wrote:
I assume this is some "gif drawing" package I don't have installed...
Yes, it is from libgd... tiletracker uses it for creating PNG files and nesvideos-piece uses it for reading the frames comprimising the logo animation.
Former player
Joined: 3/23/2006
Posts: 211
Cool, I've got it to compile now, but how do I tell it when to end the video? I end up just doing ctrl+c in the terminal it's running in, and it doesn't seem to produce "test0.avi". it also complains about: /home/bisqwit/povray/nesvlogov5/logo_256_224_fXXX.png: No such file or directory (XXX counts up) Could that be breaking it?
do not forget to *ENJOY THE SAUCE*
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Missing logo images don't matter. If it does not produce test0.avi, check mencoder.log for hints what could be the matter.
Former player
Joined: 3/23/2006
Posts: 211
it doesn't produce mencoder.log either :(
do not forget to *ENJOY THE SAUCE*
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Huffers wrote:
it doesn't produce mencoder.log either :(
Was mencoder perhaps not found then? Judging from your previous example, try putting "~/MPlayer/mplayer/mencoder" where it says "mencoder".
Former player
Joined: 3/23/2006
Posts: 211
Bisqwit wrote:
Huffers wrote:
it doesn't produce mencoder.log either :(
Was mencoder perhaps not found then? Judging from your previous example, try putting "~/MPlayer/mplayer/mencoder" where it says "mencoder".
Already tried that. I changed the snes9x bit to point to the right snes9x too. I don't know what this "NESVSETTINGS" argument is that appears to be for mencoder, but it doesn't work either with or without it. If I change the last line of your script to echo the command instead of running it I get:
./snes9x -upanddown -videologcmd /home/ajh02/MPlayer/mplayer/mencoder         - -o '/home/ajh02/snes9x-1.51-Bisqwit/test0.avi'         -mc 0         NESVSETTINGS         -ovc x264 -x264encopts crf=0:me=dia:turbo=2:frameref=4 -vf decimate=4:64:128:1 -nocache         -oac mp3lame -lameopts mode=1:preset=71:aq=0         >&1 | tee ~/mencoder.log -autodemo /home/ajh02/pythonSnesBot2/marioMC1.smv /home/ajh02/pythonSnesBot2/sup.smc
(I think echoing it eats some of the "s)
do not forget to *ENJOY THE SAUCE*
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Huffers wrote:
(I think echoing it eats some of the "s)
Yes, to the point of unclarity. NESVSETTINGS is a string that is substituted by the snes9x patch with the video and audio depth/resolution/bitness/rate settings relevant to that particular movie being encoded. I can't spot anything particularly strange in your output, I would have to test it myself. But this patch is basically a backport... (forwardport?) of my patch for snes9x-1.43, just applied in snes9x-1.51. I haven't got a chance to much test it yet. Maybe there are errors in it.
Former player
Joined: 3/23/2006
Posts: 211
Bisqwit wrote:
I can't spot anything particularly strange in your output, I would have to test it myself. But this patch is basically a backport... (forwardport?) of my patch for snes9x-1.43, just applied in snes9x-1.51. I haven't got a chance to much test it yet. Maybe there are errors in it.
Ah well, thanks for the help anyway. I might have a look at the patch and try figuring it out later this week. Edit: Forget that - the patch is huge! It'd take ages for me to figure out. Edit2: I changed VIDEO to: VIDEO="touch /home/ajh02/called.txt" and the file wasn't created
do not forget to *ENJOY THE SAUCE*