B4J Question MJPEG

BarryW

Active Member
Licensed User
Longtime User
I'am using MJPEG class to stream from RPI flask server.
I try to open the link on browser and it looks fine, while using MJPEG class is not working
i try to locate where the condition ends

1650112339293.png


this part

B4X:
If startframe > -1 And endframe > -1 Then

returns False, that why it did not continue the preview
 

MicroDrie

Well-Known Member
Licensed User
Search for the Start of Image tag byte pair &hFF D8 gives an index number in the variable startframe, and the search of the End of Image tag byte pair &hFF &hD9 gives an index number in the variable endframe. For both variables are always greater than -1 if there is a valid MJPEG file. You need to stream each frame till the current frame is equal to the variable endframe. I think it more efficient to use a added currentframe variable which is increased in every loop as a counter and will be used to stream the image in a do while loop.
 
Upvote 0
Top