change mime and boundary for mjpeg http stream?

About encoding, codec settings, muxers and filter usage
toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

change mime and boundary for mjpeg http stream?

Postby toninlg » 09 May 2010 09:46

Hi,

Is there a way to change the mime type and boundary for an http streaming of an mjpeg stream in order to make the stream working with firefox?
I've found something like this on the web :

Code: Select all

:sout=#transcode{vcodec=MJPG,vb=400,width=320,height=240}: duplicate{dst=std{access=http{mime=multipart/x-mixed-replace; boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:1234/webcam.mjpg}}
but it doesn't seem to work.

Does anybody have an idea?

Thank you.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby Rémi Denis-Courmont » 09 May 2010 10:13

You may need to use quotes here. And the correct boundary is "boundary=7b3cc56e5f51db803f790dad720ed50a", not "boundary=--7b3cc56e5f51db803f790dad720ed50a".
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 09 May 2010 11:09

It doesn't work. If I try to read it with an other vlc instance, I have the message :
access_http error: malformed header line: "boundary=7b3cc56e5f51db803f790dad720ed50a"
and with firefox, nothing happens.

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 09 May 2010 18:45

I have tested the playback from an axis camera emulator (http://sourceforge.net/projects/axisemulator/).
It works with Videolan. The Content-Type is: multipart/x-mixed-replace and the boundary=--myboundary.

Code: Select all

main debug: creating access 'http' path='127.0.0.1:80/axis-cgi/mjpg/video.cgi?camera=1&resolution=480x360&fps=25' main debug: looking for access module: 2 candidates access_http debug: http: server='127.0.0.1' port=80 file='/axis-cgi/mjpg/video.cgi?camera=1&resolution=480x360&fps=25 main debug: net: connecting to 127.0.0.1 port 80 main debug: connection: Resource temporarily unavailable qt4 debug: IM: Setting an input qt4 debug: Updating the geometry qt4 debug: Updating the geometry main debug: connection succeeded (socket = 1624) access_http debug: protocol 'HTTP' answer code 200 access_http debug: Server: BaseHTTP/0.3 Python/2.5.1 access_http debug: Content-Type: multipart/x-mixed-replace; boundary=--myboundary main debug: using access module "access_http" main debug: TIMER module_need() : 151.291 ms - Total 151.291 ms / 1 intvls (Avg 151.291 ms) main debug: Using AStream*Stream main debug: pre buffering main debug: received first data after 26 ms main debug: pre-buffering done 1024 bytes in 0s - 37 kbytes/s main debug: looking for stream_filter module: 2 candidates main debug: TIMER module_need() : 0.273 ms - Total 0.273 ms / 1 intvls (Avg 0.273 ms) main debug: looking for stream_filter module: 1 candidate main debug: using stream_filter module "stream_filter_record" main debug: TIMER module_need() : 0.127 ms - Total 0.127 ms / 1 intvls (Avg 0.127 ms) main debug: creating demux: access='http' demux='' path='127.0.0.1:80/axis-cgi/mjpg/video.cgi?camera=1&resolution=480x360&fps=25' main debug: looking for demux module: 50 candidates mjpeg debug: Multipart MIME detected, using separator: myboundary mjpeg debug: discard MIME header: Content-Length: 8988 main debug: selecting program id=0 main debug: using demux module "mjpeg" main debug: TIMER module_need() : 41.716 ms - Total 41.716 ms / 1 intvls (Avg 41.716 ms) main debug: looking for a subtitle file in C:\Program Files\VideoLAN\VLC\ main debug: looking for decoder module: 35 candidates avcodec debug: libavcodec already initialized avcodec debug: using direct rendering avcodec debug: ffmpeg codec (Motion JPEG Video) started main debug: using decoder module "avcodec" main debug: TIMER module_need() : 2.980 ms - Total 2.980 ms / 1 intvls (Avg 2.980 ms) main debug: thread (decoder) created at priority 0 (../.././src/input/decoder.c:315) qt4 debug: Updating the geometry qt4 debug: Updating the geometry qt4 debug: Updating the geometry qt4 debug: Updating the geometry qt4 debug: Updating the geometry main debug: thread started main debug: `http://127.0.0.1:80/axis-cgi/mjpg/video.cgi?camera=1&resolution=480x360&fps=25' successfully opened main debug: Buffering 0% mjpeg debug: discard MIME header: Content-Length: 8341
I would like VLC to output a similar stream.
Thank you for your help.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby Rémi Denis-Courmont » 09 May 2010 19:15

Just end the URL with .mpjpeg then
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 10 May 2010 00:28

Whatever I try, it doesn't work with Firefox. The boundary is always : 7b3cc56e5f51db803f790dad720ed50a.
I think that the boundary can't be changed :
http://www.videolan.org/developers/vlc/ ... eg_8c.html.
http://trac.videolan.org/vlc/ticket/1188

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby Rémi Denis-Courmont » 10 May 2010 18:18

I fail to see why you would need to change the boundary.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 10 May 2010 22:55

I have an application that displays mjpeg stream from an axis camera. I want to use this application but with an mjpeg stream coming from an other source. So this alternative stream must have the same properties. The axis camera emulator uses a boundary that is --myboudary and this stream is read by firefox (and by vlc). The stream from vlc isn't read by firefox, I assume that is because of the boundary.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby Rémi Denis-Courmont » 11 May 2010 18:00

As I already said, the VLC URL must end in .mpjpeg to get the correct HTTP Content-Type header.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 13 May 2010 23:05

Is there an old version of vlc that supports configuration of header and boundary?

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby Rémi Denis-Courmont » 15 May 2010 12:23

No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

toninlg
New Cone
New Cone
Posts: 7
Joined: 09 May 2010 09:34

Re: change mime and boundary for mjpeg http stream?

Postby toninlg » 16 May 2010 02:26

Ok. So I'll try something more flexible or change the code as I need.

jansonb
New Cone
New Cone
Posts: 4
Joined: 15 Apr 2010 13:35

Re: change mime and boundary for mjpeg http stream?

Postby jansonb » 01 Jun 2010 10:41

So, did you find a way to do it?

I guess that if the output of VLC is a mpjpg container it should work.

mralex
New Cone
New Cone
Posts: 2
Joined: 19 May 2009 14:32
VLC version: UPtoDate
Operating System: FreeBSD
Location: UA, Kiev
Contact:

Re: change mime and boundary for mjpeg http stream?

Postby mralex » 22 Oct 2010 15:25

Working solution on vlc-1.1.4_2,3 is next for VLM config:

new Cam83 broadcast enabled
setup Cam83 input /home/user/cam83-mjpeg-iphone.mp4 loop
setup Cam83 output '#standard{mux="mpjpeg",access="http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a}",dst="AA.BB.CC.DD:6666/video83.mjpg"}'
setup Cam83 option sout-keep

control Cam83 play
WBR, mrAlex
http://videoprobki.com


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 11 guests