Http multi part mjpeg stream

It hasn’ t you can get the specification here:
https://developers.google.com/streetview/open-spherical-camera/reference/camera/getlivepreview

ooh I see and you suggest that the rest api url won’t work with this library?

No, what I am saying is that this library takes care of decoding the mjpeg stream

private void Start_Click(object sender, RoutedEventArgs e)
{
    _mjpeg.ParseStream(new Uri("http://192.168.2.200/img/video.mjpeg"));
}

and this is already taken care in vvvv with the dynamic texture, the problem here is that I can’ t even get to that stream, before stopping the request.

EDIT: btw in your http nodes is i tok to click the construct pin of the Client at the same time of the Send pin of the Send node? That seems to work right, just asking

but it also takes care of fetching the stream from http it’s not just decoding. anyway if I can get a public camera stream with this I can have a go with my http node

Unfortunately I don’ t think it is possible, or it is not trivial, as the camera creates its own access point so I am not really sure about how to do some NAT on my router to give it a public access (furthermore I am on a HDSPA connectio right now, but I ll have a look at it).
The “ritual” is as following:

  • POST to IP/osc/commands/execute with payload
    {
    “name”: “camera.getLivePreview”,
    }

  • the camera starts to stream (akwnoledged by monitoring the wifi use of bandwidth), nothing comes out of the http nodes

  • if you stop the stream (must be done in the camera because if you do it with an http request, the latest response will erase the previous, or alternatively with a parallel request) the http node spits out the recorded frames with the folowing content type, they frame boundary is explicitly defined

multipart/x-mixed-replace;boundary=------live_preview--------

This one just to let @microdee know that with the ResponseHeaderRead setting it works, it is just picky about whether you did a request before without that settings, it seems like it is crashing the AP and the http nodes get stuck, I am investigating.
EDIT: it works in the sense that the stream is ready available but the raw data is not complete, it seems like it is sending out chunks, one every frame or so…

I don’t know how it was working for you as I never tested my http node with ResponseHeadersRead and surprise surprise it didn’t work for me accordingly. anyway I solved it and now I’m fighting with async stream shenanigans

Ok maybe we can set up a teamviewer session one of these days and you can try with my camera?

yeah cool idea, I will show http nodes off at next vveekend vvorkshop too. pushed fixes to github https://github.com/microdee/mp.essentials/commit/78f6a1599e532d1b621bb6e93f845888093e01b4 use vpm to update. I’d suggest updating vobjects too as some nodes were transferred to mp.essentials

This happes for Vobjects and md.essentials

I managed to install but the http nodes are acting weird now, the raw content is like “accumulating” on the output instead of replacing at every call.

yes check out the girlpower it’s “”“working”"" there, but not like UDP or TCP nodes. I’m using HttpClient and not WebRequest to accomplish stuff. With HttpClient it is better to do sessions and I wanted to keep that however it is very hacky to get out indefinite streaming of data. what was the vpm link you were using btw?

I used the vpm link in the downloaded github folder. (all)

Indeed it works with the Girlpower example! But still some issues I think you are aware of, stuttering and tearing of the image and it can crash from time to time, still a bit step forward. Tx.

yeah there can be data loss or error when the position is changed by the vvvv thread of the stream. there’s a racing condition I have to deal with somehow in the future

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.