Mjpeg Stream Viewing

GabrielM

Member
Licensed User
Longtime User
Hi,

ref:- Mjpeg Stream Viewing

I am trying to get/view a Mjpeg video stream from a network camera similar to what you can get if you open the following link in a browser:

"http://83.64.164.6/axis-cgi/mjpg/video.cgi?resolution=320x240"

Found following interesting links where it seems that there are two classes in the package, MjpegInputStream.java and the MjpegView.java that would be needed, so I would like to ask for some help/advice on how to get them in a B4A library:

Links:
Android and MJPEG - Stack Overflow
anddev.org • View topic - MJPEG on Android anyone?
android-camera-axis - control axis's camera with your android phone - Google Project Hosting

I have tried to get a library done via Eclipse and based on what I could understood from the examples on the forum ref libraries but it would not be that easy for a java noob :) . I have attached the Eclipse project here:

and the xml+jar files produced and a B4A simple test.

Obviously it fails and as I do not have any java experience at all, only what I have read on this great forum, I've got stuck.

Thank you.
 

Attachments

  • MJPEG.zip
    13.5 KB · Views: 790
  • Mjped_lib_Faulty.zip
    8.5 KB · Views: 596
  • MjpegView_B4A_test.zip
    13.3 KB · Views: 679

GabrielM

Member
Licensed User
Longtime User
It is the B4A Compilation error like in the attached image
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    27.9 KB · Views: 558
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Are you sure it compiled successfully in eclipse?
Looks like your constructors declaration is not correct.

Should this:
B4X:
public MjpegInputStream(InputStream in) { super(new BufferedInputStream(in, FRAME_MAX_LENGTH)); }

be:
B4X:
public void MjpegInputStream(InputStream in) { super(new BufferedInputStream(in, FRAME_MAX_LENGTH)); }
 
Upvote 0

GabrielM

Member
Licensed User
Longtime User
I see now the syntax error, you're right. No way to realise this myself and there was no warning on eclipse if I remember right. I will update and try again.

Thank you.
 
Upvote 0

GabrielM

Member
Licensed User
Longtime User
Hi Erel

missed your post...:signOops:

Yes, thank you. I have tried it previously and I got : "Cannot play video
Sorry, this video cannot be played."

What I am trying to do is :
- access the http location of the IP camera;
- provide username and password required;
- play the rtsp stream;

I wish I could wrap the mjpeg viewer java codes as in the first post in this thread into a library.

Gabi
 
Upvote 0
Top