Since Youtube videos still get the most publicity and a few people here use this platform, I thought I'd share my approach to encoding game footage.
I don't claim it's the best way to achieve high quality. In fact, it most likely isn't and it all comes down to personal preference anyway.
First of all, I capture gameplay with the emulator's built-in AVI recording (FCEUX in this case, Nestopia kept failing on me and I didn't try Nintendulator). The video will have a resolution of 256x224 if recorded using NTSC emulation (256x240 for PAL, Nestopia always outputs 256x240 it seems).
Then I call MEncoder, which comes with MPlayer, from the command line with the following parameters:
This will double the base video's size (-vf scale=512:448) using the nearest neighbour algorithm (-sws 4), so the pixels will remain crisp and clean. Then, black borders get added (expand=640:480) to fit the native size of Youtube's player. This ensures Youtube won't apply any further resizing, and hence blurring, to the image. Also, our video will get the 480p tag which will use higher video and audio bit rates and can improve overall quality.
Unfortunately, MPEG4 seems to be the best(?) codec MEncoder supports for this purpose (it's well-accepted by Youtube). It is quite lossy, so be sure to choose a high bit rate, especially when there's a lot of things going on in the video (waterfalls in MM2/Bubble Man Stage come to mind).
The downside is that the produced files will get rather large.
Test video (MEncoder)
Not the worst quality, but be sure to watch it in the large player.
However, the 30fps limit is still bothering me. Fluency suffers a lot from it. Also notice how Mario becomes invisible when he gets hit due to his flickering at 30fps.
So, the other day, after a lot of googling, I came up with an AviSynth script that converts 60fps to 30fps video by blending odd and even frames together.
Test video with frame blending (AviSynth+MEncoder)
Now Mario effectively becomes transparent when hit and sprite movement in BladeBuster looks pretty smooth.
Scrolling can get kind of mushy, though. I think it works best for old arcade-style games with plain backgrounds.
If you have any improvements or other/better methods, feel free to post them!
Also, what would be a good (60fps-)alternative to Youtube if, for example, all you want to do is embed a video in your blog?
I don't claim it's the best way to achieve high quality. In fact, it most likely isn't and it all comes down to personal preference anyway.
First of all, I capture gameplay with the emulator's built-in AVI recording (FCEUX in this case, Nestopia kept failing on me and I didn't try Nintendulator). The video will have a resolution of 256x224 if recorded using NTSC emulation (256x240 for PAL, Nestopia always outputs 256x240 it seems).
Then I call MEncoder, which comes with MPlayer, from the command line with the following parameters:
Code:
mencoder in.avi -o out.avi -ovc lavc -lavcopts vcodec=mpeg4:mbd=1:vbitrate=8000 -ofps 30 -vf scale=512:448,expand=640:480 -sws 4 -oac mp3lame -lameopts vbr=2:q=2:aq=0:mode=1:lowpassfreq=19700
This will double the base video's size (-vf scale=512:448) using the nearest neighbour algorithm (-sws 4), so the pixels will remain crisp and clean. Then, black borders get added (expand=640:480) to fit the native size of Youtube's player. This ensures Youtube won't apply any further resizing, and hence blurring, to the image. Also, our video will get the 480p tag which will use higher video and audio bit rates and can improve overall quality.
Unfortunately, MPEG4 seems to be the best(?) codec MEncoder supports for this purpose (it's well-accepted by Youtube). It is quite lossy, so be sure to choose a high bit rate, especially when there's a lot of things going on in the video (waterfalls in MM2/Bubble Man Stage come to mind).
The downside is that the produced files will get rather large.
Test video (MEncoder)
Not the worst quality, but be sure to watch it in the large player.
However, the 30fps limit is still bothering me. Fluency suffers a lot from it. Also notice how Mario becomes invisible when he gets hit due to his flickering at 30fps.
So, the other day, after a lot of googling, I came up with an AviSynth script that converts 60fps to 30fps video by blending odd and even frames together.
Code:
function BlendFrames (clip video)
{
v = assumefieldbased(video)
out = layer(v, trim(v, 1, 0), "fast")
out = ChangeFPS(out,30)
assumeframebased(out)
}
directshowsource("enctest.avi")
ConvertToRGB32()
BlendFrames()
{
v = assumefieldbased(video)
out = layer(v, trim(v, 1, 0), "fast")
out = ChangeFPS(out,30)
assumeframebased(out)
}
directshowsource("enctest.avi")
ConvertToRGB32()
BlendFrames()
Test video with frame blending (AviSynth+MEncoder)
Now Mario effectively becomes transparent when hit and sprite movement in BladeBuster looks pretty smooth.
Scrolling can get kind of mushy, though. I think it works best for old arcade-style games with plain backgrounds.
If you have any improvements or other/better methods, feel free to post them!
Also, what would be a good (60fps-)alternative to Youtube if, for example, all you want to do is embed a video in your blog?