Windows Store app, Is it any way to find Video Duration from Storage File? Other that getting duration from Media Elemen
By : Vijay Kumar
Date : March 29 2020, 07:55 AM
|
Get video duration when input a video file
By : blue blazes
Date : March 29 2020, 07:55 AM
|
How to get duration of video when I am using filereader to read the video file?
By : user3596363
Date : March 29 2020, 07:55 AM
will help you You can do something like this for that to work: read the file as ArrayBuffer (this can be posted directly to server as a binary stream later) wrap it in a Blob object create an object URL for the blob and finally set the url as the video source. code :
var fileEl = document.querySelector("input");
fileEl.onchange = function(e) {
var file = e.target.files[0], // selected file
mime = file.type, // store mime for later
rd = new FileReader(); // create a FileReader
rd.onload = function(e) { // when file has read:
var blob = new Blob([e.target.result], {type: mime}), // create a blob of buffer
url = (URL || webkitURL).createObjectURL(blob), // create o-URL of blob
video = document.createElement("video"); // create video element
video.preload = "metadata"; // preload setting
video.addEventListener("loadedmetadata", function() { // when enough data loads
document.querySelector("div")
.innerHTML = "Duration: " + video.duration + "s"; // show duration
(URL || webkitURL).revokeObjectURL(url); // clean up
// ... continue from here ...
});
video.src = url; // start video load
};
rd.readAsArrayBuffer(file); // read file object
};
<input type="file"><br><div></div>
|
how to get video file duration in C#
By : user3795708
Date : March 29 2020, 07:55 AM
I hope this helps you . Quick and dirty way with ffmpeg: run ffmpeg -i "c:\ds.mpeg" and parse the output.
|
How to get duration of a video file?
By : Srinivasa Rao
Date : March 29 2020, 07:55 AM
may help you . I'm a beginner in Android programming. , Use MediaMetadataRetriever to retrieve media specific data:
|