scene detection

joejon wrote on 11/16/2011, 3:49 PM
I'm starting to transfer all my 8mm tapes to my computer. I now have Vegas Pro 11 and use that capture program. I have detect scenes selected in options,capture but when capturing my Hi8 tapes being played from my Digital8 camera via firewire I only get one clip instead of individual clips. I always got individual clilps before but I may have only captured Digital8 tapes before. Should I get individual clips capturing Hi8 tapes or is that not possible with that format? Is there something else I need to do to detect scenes to get individual clips?

Comments

johnmeyer wrote on 11/16/2011, 4:25 PM
I have detect scenes selected in options,capture but when capturing my Hi8 tapes being played from my Digital8 camera via firewire I only get one clip instead of individual clips. I always got individual clilps before but I may have only captured Digital8 tapes before. Should I get individual clips capturing Hi8 tapes or is that not possible with that format? Is there something else I need to do to detect scenes to get individual clips?Analog video, such as 8mm, VHS, and Beta, does not contain embedded timecode that lets a capture program know when the camera was started and stopped. Therefore, there is no 100% reliable way to determine scene boundaries.

Fortunately, there are programs which attempt to detect scenes by looking at the actual video itself. This is called "optical scene detection." One of the best such programs, which can capture video via Firewire AND simultaneously do optical scene detection is:

Scenalyzer

This is a fantastic program and has many, many other features:

Scenalyzer Features

I also have developed an AVISynth script that can do optical scene detection on any video that has already been captured, regardless of the format, including HD video formats. I can post this if anyone is interested.
joejon wrote on 11/16/2011, 6:56 PM
Thanks for the reply. I thought that might be the case but when the Digital8 camera converts the Hi8 media to digital that maybe it would work. I will check into the program you mentioned but would be interested in the AVISynth script also. How do does that work with the video that has already been captured? Thanks again, I wanted to make sure I wasn't doing anything wrong.
johnmeyer wrote on 11/16/2011, 9:25 PM
I will check into the program you mentioned but would be interested in the AVISynth script also. How do does that work with the video that has already been captured? OK, there are actually three different ways to handle this.

1. Download and use Scenalyzer (the shareware program is actually called "SCLive"). This works great with any video that you capture at SD resolution through Firewire (e.g., Digital8 and DV). It is still my first recommendation.

2. Use an optical scene detection utility after rather than during the capture process. It turns out that if you go back to the Scenalyzer site and poke around, you'll find a program that is actually called "Scenalyzer" (rather than SCLive). This is the original freeware program and I think is still available. It has optical scene detection built in, and doesn't do all the neat things of the shareware version. However, if all you want to do is create individual clips from existing video, you can use that.

3. Use one of my scene detection AVISynth scripts. Like #2 above, this is designed to work after you have captured the video. However, if you are comfortable using AVISynth, it actually has some significant advantages. First of all, depending on your setup, it operates very, very quickly. Second, rather than a completely new set of video, cut into individual clips (which is what Scenalyzer in #2 will do, thus doubling the disk space required), my script simply outputs the frame numbers where the scene changes occur. You then copy/paste this text information into the edit details-markers window, which immediately creates markers at every scene change. If you then want to cut your video at these points, you can use my "markers to events" script which will cut both the video and associated audio at the markers.

I have several scene detection scripts, but this one seems to be the most reliable, and it runs quite fast. This is something I developed just for my own use, so I can't guarantee anything. However, it works great for me. You'll need MVTools2 to make it work.

I have another script that just uses the built-in AVISynth functions, and it works OK, but is not as accurate nor as fast as the following script.

BTW, when you copy the frame numbers into the Edit Details -> Markers dialog you first have to click on the gray "button" at the upper left corner (where the rows and columns intersect) in order to get the frame numbers to paste. More important, you also first have to right-click on the ruler and change the ruler measurement units to "frames." As soon as you have pasted the information, you can change the ruler back to whatever it was before.

#Script to find scene changes 

Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")

filename = "e:\scenes.txt" # This is the name of the file that will contain the frame numbers of your scene changes
BlockChangeThresh = 500 # Increase to reduce number of scenes detected; Determines whether a block has changed from prev frame.
Num_blocks_changed = 145 # Increase to reduce number of scenes detected; How many changed blocks (given threshhold above) must change to trigger scene change

source=AVISource("e:\frameserver.avi").killaudio() #Don't need audio for scene detection. Runs faster and more stable without audio

source_fields=source.separatefields().selecteven().convertTOYV12(interlaced=false) Only look at even fields. This quickly cuts the data set in half and makes it run faster

source_super = source_fields.MSuper(pel=2, sharp=0)

#Use really large blocksize to speed processing. Accuracy isn't important for this function
backward_vec = MAnalyse(source_super,isb = true, delta = 1, blksize=16,search=0)

SceneChange = MSCDetection (source_fields, backward_vec,thSCD1=BlockChangeThresh,thSCD2=Num_blocks_changed)

#Uncomment following line for troubleshooting. It puts the scene change threshold numbers on the screen.
#ScriptClip(source_fields,"Subtitle(String(AverageLuma(SceneChange ) ),align=5)")

#This line writes frame numbers to file. These can be imported into Vegas or other editor.
#Change "30" to some other number, based on what you find in ScriptClip above, but only if you have problems
WriteFileIf(source_fields,filename, "(AverageLuma(SceneChange)>30)" , "current_frame+1", flush=false)