I have an RPI camera module V2 connected to my PI and can stream footage from it into the lan with

raspivid -vf -hf -o - -t 0 -w 1000 -h 576 -fps 20 -b 500000 | cvlc -vvv stream:///dev/stdin --sout '#rtp{access=udp,sdp=rtsp://:8554/stream}' :demux=h264

The problem is that I cannot use this stream in the linux Motion software, since it requires for the video stream to be in an MJPEG format. How can I change the command above, so it streams in MJPEG?

The vlc manual page says to use a value vcodec=MJPEG, but playing around with it and trying to put it in various places, I never got it to work.

To be more precise, I need the stream in a format which will work with various IP camera management softwares, such as Blue Iris.


  • 1
    Though, I've seen mention that raspivid has "mjpeg goodness" built in ... i.e. raspivid --codec MJPEG ... – Jaromanda X Jun 4 '18 at 0:10
  • I have already encountered and tried that result you posted but I couldnt get it to work (i tried many variations with the transcode and such), I am thinking that I am formatting the command wrongly, so I need someone who knows more about vlc than I to post the corrected command. – Askerman Jun 4 '18 at 6:53
  • As for the raspivid --codec MJEPG, it is the same problem, I don't know how to implement it into the command above for it to actually work. If i just add the parameter --codec MJEPG -vf -hf ... after raspivid then it doesnt work – Askerman Jun 4 '18 at 6:55
  • 1) "it doesnt work" please add the full error message. 2) "how to implement it into the command" like JaromandaX wrote: add the parameter --codec and its value MJPEG after the command raspivid. 3) To get verbose information during run, add --verbose. Try raspivid --codec MJPEG --verbose -vf -hf -o - -t 0 -w 1000 -h 576 -fps 20 -b 500000 | cvlc -vvv stream:///dev/stdin --sout '#rtp{access=udp,sdp=rtsp://:8554/stream}' :demux=h264. Please post the result. Maybe helpful: raspivid --help and raspberrypi.org/documentation/raspbian/applications/camera.md – Fabian Jun 9 '18 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.