View Full Version : Q: Adding transition upon scene change ?
AnnaFan777
4th May 2008, 04:42
Adding transition on scene change.
Auto detect scene changes and apply transition effect,
say fade in/out (blend) on a few frames before and after every scene change.
The rest of frames are left untouched. Can this be achieved using only script ?
AFAIK, you can't access previous and next frames using only scripts, can you ?
,unless you open multiple video handle and trim ?
any thoughts?
nonsens112
4th May 2008, 10:21
It is possible to detect scene changes by MVMask and do some conditional blending. Previous and next frames can be accessed using Trim().
The problem is that transition effect in its classic form requires overlapping of last frames of previous scene and first frames of the next one, resulting in temporal shift of consecutive frames and, thus, global frame reordering. Of course, you cannot do such things automatically using only scripts.
gzarkadas
5th May 2008, 17:33
In principle, you can do it two-pass with two runtime scripts.
The first one will detect the scene changes and output in a file (with WriteFile (http://avisynth.org/mediawiki/WriteFile)) information about the frames (or range of frames) where the scene changes are. The format of the file should be compatible with ConditionalReader (http://avisynth.org/mediawiki/ConditionalReader) so that it will be easy to formulate the second script.
The second script will read, with ConditionalReader, the info file produced by the first script and apply the transitions where appropriate.
Having prepared the scripts and made them appropriately generic you can batch-script them to create a fully automated solution for mass production. See for example this thread (http://forum.doom9.org/showthread.php?t=131637); there are many more in the forums to be found with a search.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.