if (!audioStream) return ''
const audioCodec = audioStream.codec_name
- if (audioCodec.codec_name === 'aac') return 'mp4a.40.2'
+ if (audioCodec === 'aac') return 'mp4a.40.2'
logger.warn('Cannot get audio codec of %s.', path, { audioStream })
let line = `#EXT-X-STREAM-INF:${bandwidth},${resolution}`
if (file.fps) line += ',FRAME-RATE=' + file.fps
- const audioCodec = await getAudioStreamCodec(filePlaylistPath)
- const videoCodec = await getVideoStreamCodec(filePlaylistPath)
+ const audioCodec = await getAudioStreamCodec(videoFilePath)
+ const videoCodec = await getVideoStreamCodec(videoFilePath)
line += `,CODECS="${videoCodec},${audioCodec}"`
masterPlaylists.push(line)
await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile)
- const updatedVideoFile = await newVideoFile.save()
-
+ await newVideoFile.save()
videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles') as VideoFileModel[]
- videoStreamingPlaylist.VideoFiles.push(updatedVideoFile)
video.setHLSPlaylist(videoStreamingPlaylist)