-
-
Notifications
You must be signed in to change notification settings - Fork 937
ffprobe.wasm #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@loretoparisi have you tried using https://github.com/alfg/ffprobe-wasm ? |
I'm currently working on a NodeJS project that needs |
You don't really need ffprobe to get the info. As long as we can get |
@goatandsheep I'm not sure that |
I was looking to get the "file checksum" for Audible AAX files and while it doesn't show up with Is there a way to get |
@captn3m0 thanks I will have a look at |
|
Any plan on support that? |
Recently I had a use case where I needed to perform a duration check on media files on the browser before uploading to the server. I'll put my approach here while I built my POC as it is somewhat related. Use case
ffprobe-wasm is not the full ffprobe program
What I ended up using
// Toy example
const maxSliceLength = Math.min(1024*1024*5, oFiles[nFileId].size);
const slicedData = oFiles[nFileId].slice(0, maxSliceLength);
(async () => {
ffmpeg.FS('writeFile', 'testfile', await fetchFile(slicedData));
await ffmpeg.run('-i', 'testfile', '-hide_banner');
ffmpeg.FS('unlink', 'testfile');
})();
Hopefully this write-up will benefit someone looking for a similar solution, or someone hoping to port ffprobe to wasm. |
@crazoter What amazing post! Thank you so much. Got thrilled at each paragraph for in the end discover this amazing mediainfo.js, which apparently suits perfect for my needs. I am very happy now! |
@crazoter Nice writeup! Thanks for checking out
I chose not to compile the FFprobe program, but instead to use libav directly to re-implement the functionality of FFprobe as an API via Wasm as an experiement, rather than the CLI through the browser. A different approach since you can interface with libavcodec and libavformat directly and provide minimal results. Though it's a bit more work to re-implement the full functionality of FFProbe, of course. |
Hi everyone! I created an npm package a few months back. Repo is here: https://github.com/tfoxy/ffprobe-wasm . It comes with TS definitions. I needed to use ffprobe in browser and Node.js so that I could read metadata without being affected by file size, so I tried to package the code at https://github.com/alfg/ffprobe-wasm so that it could be used as a library. The output tries to mimic the command
I don't know much about Emscripten or libavcodec/libavformat, so there are some properties that are missing. But hopefully this can be enough for some people. EDIT: @crazoter thanks for providing those alternatives. In one project I only need the duration, so that solution of using |
@tfoxy |
How is the progress of this issue? |
That's amazing! I was able to build and run the docker container and the application. But I'm struggling to import the generated module .
├── ffprobe-wasm.js
├── ffprobe-wasm.wasm
├── ffprobe-wasm.worker.js within NodeJS, In fact if I try to load the module as usal const Module = require('./ffprobe-wasm.js');
const versions = {
libavutil: Module.avutil_version(),
libavcodec: Module.avcodec_version(),
libavformat: Module.avformat_version(),
}; I get an |
So... any news? In my case, I need to get the exact timestamps of key frames (I-frames or whatever they're called). I was only able to find solution that requires ffprobe
There is a mention that ffmpeg can do something with key frames via command
but extracting, converting to JPEG, and then deleting thousands of files only because you need their file names seems silly to me. |
*Insert "Fine, I'll do it myself" picture* |
I got suuuuuper stuck on how to actually get data out of To actually get the JSON out you need to do something like this:
|
Is your feature request related to a problem? Please describe.
Implement
ffprobe
wasm version.Describe the solution you'd like
ffprobe
is the necessary companion offfmpeg
, needed to analyze media file before processing .Describe alternatives you've considered
In this simple case I'm using the command line
ffprobe
viaexecFile
to probe the fileor in this case to
seek
to position in the media file:Additional context
Probe media files before processing; seek to media position;
The text was updated successfully, but these errors were encountered: