Page 1 of 1

MIME boundary not found with TRENDnet IpCams

Posted: 21 Jan 2010 19:30
by Molik
Hi alls,

I 'm trying to watch MJPEG stream from TRENDnet TV-IP312W, TV-IP400W and TV-IP422W network camera.
And I have the same problem with all cameras:

Code: Select all

[00025] access_http debug: protocol 'HTTP' answer code 200 [00026] access_http debug: Server: Camera Web Server/1.0 [00027] access_http debug: Content-Type: multipart/x-mixed-replace;boundary=--video boundary-- [00028] main debug: using access module "access_http" ... [00041] mjpeg debug: Multipart MIME detected, using separator: video boundary--Content-length: 14139 ... [00059] main debug: `http://192.168.0.20/mjpeg.cgi' successfully opened [00060] mjpeg debug: MIME boundary not found in 15360 bytes of data ...
The problem comes from the boundary definition.
The HTTP response gives a valid Content-Type boundary definition (line 27)
But the boundary detected is (line 41)
video boundary--Content-length: 14139
then it should be
video boundary--
This is because TRENDnet don't insert a CRLF between the end of the boundary separator and the Content-Length definition.
In demux/mjpeg.c I saw the boudary separator is the whole last line read:

Code: Select all

psz_line = GetLine( p_demux, &i_pos ) ... /* Read the separator and remember it if not yet stored */ if( p_sys->psz_separator == NULL ) { p_sys->psz_separator = psz_line; msg_Dbg( p_demux, "Multipart MIME detected, using separator: %s", p_sys->psz_separator ); }
In modules/access/http.c I think we could extract a valid boudary separator:

Code: Select all

else if( !strcasecmp( psz, "Content-Type" ) ) { free( p_sys->psz_mime ); p_sys->psz_mime = strdup( p ); msg_Dbg( p_access, "Content-Type: %s", p_sys->psz_mime ); }
I wonder if it would be difficult to take the boundary in the HTTP response, rather than take the whole line at this step.

I write a program in C # which do like this and works very well. :D
But unfortunately I do not know enough about VLC structs to launch myself in modifications. (I'm a poor Windoze developer and I do not know the Linux environment :oops: )
If someone would help me I could give by mp a public address to one of my cams stream.

Many thanks in advance.
Molik

Re: MIME boundary not found with TRENDnet IpCams

Posted: 13 Aug 2012 00:32
by Jean-Baptiste Kempf
Try vlc 2.1.0

Re: MIME boundary not found with TRENDnet IpCams

Posted: 23 Aug 2012 09:34
by owll
Не пофиксили еще ?
Я вот думаю, может перед вызовом ф-ии GetLine попробовать найти подстроку "Content-length:" и перед ней поставить символы "/r/n" ?
Тогда по идее сепаратор должен корректно вычислиться.
Мне было бы интересно поковырять коды с Вашей поддержкой, так что я готов поучавствовать в эксперименте .

Re: MIME boundary not found with TRENDnet IpCams

Posted: 23 Aug 2012 12:06
by RSATom
Боюсь это англоязычный форум, и народ скоро начнет возмущаться...

I'm afraid it's english language forum...

Re: MIME boundary not found with TRENDnet IpCams

Posted: 24 Aug 2012 19:16
by RSATom
patch: http://mailman.videolan.org/pipermail/v ... 89816.html
but review by more experienced members is needed

Re: MIME boundary not found with TRENDnet IpCams

Posted: 26 Aug 2012 12:10
by RSATom