Skip to content

Commit

Permalink
doc : add comment for getVideoDurations (foyzulkarim#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
aninda052 committed Aug 3, 2023
1 parent 979e041 commit d3ec0ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/src/modules/queues/video-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ const processMp4ToHls = async (filePath, outputFolder, jobData) => {
};

const getVideoDurations = (filePath) => {


// if any error occour return 0.0 second as default video duration
// else return video durations
return new Promise((resolve,reject) => {
let durations = 0.0
ffmpeg.ffprobe(filePath, function(err, metadata) {
// getting video durations in second
if(!err){
durations = metadata.format.duration
}
Expand All @@ -122,4 +125,4 @@ const getVideoDurations = (filePath) => {
}


module.exports = { processRawFileToMp4, processMp4ToHls, generateThumbnail, getVideoDurations };
module.exports = { processRawFileToMp4, processMp4ToHls, generateThumbnail, getVideoDurations };

0 comments on commit d3ec0ee

Please sign in to comment.