Frame size:
384x216
I have done the following so far:
1. Created a new project in Eclipse.
2. Followed instructions from JAVACV readme.txt
- Downloaded javacv-0.6-bin.zip
- Downloaded javacv-0.6-cppjars.zip
- Copied 'javacpp.jar' and 'javacv.jar' to libs folder
- Extract all the `*.so` files from `javacv-android-arm.jar`, `opencv-2.4.6.1-android-arm.jar`, and `ffmpeg-2.0.1-android-arm.jar` directly into the newly created "libs/armeabi" folder, without creating any of the subdirectories found in the JAR files.
- Navigate to Project > Properties > Java Build Path > Libraries and click "Add JARs...".
- Select both `javacpp.jar` and `javacv.jar` from the newly created "libs" folder.
3. Verified that the RTSP stream from my IP Camera is working correctly. I used VLC on Win7 to play the RTSP stream. I also used an Android application called 'IP Cam Viewer Basic v4.8.7.apk' and it was able to play the RTSP stream.
4. Wrote a very simple Android application as follow:
try
{
grabber.setFormat("rtp");
grabber.setFrameRate(30);
grabber.start();
IplImage frame = grabber.grab();
while (/*canvasFrame.isVisible() &&*/ (frame = grabber.grab()) != null)
{
//canvasFrame.showImage(frame);
}
grabber.stop();
//canvasFrame.dispose();
}
catch(Exception e)
{
Log.e(LOGTAG, "Exception MyRunnable: " + e.getMessage());
}
Initially I was using FFmpegFrameGrabber but logcat reported that
Exception MyRunnable: avformat_open_input() error -1330794744: Could not open input "rtsp://192.168.8.122:554/live2.sdp". (Has setFormat() been called?)
I have tried using the following with no luck.
grabber.setFormat("rtsp");
grabber.setFormat("rtp");
grabber.setFormat("h264");
After some googling I came across the following link which indicated to use OpenCVFrameGrabber, but still no luck.
If I use OpenCVFrameGrabber then I get the following Exception in logcat:
Exception MyRunnable: cvCreateFileCapture() Error: Could not create camera capture.
Can someone please advice on what I can do in order to get RTSP packets captured?