Call ffmpeg in batches

This commit is contained in:
Deluan 2020-06-11 17:36:09 -04:00 committed by Deluan Quintão
parent 6a3dabbb06
commit 3190611ec8
4 changed files with 75 additions and 36 deletions

View file

@ -38,3 +38,17 @@ func MoveString(array []string, srcIndex int, dstIndex int) []string {
value := array[srcIndex]
return InsertString(RemoveString(array, srcIndex), value, dstIndex)
}
func BreakUpStringSlice(mediaFileIds []string, chunkSize int) [][]string {
numTracks := len(mediaFileIds)
var chunks [][]string
for i := 0; i < numTracks; i += chunkSize {
end := i + chunkSize
if end > numTracks {
end = numTracks
}
chunks = append(chunks, mediaFileIds[i:end])
}
return chunks
}