Quickly create draft clips

  1. Implementation principle: JianYingPro project files are
    stored in the form of json, only need to create draft_content.json, draft_mate_info.json will be automatically completed after opening the software.
  2. Add a piece of media to the track order Draft Library -> Content Library -> Track Clips
  3. add_media_to_track will identify the media type and add it to the corresponding track.
  4. When there is no video track, creating an audio track will create a video track first.
if __name__ == "__main__":
    # 新建草稿
    draft = Draft("测试草稿") 
    # 将媒体转化为草稿素材
    audio = Material("D:/Music/Krubb Wenkroist - Bleach.mp3")
    # 将媒体添加到轨道中
    draft.add_media_to_track(audio)
    draft.add_media_to_track('D:/Videos/剪印导出/测试1(1).mp4')
    # 保存草稿
    draft.save()

insert image description here

init.py

import os
import time
import util
import template
from material import Material
from track import Tracks

class Draft:

    drafts_folder = "D:/JianyingPro Drafts"
    template_folder = &#

Guess you like

Origin blog.csdn.net/u012743772/article/details/131600180