no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / db / note
1   during toc scan,
2     acquire video thumbnail for each position
3     transform video_thumbnail to media frame_key
4     mark frames which exist in video_frames
5   foreach frame in toc,
6     find next marked frame
7     acquire video thumbnail for mark position
8     transform video_thumbnail to media frame_key
9     find frame_key in video_frames giving video_frame_id
10     best = bad -- for every commercial using this frame
11     foreach clip_set in timelines matching (video_frame_id)
12       score = 0 -- for every frame in the commercial
13       foreach timeline_sequence matching (clip_set_id, seq_no++)
14         acquire video frame (now-offset)
15         transform video_thumbnail to media frame_key
16         access video_frame(video_frame_id);
17         compute error frame_key against video_frame(frame_key)
18         add error to score
19         if score > best then break
20       done
21       if score < best score then best = score
22     done
23     if best is bad then exit
24     perform action for best match
25     reset position past match
26   done
27
28   during playback,
29     while normal playback
30       acquire video thumbnail for current position
31       transform video_thumbnail to media frame_key
32       find frame_key in video_frames giving video_frame_id
33       if found, playback = commercial
34     save clip_set,seq_no and start_offset of timelines matching (video_frame_id)
35       perform highest priority action for matching clip_set
36     playtime = 0
37     while commercial playback
38       acquire video thumbnail for next position
39       transform video_thumbnail to media frame_key
40       find frame_key in video_frames giving video_frame_id
41       playback = normal
42       if not found : break
43       foreach timelines matching video_frame_id
44         search saved clip_set for time_line clip_set_id
45         if not found : continue
46         if( time_line sequence_no != saved ++seq_no )
47           delete saved clip_set, empty save set : break
48           continue
49         access timeline_sequence(clip_set(i),++seq_no(i)) giving next_time_line
50         if( next_time_line.offset-start_offset(i) == playtime ) playback = commerial, break