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

How to create the Mjpeg video with frame length? #9

Open
chichunchen opened this issue Jun 25, 2018 · 10 comments
Open

How to create the Mjpeg video with frame length? #9

chichunchen opened this issue Jun 25, 2018 · 10 comments

Comments

@chichunchen
Copy link

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!

@mutaphore
Copy link
Owner

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.

@josecleiton
Copy link

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

@sagivbonker
Copy link

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!

@josecleiton
Copy link

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.

@sagivbonker
Copy link

sagivbonker commented Nov 1, 2020 via email

@sagivbonker
Copy link

sagivbonker commented Nov 1, 2020 via email

@sagivbonker
Copy link

sagivbonker commented Nov 2, 2020 via email

@josecleiton
Copy link

josecleiton commented Nov 2, 2020

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

@sagivbonker
Copy link

sagivbonker commented Nov 3, 2020 via email

@sagivbonker
Copy link

sagivbonker commented Nov 6, 2020 via email

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

4 participants