Raspberry Pi – How to record an mjpeg stream from a Raspberry Pi Zero using Windows

  linux, raspberry-pi

Get the Windows binaries – ex: https://ffmpeg.zeranoe.com/builds/ -> download 

ex: https://ffmpeg.zeranoe.com/builds/win32/shared/

Unzip it, add the path of ffmpeg to your PATH variable, start command prompt, test that ffmpeg works, ex: ffmpeg –help

To grab your stream from an already running camera, make sure the entire url works, i.e. don’t just use /stream, use /stream/video.mjpeg

ffmpeg -f mjpeg -i http://10.1.10.52:8080/stream/video.mjpeg -vcodec mpeg4 -an stream.mp4

Control + C to stop.

There’s your video.

Tweak the settings to a higher quality video, etc.

Disable audio using -an, and record only at 20 fps:

ffmpeg -re -f mjpeg -i http://10.1.10.52:8080/stream/video.mjpeg -an -r 20 stream.mp4

Copy the stream directly as-is, at the maximum frame rate, using -vcodec copy

ffmpeg -re -f mjpeg -i http://10.1.10.52:8080/stream/video.mjpeg -vcodec copy -an stream.mp4