Kagami / ffmpeg.js

Port of FFmpeg with Emscripten
Other
3.24k stars 329 forks source link

HLS streaming with remote playlist #177

Closed MatteoBuffo closed 1 year ago

MatteoBuffo commented 2 years ago

Hi. My goal is to run the equivalent of this command:

ffmpeg -i "https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8" -c:a copy -c:v libx264 -f hls -hls_flags append_list ./out/master_playlist.m3u8

that is:

How may I achieve it?

Launching the ffmpeg -protocols produces:

Supported file protocols:
Input:
  file
Output:
  file

so I guess I should add the HTTP(S) protocols. I tried it by adding --enable-openssl / --enable-gnutls / --enable-libtls (one of them per time) in the FFMPEG_COMMON_ARGS in Makefile, then launched the Docker command, then cp -a /mnt/{.git,build,Makefile} . && source /root/emsdk/emsdk_env.sh && make && cp ffmpeg*.js /mnt. At a certain point of the make, it stops with:

ERROR: [openssl/gnutls/libtls] not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
make: *** [Makefile:191: build/ffmpeg-webm/ffmpeg.bc] Error 1

What to do now? I also tried to do apt-get install libssl-dev (for openssl) apt-get install libgnutls28-dev (for gnutls)

but it fails (the mirrors are probably broken). Tried both on Ubuntu 18.04 and Windows 10 (with the Docker container being Ubuntu 19.10). Any suggestion would be appreciated.

ozdoganoguzhan commented 1 year ago

Hello, I am trying to do the same thing. Did you manage to solve how to transcode a livestream? If so can you please tell me how?

MatteoBuffo commented 1 year ago

Hi @ozdoganoguzhan. After several tries, I eventually switched to a Java implementation via ffmpeg-cli-wrapper.

ozdoganoguzhan commented 1 year ago

Thank you for the fast response! I guess I'll look at other implementations aswell.