Video Capture write-up on my blog

question anything pertaining to the craft
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Video Capture write-up on my blog

Post by ZenFire »

The title says it all. On my Yahoo! 360 pageis my blog which so far has 4 entries, but I'm planning on keeping it updated with interesting info. The latest entry is on Deinterlacing.

There was one previous entry on the topic of video capture, which is why it's referred to as "part 2" in the title. The previous one is about recreating 60 fps video from interlaced sources. You can count/measure frame data for yourself using that method and still have decent quality video you can use in combo videos.

I'm planning on doing at least two more of these, one about cropping and resizing and another on compression. I hope these become useful. I read posts of people saying they didnt' know too much about video, so maybe this will teach you something you didn't know. Even if you do know about video, pls read it and tell me if I should add or rectify something.


PS. Yahoo! 360 is a nice community site. It would be awesome if people from this forum made their own personal page with blogs about videos and other game crap. We could form one of the few Yahoo! Groups that doesn't suck.
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Post by Magnetro »

Nice post! I posted something to find frame data on your own.

http://forums.shoryuken.com/showthread.php?t=109259
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Nice post yourself! :shock:
I don't remember seeing that thread before, which is odd cus it's even stickied. You have a nice collection of links in the first part. Too bad the second half is all about the Tsunami encoder, even a year ago MPEG-1 was pretty outdated.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Added an entry about cropping and resizing. I wonder if maybe I should plug my blog in the shameless plug aka side projects thread.

Direct link:
http://blog.360.yahoo.com/blog-czrqHL4r ... ?cq=1&p=21
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

Would you mind adding your opinion to this thread about choosing a capture card? I still haven't had time to go out and buy one. Then again, to be honest, i probably need a whole new desktop computer because i doubt my 2-year-old laptop can handle it.

It's funny that i'm probably going to end up buying a computer for the sole purpose of capturing and editing video. Cuz i'm still gonna use my laptop for just about everything. And it's been years since the last time i played a computer game.

Anyway i'd appreciate your advice cuz you seem really knowledgeable about this subject.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

sure thing.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Here's a small intro/guide to x264 I wrote. http://blog.360.yahoo.com/blog-czrqHL4r ... ?cq=1&p=29

But don't just take my word for it, ask your friends!

PS. Could someone leave a comment on one of my entries, cus I get hits but I dunno if anyone's reading it :oops:
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

How do you capture from Dreamcast? Do you use Component video, S-video or VGA signal? Finding that extra advanced stuff is difficult these days cuz every store is sold out.
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Post by Magnetro »

Maj wrote:How do you capture from Dreamcast? Do you use Component video, S-video or VGA signal? Finding that extra advanced stuff is difficult these days cuz every store is sold out.
S-Video. 720x480 @ 29.97i
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

Ok so i found a store with a Dreamcast VGA cable in stock. Isn't that a digital signal? Can't i just glue that to my hard drive and record footage directly?

They also have an S-video cable but it looks helluva ghetto, like it was homemade.
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Post by Magnetro »

Maj wrote:Ok so i found a store with a Dreamcast VGA cable in stock. Isn't that a digital signal? Can't i just glue that to my hard drive and record footage directly?

They also have an S-video cable but it looks helluva ghetto, like it was homemade.
Nah, S-Video is the only way to go.............

Unless you buy a really expensive (500+ I think) capture card that can capture component...and even then, I'm not sure if that would work.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

VGA is analog, it's just really high quality like component (RGB cable) video.
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

Ah ok. Btw i was just joking about the glue. I know that glue can't conduct electricity as good as silver duct tape does. Ok, so S-video it is.
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

On your blog, it says to capture video in 30 fps interlaced, in order to convert into 60 fps deinterlaced. But don't NTSC consoles output video in 29.97 fps interlaced? It's not a huge deal because that's only a difference of 3 frames per 1000, but in my experience, most programs including WMP prefer 29.97 and 59.94 over 60. Whenever i encode in 60 fps using TMPGEnc, video playback in WMP produces all sorts of crazy artifacts.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

You're right, it's officially 29.97. When I capture in DScaler all my videos automatically have 30fps timing set, I don't know why and I don't question it. I think the reason for MPEG-1 acting weird at 60fps is a shortcoming of Microsoft's decoder, but I have no proof of that.
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

As of right now, what do you think is the best way to deinterlace a 29.97 fps video in order to end up with 59.94 fps? I tried the TomsMoComp method mentioned on your blog but it produces a lot of artifacts. They aren't really noticeable unless you watch frame by frame, but if you've found a better method please let me know.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

