Click here to Skip to main content
15,885,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am new in this project, but what i want is to Stream video from external webcam to server using java code and use android mobile(the client) to view the live video. can anyone please guide me to start on this project. I am using eclipse sdt java for this project.

so far what i had done was to display the video from the external webcam internally using the java class code. I need to capture the live video through url with my android activity code?

package com.example.webcam;

Java
import javax.swing.JFrame;
import java.awt.*; 
import javax.media.*; 
import javax.media.format.YUVFormat;
import java.awt.event.*; 
import java.io.IOException;
import java.util.Vector;

public class Camfeed {
	
String Video_Device = "vfw:Microsoft WDM Image Capture:0";
JFrame frame = new JFrame(" Hello JMF Player"); 
static Player player = null; 

	public Camfeed() throws NoPlayerException, CannotRealizeException, IOException
	{
		// Get the device list and store it in a vector

		Vector		CaptureDeviceInfo device = (CaptureDeviceInfo) deviceList.firstElement();

		MediaLocator ml = device.getLocator();	
                // Create the player 	
		player = Manager.createRealizedPlayer(ml);		
                //Get the visual component
		Component videoScreen = player.getVisualComponent();
		// Put the visual component inside a frame 
		frame.getContentPane().add( videoScreen, BorderLayout.CENTER); 
		frame.addWindowListener( new WindowAdapter() { 
			public void windowClosing(WindowEvent we) { 
				 Camfeed.stop();    System.exit(0); 
			} 
		}); 

                frame.pack(); 
		frame.setSize( new Dimension(400,400) ); 
		frame.setVisible(true); 
		player.start(); 

	}
	public static void stop(){ 
		player.stop(); 
		 player.close();  

	} 

	public static void main(String as[]) throws NoPlayerException, CannotRealizeException, IOException
	{
		Camfeed c= new Camfeed();
	}

}
Posted
Updated 25-Sep-17 2:24am
v2

1 solution

Hi please use the libstreaming Library for android This will help you to get a solution.In my code i have successfully implemented this.

Foe more please refer this link

https://github.com/fyhertz/libstreaming-examples
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900