23

I need t create a web app that will utilize ffmpeg for compositing , converting video sources. I cam across videoConverter.js. https://bgrins.github.io/videoconverter.js/

Does anyone know of any other options? Can I use a C# solution?

Bachalo
  • 6,965
  • 27
  • 95
  • 189
  • There is absolutely no way you can run FFmpeg in the browser. Even with emscripten, most of the libraries don't even run in the browser. C# doesn't run in the browser either. Are you absolutely sure you must run things in the browser? Why can't you pass it off to a server to do the work? And if not, why must you use FFmpeg? – Brad Jan 22 '15 at 22:04
  • 'absolutely no way you can run FFmpeg in the browser. Even with emscripten'...Have you checked out the videoconverter.js library? – Bachalo Jan 23 '15 at 01:50
  • I have, and while it is a really great experiment, it isn't going to work for production use. I should clarify what I'm getting at... What you're asking for is something that you will use for a real project, correct? If that's true then you will find very quickly that the speed of something like FFmpeg compiled to JavaScript isn't going to work. Depending on what parts you're using, you will also find some libraries and codecs missing. Even if you use their demos, you will see what I'm talking about. A native codec is far faster. – Brad Jan 23 '15 at 03:18
  • If you could elaborate more on what it is you're trying to do (and why you believe FFmpeg is the only solution for you), then maybe we could help you find another way. For compositing, the canvas can be very flexible. Converting.... from what to what and for what purpose? – Brad Jan 23 '15 at 03:20
  • 1
    Time goes on, and WebAssembly gets in, so I believe there will be a game-changer converter later. – DaWe Dec 03 '19 at 00:05

3 Answers3

24

5 years later, actually you can run ffmpeg inside the browser.

Check out https://github.com/ffmpegwasm/ffmpeg.wasm

"ffmpeg.wasm is a pure Webassembly / Javascript port of FFmpeg. It enables video & audio record, convert and stream right inside browsers."

Dumi Jay
  • 1,057
  • 10
  • 10
2

You are going to have a tough time running something like that directly in the browser - and even if you did it would require a lot of code. I would suggest building a small web application that lives on a server that will take a media file as a parameter along with any configuration options that you want to pass along with it and let ffmpeg do the hard work on the server without having to recreate the wheel then return the modified media file. I've done something similar and it works great and in the end is a very small, lightweight application.

Max Worg
  • 2,932
  • 2
  • 20
  • 35
  • 1
    but what about the server ?? if your application user is more than 1000K ? then i think it take so many load on server so at that time we need it from client side. so how to use ffmpeg ain browser or as js. – kunal shaktawat Jun 30 '20 at 19:41
-2

Here is yet another inspiration: https://ffmpeg.wide.video/ FFmpeg in browser lets you encode, decode, and manipulate videos right in your web browser. Define custom args or use predefined templates, load files directly from your filesystem - no upload needed!

Yoz
  • 707
  • 6
  • 20