mutaphore / RTSP-Client-Server

Implementation of a streaming video server and client that communicate using the Real-Time Streaming Protocol (RTSP) and send data using the Realtime Transfer Protocol (RTP)
522 stars 191 forks source link

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

Open chichunchen opened 6 years ago

chichunchen commented 6 years ago

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 commented 5 years ago

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 commented 4 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Hi I converted the file to mjpeg But,That I run go run converter.go in.mjpg out.mjpg I get the following message: There is a problem with "go" [image: WhatsApp Image 2020-11-01 at 18.12.42.jpeg]

בתאריך יום א׳, 1 בנוב׳ 2020, 17:00, מאת José Cleiton ‏< notifications@github.com>:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mutaphore/RTSP-Client-Server/issues/9#issuecomment-720101665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJMIRCUU2V5XTIHX5FRHTSNVZX3ANCNFSM4FG3X55Q .

sagivbonker commented 3 years ago

[image: WhatsApp Image 2020-11-01 at 18.28.51.jpeg]

‫בתאריך יום א׳, 1 בנוב׳ 2020 ב-18:14 מאת שגיב בונקר <‪sagiv928@gmail.com ‬‏>:‬

Hi I converted the file to mjpeg But,That I run go run converter.go in.mjpg out.mjpg I get the following message: There is a problem with "go" [image: WhatsApp Image 2020-11-01 at 18.12.42.jpeg]

בתאריך יום א׳, 1 בנוב׳ 2020, 17:00, מאת José Cleiton ‏< notifications@github.com>:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mutaphore/RTSP-Client-Server/issues/9#issuecomment-720101665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJMIRCUU2V5XTIHX5FRHTSNVZX3ANCNFSM4FG3X55Q .

sagivbonker commented 3 years ago

Hii I still have a problem

בתאריך יום א׳, 1 בנוב׳ 2020, 18:29, מאת שגיב בונקר ‏sagiv928@gmail.com:

[image: WhatsApp Image 2020-11-01 at 18.28.51.jpeg]

‫בתאריך יום א׳, 1 בנוב׳ 2020 ב-18:14 מאת שגיב בונקר <‪sagiv928@gmail.com ‬‏>:‬

Hi I converted the file to mjpeg But,That I run go run converter.go in.mjpg out.mjpg I get the following message: There is a problem with "go" [image: WhatsApp Image 2020-11-01 at 18.12.42.jpeg]

בתאריך יום א׳, 1 בנוב׳ 2020, 17:00, מאת José Cleiton ‏< notifications@github.com>:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mutaphore/RTSP-Client-Server/issues/9#issuecomment-720101665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJMIRCUU2V5XTIHX5FRHTSNVZX3ANCNFSM4FG3X55Q .

josecleiton commented 3 years ago

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 commented 3 years ago

hiI was trying to run the new code And I received the following message: I put the mjpeg file in the same folder

Thank you Sagiv

בתאריך יום ב׳, 2 בנוב׳ 2020, 22:54, מאת José Cleiton ‏< notifications@github.com>:

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

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mutaphore/RTSP-Client-Server/issues/9#issuecomment-720718849, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJMIUHYPHMEQOW6HA3WPDSN4MBHANCNFSM4FG3X55Q .

sagivbonker commented 3 years ago

Hi I was able to successfully perform the file conversion But in the code:https://github.com/mutaphore/RTSP-Client-Server The video runs for 2 seconds and stops what can we do ? Do you know what the problem is?

thank you very much Sagiv

‫בתאריך יום ב׳, 2 בנוב׳ 2020 ב-22:54 מאת ‪José Cleiton‬‏ <‪ notifications@github.com‬‏>:‬

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

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mutaphore/RTSP-Client-Server/issues/9#issuecomment-720718849, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJMIUHYPHMEQOW6HA3WPDSN4MBHANCNFSM4FG3X55Q .