Skip to content
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

Is this a replacement for ffserver? #14

Open
RobLewis opened this issue Dec 26, 2018 · 4 comments
Open

Is this a replacement for ffserver? #14

RobLewis opened this issue Dec 26, 2018 · 4 comments

Comments

@RobLewis
Copy link

I'm trying to set up ffmpeg on a Raspberry Pi 3B+ to record 2 USB webcams (/dev/video0 and /dev/video1) to disk and simultaneously stream them live to connected web browsers (presumably using <video> elements). ffserver sounds like what I need, except it appears to be discontinued. Can mkvserver_mk2 do this? How would I set it up?
I'm wondering why ffserver is no longer offered, as it seems like it filled a common need.

@klaxa
Copy link
Owner

klaxa commented Dec 26, 2018

Hi, ffserver was removed because it was unmaintained. This project was used as a basis for a replacement for ffserver. A new repository called ffserver is present on my profile, however, there is still a crucial (memory-leak) bug I have not been able to fix. Furthermore, embedding matroska in websites is still not possible (or is it?). You may be able to alter the source to produce webm instead of matroska and try with that. Be aware that using webm may require re-encoding which is explicitly not supported by my server implementations. This step should be done before feeding the video to the server.

I hope that clears up your questions. Sadly video-streaming is not a trivial problem and simple solutions are rare if not non-existent. :)

@RobLewis
Copy link
Author

Thanks very much. Can you describe the memory leak further? It might be tolerable in my application. As for re-encoding the video, can't I just have ffmpeg encode the raw video from the cameras as webm? I'm seeing conflicting information online, but some are saying Chrome plays matroska fine, others say you can "fool" it by setting the type to webm.

@klaxa
Copy link
Owner

klaxa commented Dec 27, 2018

The leak is due to libmicrohttpd's callbacks being called at a point where some data is still needed from the http-client-struct. I'd have to take a much deeper look again to find out how my high-level streaming-client is coupled to the low-level http-client. The file you would be looking at is lmhttpd.c in https://github.com/klaxa/ffserver/ . It is also described in the first issue of the repository.

Yes, you can simply use ffmpeg to encode to webm compatible codecs.

Maybe Chrome/Chromium can play matroska these days, maybe you can even fool it by saying it's webm when it's really matroska, I have no idea about that.

Good luck with your project :)

@milad2golnia
Copy link

milad2golnia commented Aug 4, 2019

thank youuuuuuuuuuuuu very much.
chromium can play matroska
for other format act shuch as below to have your own live stream on browser:

  1. if your video's format is matroska then run the server simply: ./server video.m4v
  2. if your video's format is not matroska (e.g. it's m4v) then run below commands:
    ffmpeg -i video.m4v -f matroska video.mkv
    ./server video.m4v
    this solution solved my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants