Here are the properties I'm trying to access:
I've looked at mediainfo.js (https://github.com/buzz/mediainfo.js?files=1) and honestly I'm not able to figure it out.
I've also seen people mention that it's possible to use 'media info' (https://mediaarea.net/en/MediaInfo) CLI to accomplish this but I can't find any instruction on how to accomplish this.
I've also tried utilising wmic like so:
var exec = require('child_process').exec
exec('wmic datafile where name="C:\\\\some_path\\\\MyTestCourse\\\\test_conversion\\\\testProject001\\\\videos\\\\video0.webm" get NaturalVideoWidth ', function(err, stdout, stderr){
if(!err){
console.log(stdout)
};
});
but I don't think it can access what I'm looking for.
I need to be able to run this in a terminal as part of a batch conversion of videos I'm doing. I'm using nodejs and a batch file to accomplish this.
I'd greatly appreciate any insight or advice.
Here's a working (work on my machine™️) script in Node.js. Hope it helps. I use the test video from https://www.webmfiles.org/demo-files/
And the raw output from
mediainfo
looks like below, expand snippet to inspect.