Hello, everyone.
I'm struggling with adding clips to a new, if relevant, timeline, adding an specific offSet / exact location/frame for each clip.
- Code: Select all
censoring_data_elements = construct_censoring_frames_data(censoring_markers)
project.GetMediaPool().SetCurrentFolder(censoring_sub_folder)
media_pool.CreateTimelineFromClips("censoring", censoring_data_elements)
censoring data elements is a list of dictionaries with these keys:
- mediaPoolItem: <clipItem full data obtained through API pointing to an mp3 file>
- startFrame: 0
- endFrame: 20
Also tried adding keys like:
offSet, offset,OffSet, startOffset, start, and some more in order to set the clip in an specific timeline frame.
None of this worked. Also tried using AppendClipsToTimeline using similar approach but each item at a time.
Farther I got is creating a timeline with some concatenated clips at the beginning of it.
What would be the way to set the startTime in timeline for a clip? what would be a better approach that would avoid a user from adding them manually?Thanks!!
Extra info:
- Purpose: I'm using the source timeline's markers to get the frame where I want to add an audio censoring clip.
- Code will be released in GitHub if I manage this to work!
- Future improvement: using subtitle tracks looking for banned words to automatically add censorship