VLC and MJPEG stream decoding (invalid header)

I am making a WinRT application that includes streaming video. Now I ended up in VLC as a streaming server and MJPEGDecoder lib ( http://mjpeg.codeplex.com/ ) on the client to decode the video.

But after creating the HTTP stream and connecting to it from the client, MJPEGDecoder says that the header is invalid (it expects a multi-line stream). VLC-to-VLC is working fine.

Question 1: how can it be fixed?

Question 2: what are the alternatives for creating video streaming for WinRT?

+2
source share
2 answers

Just to tell you more about your question / answer. The published answer refers only to the example, but does not explain it, niether does the example itself. So I would like to complete this answer if someone else stumbles upon it.

When you determined the vlc stream that you forgot to share with your question, most likely you did not specify any parameters from the http access parameter and had a standard vlc module. (just like I did when I came across the same problem)

standard{access=http,mux=mpjpeg,dst=< address >:< port >/< path >} 

You use VLC to create the mjpeg stream transmitted over http. Thanks osgx to answer in another question , here is the wikipedia link describing MPJEG over HTTP . Mostly:

M-JPEG via HTTP informs the client using a special type of mime type multipart / x-mixed-replace with the border = * <border> ***** parameter that you will send a series of JPEG images separated by the <border> symbol.

The rules that apply to <boundary> were specified in this Gumbo post and some other recommendations that may now be outdated with newer ones are defined in RFC2046

Mixed replacement media types are described in an article in MIME

As an example that you posted, the definition of mime of media content transmitted over HTTP is included, can be defined as an optional parameter with the definition of http access.

 standard{access=http{mime=multipart/x-mixed-replace;boundary=--myboudary},mux=mpjpeg,dst=< address >:< port >/< path >} 
+3
source

Figured it out. Using http://tumblr.martinml.com/post/2108887785/how-to-broadcast-a-mjpeg-stream-from-your-webcam-with

VLC has options for setting the mime type and border. Link configuration example

 :sout=#transcode{vcodec=MJPG,vb=400,width=640,height=480} :duplicate{dst=std{access=http{mime=multipart/x-mixed-replace; boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:1234/webcam.mjpg}} 
+3
source

Source: https://habr.com/ru/post/1246542/


All Articles