I'm looking for a way to determine the video codec of videos the user uploads on the react frontend(app written in ts); so far this is what I tried doing:
var probe = require('ffprobe');
for (let i1 = 0; i1 < files.length; i1++) {
if (files[i1].type.split("/")[0] === "video"){
probe(files[i1], function(err: Error, probeData: any)
{
if(probeData.streams[0].codec_name === 'h265'){
videosToTranscode.push(files[i1]);
}
});
}
}
if(videosToTranscode === undefined || videosToTranscode.length == 0){
transcodeVideos(videosToTranscode);
}
The problem is that I'm greeted with the following message : "./node_modules/node-ffprobe/lib/ffprobe.js:1:0 Module not found: Can't resolve 'child_process'"
My understanding is child_process is integrated in the browser; so I'm guessing I'm doing something wrong with the require statement ? If I create a project, without react, in the same vein with fluent-ffmpeg and probe a video url herewith I don't have that problem.
Any clues ?