I don't really use bob deinterlaced (double framerate) footage for anything really so I have not really looked for the optimal parameters, but right now I like using TDeint with the following arguments in AviSynth:

Code: Select all

TDeint(order=1, mode=1, map=0, mthreshL=10, mthreshC=10, type=0, mtnmode=3, link=1)
The artifacts you should be worried about now are flickering of lines that are only one pixel high. Unfortunately there are quite a few of those around combo ccounters life bars and super meters in fighting games, so you might want to mess around with the parameters to see what's best for you. There are also some filters whose only purpose is to remove flickering, but doing this after the fact probably isn't the best way to go at it. Like I said before, since I haven't really bothered getting better bob deinterlaced footage, I can't help you more than that. Except maybe mention that on the same page you can get TDeint from here also has SmoothDeinterlace for AviSynth. That's the one I'm using for my Haohmaru video, but I use a version for VirtualDub. The AviSynth version also has a Doublerate parameter. This should produce really good looking stuff if what I've seen from teh VDub filter is any indication, but I have not tried it myself yet.

I hope that helps. I should write a new entry about these things.

EDIT: I did some testing cus you made me pretty curious to try out that filter. Right now I really like the following settings for one of my haohvid clips:

Code: Select all

SmoothDeinterlace(lacethresh=40, edgethresh=20, staticthresh=35, staticavg=50, doublerate=true, blend=false)
It only takes YUY2 and RGB32 so if you get an error use

Code: Select all

ConvertToRGB32(interlaced=true)
before the SmoothDeinterlace. I had to anyway, cus my footage was in RGB24.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Here's the script you asked for to change your footage FPS and make its audio fit the length

Code: Select all

AviSource("served.avi")
AssumeFPS(15)
timestretch( tempo = ((audiolength/audiorate) / (framecount/framerate))*100 )
Where "served.avi" is the name of your video file and 15 is the FPS you want for the target. After figuring it out it looks so simple.

If you want to use this or any other script on many files and don't want to manually change the filename each time: AviSynth Batch Scripterat your service
Maj
Posts: 6753
Joined: Wed Dec 13, 2006 12:53 am
Location: Los Angeles
Contact:

Post by Maj »

For some reason, the ZSNES coders set the default NTSC movie dump framerate to 59649/995, which comes out to 59.9487437 fps. True NTSC framerate is 60000/1001, which comes out to 59.9400599. I've been trying to get ahold of those guys all day, but everyone on those IRC channels is rude as fuck. It would be easy enough to change the cfg file to make it output to true NTSC, but maybe there's a good reason for their choice. So i'm going to stick with their weird number and then convert the output to it to 59.94 fps myself.

Apparently VirtualDub's Video frame rate control dialog lets you change the framerate without eliminating or adding any frames:
VirtualDub: Adjusting frame rate wrote:If the source video has the wrong frame rate or doesn't natively have a frame rate (image sequence), you can specify one in the source correction portion of the dialog. You can either type in a rate, or have VirtualDub automatically choose a "same length" setting, such that the video and audio tracks end at the same time.

Note: No frames are added or deleted by this setting, so if the video is synchronized with the audio beforehand it won't be after you change the frame rate. Similarly, if the video isn't synchronized, you may be able to fix it with this setting.
Unfortunately, when i tried to change a 59.949 fps x264 avi into 59.940 fps uncompressed avi with VirtualDub, the resulting file came out to be 59.941 fps (according to VirtualDub). Instead i ended up using a simple AviSynth script

Code: Select all

AviSource("source.avi")
AssumeFPS(59.94)
Worked just fine. Btw, for those of you trying to figure out how AviSynth works, you just make a script file and open it in VirtualDub as if it were a video file. It opens the source video file along with the changes in the script. Pretty straightforward.
jchensor
Posts: 229
Joined: Wed Dec 13, 2006 1:02 am

Post by jchensor »

Hey, ZenFire. Was hoping you could help me.

I've been capping some clips and, well, before I'd just accept it, but after seeing the eye sex that is the Haohmaru video, I just can't accept the shitty interlacing problems. And I wanna make my clips look good as well.

So I spoke with Maj all last night and he basically parroted to me most of this thread in an attempt to clean up my clips. I've capped them already with a Pinnacle Movie Box, and they look awful. So I've got AVISynth and all those deinterlace plugins for it and I've tried to use all of the script lines that you have in this thread...

