Reputation: 14053
I need to stream live video from web-cam to my android phone. On PC side I am planning to use OpenCV and grab each frame using Mat class. I am familiar with OpenCV, but no idea about how to stream this video to Android. I need to do this through wifi. Can any one suggest how can I do this ?. Or is there any other method for doing this ?.
Thanks in advance....
Upvotes: 0
Views: 873
Reputation: 3407
Via file transfer, it is easy to read video files. Here's the answer from another post on SO, and one more
The code in that post is as follows.
public static Bitmap getVideoFrame(FileDescriptor FD) {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(FD);
return retriever.getFrameAtTime();
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
} catch (RuntimeException ex) {
ex.printStackTrace();
} finally {
try {
retriever.release();
} catch (RuntimeException ex) {
}
}
return null;
}
Note that this is off-line process. For online realtime transfer, I have no idea.
Upvotes: 1