Java: receive multipart HTTP response

I am writing a java client application to receive real-time M-JPEG video from an IP camera The video is sent by the camera as an infinite number of part HTTP messages, each part of which is a single JPEG frame I need to process each of these frames, so I hope there is a way that every message part / video frame can be asynchronously triggered by the HTTP request of the event

Who knows any library can do this? All the examples I can find on Google won't work because they use blocking calls, only parse the response, and break it into parts when the response is complete (which obviously can't be an endless response)

I realized that I could manually break down the data into parts by searching message boundaries, but I just thought I would reinvent it

Solution

This project: http://fmj-sf.net , there is indeed a class to parse multipart / x-mixed-replace responses: http://fmj-sf.net/doc/fmj/net/sf/fmj/media/parser/MultipartMixedReplaceParser.html

Search Google Code: multipart / x-mixed-replace Lang: Java

I found some other examples: http://www.google.com/codesearch?as_q=multipart%2Fx -mixed-replace&btnG=Search+Code&hl=en&as_ lang=java&as_ license_ restrict=i&as_ license=&as_ package=&as_ filename=&as_ case=

http://www.google.com/codesearch/p?hl=en#FCmBlvKk1MA/cambozola -0.50/src/com/charliemouse/cambozola/shared/CamStream. java&q=multipart/x-mixed-replace%20lang:java

http://www.google.com/codesearch/p?hl=en#Xnnd -VJLMBY/src/Grabber. java&q=multipart/x-mixed-replace%20lang:java

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>