How to enable HTTPS protocol in ffmpeg.wasm?

Viewed 236

I am using ffmpeg.wasm, I have referenced this link (https://github.com/ffmpegwasm/ffmpeg.wasm). In my code: await ffmpeg.run("-protocols"), it only shows HTTP protocol, not HTTPS protocol. But when I ran ffmpeg -protocols command manually on the command line, it shows both HTTP and HTTPS. How to enable HTTPS protocol in ffmpeg.wasm? I tried to recompile ffmpeg.wasm-core to enable HTTPS protocol based on these links (ffmpeg over https fails and https://github.com/ffmpegwasm/ffmpeg.wasm-core) but I got error in this image: https://user-images.githubusercontent.com/37976868/148655326-b6d25c87-0416-4524-a749-9f369893fa9c.png. Please help me enable HTTPS protocol in ffmpeg.wasm

1 Answers

Unfortunately, ffmpeg.wasm does not support https connection. Actually emscripten changes socket connection to websocket connection to connect to server (obviously server side needs to offer SSL websocket API for connection). So, there is no sense to rebuild ffmpeg.wasm with openssl. The walkaround is to change source url protocol with http connection in ffmpeg.run command, and modify ffmpeg-core.js to use secured websocket url, wss://....

Related