Page 1 of 1

MJPEG stream to h.264 stream?

Posted: 19 Jan 2017 08:42
by waterbug
Hi! I've built a weatherproof (?) BeeCam from a Raspberry Pi board running MotionEye, and it outputs an 800 x 600 x 30 fps MJPEG stream over http at about 40 Mbps. The Pi doesn't have enough CPU to compress it down to h.264 at an acceptable frame rate, and I don't want to serve 40 Mbps to the public.

So I though I'd use a spare Mac running VLC to read the MJPEG stream, transcode it to h.264, and stream it back out over http, and then offer that to the public at around 1 Mbps per stream.

I think VLC should be able to do this, too, but I can't figure out to get it done without it crashing. I can do each of the parts separately, but when I try to put it all together, it crashes:
  1. It can read and play the MJPEG stream
  2. It can open an MP4 file or AVI file and transcode and stream in either h.264 or MJPEG, which I can then view in another instance of VLC on the same computer or another computer.
  3. It can open an h.264 stream or an MJPEG stream and re-stream that video without transcoding, which I can then view on another computer or from my iPhone.
  4. I can connect 2 clients to an output stream.
So at one point I had Mac #1 reading an MP4 file and transcoding it to an MJPEG stream that I read on Mac #2 and streamed back out to my iPhone, and all 3 screens were showing the same video.

So it can read in and output all the formats I want, and it can re-stream a stream. But it can't re-stream a stream while transcoding it without crashing immediately. I've tried a bunch of different output formats, and they all crashed the same way.

I get the same crash running VLC on OS X and on Windows, so it looks like a core VLC problem. Both platforms were running the latest release, 2.2.4.

Am I missing a key step? I'm doing this all from the GUI, using Advanced Open File or Open Network and then turning on the streaming options.

Thanks!

Re: MJPEG stream to h.264 stream?

Posted: 13 Nov 2020 20:38
by hackeron
Anyone?

Re: MJPEG stream to h.264 stream?

Posted: 13 Nov 2020 21:27
by waterbug
I never was able to get this working via VLC, but I was able to get ffmpeg installed on my Pi to grab the RTSP stream and push it to YouTube.

So it's not an answer to this particular problem, but it's an alternate solution.