But it's not happening for me. When I create the new clip, it looks smooth... but it plays at half the speed and sound is really off. It keep stuttering and repeating to "keep up" (keep down?) with the slow playing of the clip. THe odd thing is that the clip is LISTED as the same length as the source clip (18 seconds), so it THINKS it should play at a normal speed, but it's doesn't.

You have any idea what I can do to make this work properly? Pinnacle caps clips in its weird codec ("Internal DV decoder"). I've tried the SmoothDeinterlacer, TDeint, and TomsMoComp. All three result in the same problem.

Thanks, ZenFire, for any help you can give me.

- James
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Post by Magnetro »

You can try using virtual dub, it's a lot simpler than that stuff.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Thanks for the compliments on the haoh vid. In the end I think it could have looked better, but I'm still glad with the outcome.

Where you say "When I create the new clip" do you mean the script (.AVS) file? If not then skip the next part. Because every frame is being calculated on the fly, using the script itself for playback will only be practical with the simplest of processing. You could use the script files for editing (if your editor supports them in the first place) and it shouldn't pose any problem as long as you don't expect full speed performance. However, I think you'd be better off opening the script file in VirtualDub and compressing the processed video to an AVI file with lossless encoder before doing any further editing (or playback).

As for the Pinnacle capturing software. I wouldn't use any capture software that doesn't let you choose what encoder it uses unless I really didn't have another choice. Also, compression BEFORE deinterlacing can cause additional artifacts. Deinterlacing is always messy, but compression artifacts can cause bleeding in between fields which will make things worse. DV is not lossless anyway, so I'd recommend you capture using something else like Vdub, DScaler or even AMcap.

Btw, are you trying to make double framerate video (~60fps aka bob-deinterlacing aka progressive frame reconstruction)? I hope I said soemthing useful, if not you can give it another shot XD
jchensor
Posts: 229
Joined: Wed Dec 13, 2006 1:02 am

Post by jchensor »

Hey, ZenFire.

Looks like I figured a long way around the problem. Even though the deinterlaced videos don't play well on my computer, After Effects still process them properly. So I was able to re-render them with AE and then they looked better. Eons better than the pre-deinterlaced versions.

- James
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Random idea

Post by ZenFire »

Here's something I came up with a few days ago. I decided to put it up here as an idea so that maybe someone with a p-pad and some patience could use it.

You can get full 60Hz progressive video from your console's interlaced signal by recording the EXACT same footage twice. Once starting at an arbitrary point and another time at 1/60th of a second later (real time, not game time). What you get is that the first video's even lines correspond to with the odd lines of the second video. You can SeperateFields() then there's some other trickery needed to weave the correct fields together to produce the 60Hz progressive video. I haven't worked the code out entirely yet because this doesn't apply to me since I don't have a p-pad to reproduce the same input twice and being in sync with the background animation. It might be possible in cvs2 with speed setting0, recording dummy and the restart option in training mode, but I haven't tried. That's actually where I got hte idea from. Recording Haoh's CC several times showed me how what game-frame you start on translates into what field you start on and how it was a 50% chance of being odd or even. It's jsut a matter of time before you record both the odd and even lines of the original progressive frames. You can then combine them into what it originally looked like, no deinterlacing, no artifacts, just clean beautiful video.
Magnetro
Posts: 1126
Joined: Fri Dec 15, 2006 5:51 am
Location: CA
Contact:

Re: Random idea

Post by Magnetro »

ZenFire wrote:Here's something I came up with a few days ago. I decided to put it up here as an idea so that maybe someone with a p-pad and some patience could use it.

You can get full 60Hz progressive video from your console's interlaced signal by recording the EXACT same footage twice. Once starting at an arbitrary point and another time at 1/60th of a second later (real time, not game time). What you get is that the first video's even lines correspond to with the odd lines of the second video. You can SeperateFields() then there's some other trickery needed to weave the correct fields together to produce the 60Hz progressive video. I haven't worked the code out entirely yet because this doesn't apply to me since I don't have a p-pad to reproduce the same input twice and being in sync with the background animation. It might be possible in cvs2 with speed setting0, recording dummy and the restart option in training mode, but I haven't tried. That's actually where I got hte idea from. Recording Haoh's CC several times showed me how what game-frame you start on translates into what field you start on and how it was a 50% chance of being odd or even. It's jsut a matter of time before you record both the odd and even lines of the original progressive frames. You can then combine them into what it originally looked like, no deinterlacing, no artifacts, just clean beautiful video.
That sounds interesting, I think I'll try that soon. We can talk about it on AIM.
laugh
Posts: 118
Joined: Mon Jan 22, 2007 2:25 am

