MCPcopy Create free account
hub / github.com/diffgram/diffgram / split_video

Method split_video

walrus/methods/video/video_preprocess.py:43–80  ·  view source on GitHub ↗

Create input id upfront so we can save to matching folder then trigger processing deferred after upload is complete?

(self)

Source from the content-addressed store, hash-verified

41 self.do_upload = True # ie set to False to skip upload for testing
42
43 def split_video(self):
44 """
45 Create input id upfront so we can save to matching folder
46 then trigger processing deferred after upload is complete?
47 """
48
49 # ie in this case it's a "known" thing so it should
50 # be able to use our own app engine download operation...
51
52 self.offset_in_seconds: int = 0
53
54 # TODO handle "last" case if that matters? or does ffmpeg handle
55 # if endtime > video time
56 # Do we actually need to know the duration in advance
57 # Can we just loop till exception?
58 """
59
60 We make assumptions that small files will return False
61 so we will usually stop early
62
63 This assumption is baed on file size, see notes in self.split
64
65 The number of times we run this is a "magic" number of sorts
66 200 means a 3 hour video with 60 seconds per split for example.
67
68 """
69 logger.info("Running Split")
70
71 for i in range(200):
72 # magic number of "cap" to number of clips here
73 result = self.split(i)
74 if result is False:
75 break
76
77 # For now success compelte just means it has split the clips...
78
79 self.parent_input.status = "success"
80 self.parent_input.percent_complete = 100
81
82 def check_ok_to_split(self):
83 """

Callers 1

Calls 1

splitMethod · 0.95

Tested by

no test coverage detected