+ for (const playlistFile of playlistFiles) {
+ const playlistPath = join(replayDirectory, playlistFile)
+ const { videoFileResolution, isPortraitMode } = await getVideoFileResolution(playlistPath)
+
+ // Playlist name is for example 3.m3u8
+ // Segments names are 3-0.ts 3-1.ts etc
+ const shouldStartWith = playlistFile.replace(/\.m3u8$/, '') + '-'
+
+ const segmentFiles = replayFiles.filter(f => f.startsWith(shouldStartWith) && f.endsWith('.ts'))
+
+ const outputPath = await generateHlsPlaylistFromTS({