Post by laugh »

That's really clever. I've never thought of getting progressive 59.94fps footage like that. A bit of work but that's sooo worth it.

BTW, you wouldn't need a p-pad at all. All you need to do is have the footage on a tape (I use my DV camcorder to record and I play them back later and capture them). The reason why playing back the same combo from a p-pad doesn't work is because you'd have to find the exact same point in time when the background is doing the exactly the same sequence of events at exact same positions on the screen etc to weave the fields together. So that's why recording onto a camcorder first and then capturing the same recorded footage twice is the only reasonable way I can think of doing this.

I think the biggest problem would be that unless there was a program/plugin that weaved the even ad odd fields of the same frame from two sources automatically, this awesome idea can't get realized.
CC that shit
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

The weaving is the smallest problem actually, because there is such a program (avisynth). The thing about the background is the reason why I mentioned using restart in training mode, that's pretty much the only way to make sure everything gets started from the same point of origin. About recording and playing back later. I don't believe your camera records progressive video, even if it did the signal out of a PS2 is allways interlaced (even if not visible because of internal 30fps). I beleive the DC was able to output progressive HD-like video, but I dunno the specifics. So, playing back video later would get you the exact same thing everytime because DV is frame based just like everything else, even though you can see the fields.

The biggest problem, as me and magnetro found out earlier today, is that there's still random factors that prevent you from having the same events twice. Namely, the impact animations have a random location and orientation, so you can't really reproduce soemthing completely faithfully unless you take those elements out of the equation.
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

Here is a proof of concept. The restart functionworks perfectly, and as you can see how it's two different sources at the start, it syncs up perfectly later.

File:
http://www.drakenslag.com/progressive%20perfecto.avi

It would be practical if only it wasn't for the randomness you can't influence.
laugh
Posts: 118
Joined: Mon Jan 22, 2007 2:25 am

Post by laugh »

I'm so dumb for thinking that my footage in my DV cam = progressive. Yeah, you're right. You would definitely need a program pad. The sad thing about it is like you said the hit effects since those are random. So I've been thinking a lot about how to get 480p 60fps video from PS2 and DC and I think I have an answer although it's not practical (at least for me) at the moment.

Some of you might already know, but Xploder released a little product called Xploder HDTV player for PS2. What it does is force PS2 to output progressive component signal through the component cable. It works really well at 480p but has squeeshing problems when set to output higher resolutions, but we don't want higher resolutions.

So we can most definitely get true progressive 480p output from the PS2 and DC (by the means of VGA signal, which we can also convert to progressive component signal) and all we need now is a capture card that can capture 480p at 60fps. This is where I got stuck. I've been searching all night last night and all day today looking for a capture card that supported both component input and 480p and affordable at the same time and I have managed to come up with only 1 card that satisfied all the conditions: the PV3 by the japanese Earthsoft. Unfortunately, PV3 rev.B has just sold out at record speed at the end of last month and they're going for twice their original price tag (27800yen) on yahoo japan auctions.

There were several other cards out there that almost made the list but couldn't because they lacked one of the 3 conditions. I'm hoping Earthsoft would start selling more of their HD capture cards in the near future to increase my(our) chances of getting them.
CC that shit
ZenFire
Posts: 212
Joined: Tue Mar 27, 2007 6:12 pm
Location: Netherlands
Contact:

Post by ZenFire »

I believe 480p at ~60hz is not HDTV but something called EDTV
Linky: http://en.wikipedia.org/wiki/480p
Not sure if that PV3 rev.B supports that, but it sounds very promising. I recall HDTV capture cards being very expensive, so hearing there's an affordable one out there is real good news. Also, I actually didn't know about the Xploder HDTV player >< so that's news to me. I looked at their FAQ and it seems like the signal refresh rate you/me/everyone is looking for can only be gotten through the VGA adapter using some VESA mode (ie: not the games native res). So, I'm gonna keep my hopes tempered until you find out if it all works XD

All this nonsense with prehistoric video technology that's been around far too long is making me want to work with emulators only. I haven't messed around/worked with any emulation with regards to Cps-3 or Naomi, but if they allowed programmed input and game-state saving then I will retire my ps2 (for video making anyway).
Post Reply