mutaphore/RTSP-Client-Server

How to create the Mjpeg video with frame length?

chichunchen opened this issue · 10 comments

I want to try specify other video and I use FFmpeg to convert a .mp4 file to .mpeg using
ffmpeg -i rhino.mp4 -c:v mjpeg -q:v 3 -huffman optimal -an output.Mjpeg, however, this command do not specify the frame length in the first five bytes. So my problem is that how do you create the Mjpeg with the frame length, thanks!

The standard Mjpeg frame length might be different, for example this page says frame length is 11 http://www.cajunbot.com/wiki/images/7/71/USB_Video_Payload_MJPEG_1.1.pdf. May have to try different values of the frame length to get it to play.

I've created a help program to convert mjpeg into mjpeg with 5 bytes frame length prefix. Here

go run converter.go in.mjpg out.mjpg

hi
You used a Mjpeg file in your project.
I can not find such a file on the Internet.
Also, is it possible to transmit an MP4 file?
I would be happy if you can send me some Mjpeg files for streaming .
How can I find a mjpeg file?

Thank you very much!

hi
You used a Mjpeg file in your project.
I can not find such a file on the Internet.
Also, is it possible to transmit an MP4 file?
I would be happy if you can send me some Mjpeg files for streaming .
How can I find a mjpeg file?

Thank you very much!

You need to convert mp4 to mjpeg (using ffmpeg) then convert from modern mjpeg to 5-length mjpeg.

The util that i've linked expects an regular video and convert it to mjpeg and to 5-length mjpeg
Down here is another one that only convert standard mjpeg to 5-length

https://gist.github.com/josecleiton/336e4fd317aa39629b76915cb8ce45c5