PDA

View Full Version : Find credits range via avisynth ?


TaZ4hvn
8th June 2003, 01:57
Is there any way to find credits range of a movie with an avisynth script ?
Perhaps something based on average luma distibution for instance ?
Assuming credits are white characters on black screen, one can search for frames where pixs with 40<luma<220 are near zero for instance and retaining the longest block of them as beeing the credits range. Would it be reliable ?
Really I'm very confused at how this can be achieved :(

Thanks for your help.

WarpEnterprises
8th June 2003, 22:16
such functions (finding credits, ads,...) would be quite slow and unreliable too (the whole video would be read)

Awatef
8th June 2003, 22:48
Does it bother you to make it manually?!

make a normal avs, open it in VirtualDub, see on which frame the credits begin

Return to your avs file, add a trim line just after the mpeg2source line, kinda:

trim(0,150500)

Encode the credits separately at a fixed quantizer like 12. To do that, make another avs script with the following trim line, kinda:

trim(150501,0)

TaZ4hvn
9th June 2003, 01:06
Thanks but I know how to encode credits manually :D
If you follow links in my signature you'll find I'm writing a all in one app so that such a feature would be great.
Actually I solved much much problems and tool is functionnal, but such a feature would a valuable add :)

regards

soulfx
9th June 2003, 02:13
There should be a way to figure out a script based on the new conditional functions. I don't have the slightest clue as to how to get started though.

Prettz
9th June 2003, 05:00
Originally posted by TaZ4hvn
Thanks but I know how to encode credits manually :D
If you follow links in my signature you'll find I'm writing a all in one app so that such a feature would be great.
Actually I solved much much problems and tool is functionnal, but such a feature would a valuable add :)

regards
It takes all of 10 seconds for a human to be able to find the credits, so why not just have a field where the user enters the frame range for the credits? If your tool doesn't directly allow the user to scan through the video, just have it tell them to open the video in vdub.

I don't think there is any way to determine automatically where the credits are (and I KNOW there isn't in movies where the credits start rolling, or just appearing 1 at a time, before the "video" of the movie ends). If there was an algorithm that could do this, it would take several hours to scan a whole movie I'm sure. And if you were to have the user enter a frame number to start the search at, why not just ask for the credits' frame number itself?

TaZ4hvn
9th June 2003, 07:33
If there was an algorithm that could do this, it would take several hours to scan a whole movie I'm sure.

That's what I feared to hear :( I'm confident you're right, but I don't give up yet.
What do you think of simply using last chapter start as credits start ? Pretty fast at least !
I can perform comp test and/or luma test for the last chapters to find if there's a gap somewhere ...

WarpEnterprises
9th June 2003, 09:57
If you can assume a min credit length scanning would be MUCH faster (scan only every 25th frame e.g.)
Possible algo as you proposed (black and white with a sharp histogram e.g.)

bilu
9th June 2003, 11:04
Algorithm would have to find vertical scrolling frames with very few colours... of course a Star Wars intro would be considered a credit then :D


Bilu

TaZ4hvn
9th June 2003, 12:24
@bilu:

Glad to see you left your cave to rejoin men's world :D

Algorithm would have to find vertical scrolling frames with very few colours

perhaps, do you have the slightest idea how this can be achieved ?

of course a Star Wars intro would be considered a credit then

That's not a problem, avoiding certain frames, like intro, to be treated is quite easy :)

@WarpEnterprises:

Of course that's the plan, do several search, for instance first 1500 frames over the whole movie (or the last chapters), then 25 (over the 1500 segment where changes occurs), then 1 (over the 25 segment). This way it can be reasonnably fast. But yet I don't have any clue to start with. Is some piece of script to start with in your mind ?

bilu
9th June 2003, 12:40
Originally posted by TaZ4hvn
@bilu:

Glad to see you left your cave to rejoin men's world :D


Geez, I've been in vacations last week :)

But still I've been around as you can see:

Approach to automatic decombing?
http://forum.doom9.org/showthread.php?s=&threadid=55148

For those using DebugView
http://forum.doom9.org/showthread.php?s=&threadid=55149

Need command-line tools that report clip length
http://forum.doom9.org/showthread.php?s=&threadid=54897


Originally posted by TaZ4hvn
perhaps, do you have the slightest idea how this can be achieved ?



Nope :rolleyes: , maybe a filter with borrowed code from XVID's GMC to detect vertical panning but I'm sure there are better ways.



Bilu