-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support Web Platform #4
Comments
Hi guys and girls, Some developers requested a Web support for FFmpeg. (Specially on Flutter FFmpeg, but I post here because the question is more general than just flutter). Today I was almost ready to work on this task, but I am realizing that I do not understand the needs and so, I cannot do something useful. In fact, I have not a clear understanding of what must be done :
Please, confirm that you need this feature and for what reason. |
OK, Guys & Girls, if the goal is really to be able to use FFmpeg in a Javascript code (and not for Electron or Cordova),
To start, I will create just a |
Hello, For my case, I have a back office of our app "evolum" where we upload audio. For now, I found a solution to get the duration with the package just_audio. ` static Future getEvoSize(Evo evo) async {
}` It's work on mobile but with phone I have CORS problem... so for now internal user have to check the size and write it mannual so sometimes there is mistake .... |
A good use-case, thanks for sharing @yelkamel |
Thank you @yelkamel for your post. Having to download the data to create a temporary file in memory is not convenient.
Example in Javascript (in Dart it will be very similar) : await FFmpegKitConfig.createTemporaryFile( 'https://evolum.s3.eu-west-3.amazonaws.com/filename', 'file1.mp4');
FFmpegKit.executeAsync
(
'-i file1.mp4 -c:v mpeg4 file2.mp4',
async (session) =>
{
aTemporaryURL = await session.createTemporaryURL(file2.mp4);
// Do something with `aTemporaryURL`, like play it with τ Sound
}
); If the App just wants to get the duration (like @yelkamel), it would be very much simpler if he/she only need to give the URL without having to process temporary files: FFprobeKit.getMediaInformationAsync
(
'https://evolum.s3.eu-west-3.amazonaws.com/filename',
async (session) =>
{
const information = await session.getMediaInformation();
}
); |
You asked for use cases. We need audio from users for transcribe on the web. If they choose a video, we need to extract the audio first by using this library. |
You asked for use cases: clip an audio file between two given timestamps, with a precision of a millisecond (basic web API fails for this level of precision) |
@Larpoux what is the |
@tanersener @Larpoux Any updates on this? I'm willing to contribute because I also need the web support asap for my project. |
I am sorry but I am not a Web expert. But a web app can create and read a temporary memory object that can be accessed using a regular URL (something like "memory://foo.bla". Perhaps ffmpeg-kit should work on these temporary objects. This is what I did for Flutter Sound on Web. But in fine (this is Latin 😁) the users who need ffmeg-kit knows better than me what they need. Note : temporary File System can be emulated in memory by WASM. The problem to define a good API is certainly the real challenge. The work itself is probably just a compilation of ffmpeg to WASM code. |
I've posted the same answer in this issue https://github.com/tanersener/ffmpeg-kit/issues/8 but I think it belongs here: I've looked into the web implementation first for CHROME extensions. The option I came across was using ffmpeg in WASM. Unfortunately, Manifest V3.0 brings a lot of issues. With Manifest V2.0 you can get it working but it will stop working in January 2023 in Chrome, so this won't be worth the effort to implement. To port it to Manifest V3, the code will need to be placed in a worker which doesn't have access to the DOM (document). Also, it can't be published on Chrome Store due to Manifest V2. I haven't found an alternative yet to create an implementation for the web, it looks like this will be a pain in the ass |
Don't manifests only matter for chrome extensions? |
Yes, I've edited my answer. I was looking for an implementation that is also supported when it's a chrome extension. |
Thanks for the update. Does this mean that a web application living on |
Is Web support still something you are working on? |
Fireship has a great video on this topic: https://www.youtube.com/watch?v=-OTc0Ki7Sv0 Here is the source code: |
I guess we could just merge https://pub.dev/packages/ffmpeg_wasm with this package to support web? |
I was the one who updated the ffmpeg_wasm Dart library (redleafsofts/flutter_ffmpeg_wasm#1). Initially, I considered writing some Dart wrappers around it, but that would only benefit the Flutter |
Hey guys, has there been any progress on this? Would be ideal for Expo / React Native :) |
No progress yet |
I´m trying to intergrate it the other way, doing a Expo module that uses ffmpeg-kit for native and ffmpeg_wasm for the web. Unfortunately ffmpeg_wasm with it´s service worker is quite tricky to get working on expo as the file paths of the component are rewritten by expo-router and a couple of other issues... |
Provide scripts for a WASM based implementation.
Do no publish binaries if it is not possible to prevent end-users using them on their devices directly. That can create legal problems for us (maintainers).
The text was updated successfully, but these errors were encountered: