Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A very simplistic approach can be:</p> <p><strong>(a)</strong> Create an automated process to extract the first and last frame of each video-clip in a known image format (e.g. JPG) and name them according to video-clip names, e.g. if you have the video clips:</p> <p>clipA.avi, clipB.avi, clipC.avi</p> <p>you may create the following frame-images:</p> <p>clipA_first.jpg, clipA_last.jpg, clipB_first.jpg, clipB_last.jpg, clipC_first.jpg, clipC_last.jpg</p> <p><strong>(b)</strong> The sorting "algorithm":</p> <pre><code>1. Create a 'Clips' list of Clip-Records containing each: (a) clip-name (string) (b) prev-clip-name (string) (c) prev-clip-diff (float) (d) next-clip-name (string) (e) next-clip-diff (float) 2. Apply the following processing: for Each ClipX having ClipX.next-clip-name == "" do: { ClipX.next-clip-diff = &lt;a big enough number&gt;; for Each ClipY having ClipY.prev-clip-name == "" do: { float ImageDif = ImageDif(ClipX.last-frame.jpg, ClipY.first_frame.jpg); if (ImageDif &lt; ClipX.next-clip-diff) { ClipX.next-clip-name = ClipY.clip-name; ClipX.next-clip-diff = ImageDif; } } Clips[ClipX.next-clip-name].prev-clip-name = ClipX.clip-name; Clips[ClipX.next-clip-name].prev-clip-diff = ClipX.next-clip-diff; } 3. Scan the Clips list to find the record(s) with no &lt;prev-clip-name&gt; or (if all records have a &lt;prev-clip-name&gt; find the record with the max &lt;prev-clip-dif&gt;. This is a good candidate(s) to be the first clip in sequence. 4. Begin from the clip(s) found in step (3) and rename the clip-files by adding a 5 digits number (00001, 00002, etc) at the beginning of its filename and going from aClip to aClip.next-clip-name and removing the clip from the list. 5. Repeat steps 3,4 until there are no clips in the list. 6. Voila! You have your sorted clips list in the form of sorted video filenames! ...or you may end up with more than one sorted lists (if you have enough 'time-gap' between your video clips). </code></pre> <p><strong>Very simplistic... but I think it can be effective...</strong></p> <p>PS1: Regarding the ImageDif() function: You can create a new <strong>DifImage</strong>, which is the difference of Images ClipX.last-frame.jpg, ClipY.first_frame.jpg and then then sum all pixels of <strong>DifImage</strong> to a single floating point <strong>ImageDif</strong> value. You can also optimize the process to abort the difference (or sum process) if your sum is bigger than some limit: You are actually interested in small differences. A <strong>ImageDif</strong> value which is larger than an (experimental) limit, means that the 2 images differs so much that the 2 clips cannot be one next each other.</p> <p>PS2: The sorting algorithm order of complexity must be approximately O(n*log(n)), therefore for 1000 video clips it will perform about 3000 image comparisons (or a little more if you optimize the algorithm and you allow it to not find a match for some clips)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload