I've been toying with recording some gameplay to an AVI recently and, no matter what I do the audio seems to get horribly out of sync. I was using the Xvid, MPEG 4 codec. I played with a bunch of the settings, but nothing seemed to help. Anyone have similar problems?
I think if I'm really interested in recording video I may have to just train a camera on the television and hope there aren't scanline artifacts.
I remember having sync problems when capturing the output of the NES through my DV camcorder... It seems that was because the frame rate of the NES is slightly more than officially defined for NTSC. I solved that using VirtualDub to modify the video's frame rate from the default NTSC value to what the NES actually outputs.
If you mean capturing from emulators, sync problems might happen if you use a standalone software to grab the emulator window, and if that's the case I suggest you use an emulator with built in video capture, so that there is no race between the emulation and the video encoding, which often results in choppy video with audio sync problems.
NTSC standard: 59.94 fields per second
NTSC NES: 60.10 fields per second
My Philips DVD recorder successfully records NES video, with a slightly off frame rate when I use FFmpeg to turn the .vob files into something my editor can use, but that's easily fixed. NES works through A/V cables, but for some reason though, it turns Super NES video black-and-white unless I use the RF input. My SD camcorder has a composite input that handles VHS, GameCube, and Wii 480i video properly but can't handle NES 240p video at all; when I tried to record myself playing Balloon Fight, it played at the wrong frame rate and then threw an error after a few seconds, as if the fields were treated as separate interlaced frames and then going into a circular buffer that got filled.
I tried recording with VisualBoyAdvance for Windows (version 1.8.0 beta something), an emulator with built-in AVI output. I still had to correct the frame rate afterward because AVI output in this version of VBA was defective.
How many emulators for Linux or Mac have built-in video capture? Or how well does Wine support the necessary VFW components? Or would you recommend waiting until I'm on a machine with Windows instead?
Sorry for muddying my original meaning, my main concern is with video capture from emulators, particularly the newest version of FCEUX. I can record an AVI but the video becomes out of sync with the audio rather quickly. (in other words, when I play back the video, the audio is horribly out of sync within 10 or 20 seconds).
If your emulator has its own AVI output, it might be acting like VisualBoyAdvance. Try just changing the AVI's frame rate in VirtualDub.
Yeah, open the video in
VirtualDub, go to Video->Frame Rate and try the "Change so video and audio durations match" option. To see the result you have to use the PLAY button that has an "o" (for output). If that doesn't fix it, you can try other frame rates manually, until you find something that works. If even that doesn't work, I suggest you try other emulators before deciding to film your TV's screen.
EDIT: Don't use frame rate conversion though, only adjustment. Adjustments keep all frames in the video but play them at different rates, conversion drops/duplicates frames to keep the video playing at the same apparent speed (that's what you would use to cheaply convert between PAL and NTSC for example).
With FCEU derivatives, the reason this happens is because the frame rate is not exactly 60fps in NTSC, but the frame rate stored in the AVI is 60fps. However, the audio runs at the slightly different speed, causing skew. I used to use Avisynth to sync everything up, but I would surmise that tokumaru's method of using VDub would work as well (although I would test it with some quite long captures first, just to be on the safe side).
Oh yeah, I forgot about Avisynth. I often use it along with VirtualDub for a lot of things. If I'm not mistaken, Avisynth will allow you to change the frame rate, but in order to make a fixed avi file you'll have to re-encode the file (passing the Avisynth script through the encoder program), which will take time and degrade the video's quality.
In VirtualDub, if you select Video->Direct stream copy the data won't be re-encoded at all when you save a new file. That's kind of important, and I forgot to mention it sorry.
If you actually plan on re-encoding the video though (if you wanted to make it smaller for uploading, for example), then you could use either program.
Nobody seems to be focusing on the fact that the OP didn't disclose what audio codec he chose for his audio, or what he's using for doing the actual video and audio encoding. If he's resampling the audio (decreasing the rate), or going from 16 to 8 bit, stereo to mono, etc., depending on the encoding software, said problem can happen.
I've experienced exactly what he's describing with numerous programmes. The only one I don't have problems with is VirtualDub, using XviD as the video codec and LAME MP3 as the audio codec (you'll need to install the
LAME ACM package on your system to achieve encoding MP3 better than 56kbit, at least on Windows XP).
If you need step-by-step instructions on how to do all of this, I can step you through it (both the install and the VirtualDub pieces). It's incredibly easy.
Thanks for the tips! VirtualDub worked great.