-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help with linking javaCV #157
Comments
I don't know, that seems to be a problem with Android Studio. There's a related issue here: #133 (comment) I'm not sure what Google intends to do about these kinds of situations... Maybe you could ask them and come back with a definitive answer? It would help a lot. |
Hello,
If you can offer a suggestion on what to try next, it would be greatly This is my folder structure:[image: Inline image 1] Thanks for your time. On Wed, May 27, 2015 at 4:18 PM, Samuel Audet [email protected]
|
GitHub apparently doesn't support email attachments, so there is no image for me to see, but I'm guessing the native libraries for OpenCV are simply just missing. Please try to add them once more. |
I finally managed to resolve the link error! If it is not too much to ask, can you please take a look at the method I public void createMovie(View view) {
Loader.load(opencv_highgui.class);
Loader.load(org.bytedeco.javacpp.opencv_core.class);
Loader.load(swresample.class);
new AsyncTask<Void, Void, Void>() {
ProgressDialog dialog;
@Override
protected void onPreExecute() {
dialog = new ProgressDialog(WriteMovieActivityAsync.this);
dialog.setMessage("Generating video, Please wait.......");
dialog.setCancelable(false);
dialog.show();
};
@Override
protected Void doInBackground(Void... params) {
videoPath = OUTPUT_DIR + "/" + "test.mp4";
FFmpegFrameRecorder recorder = new
FFmpegFrameRecorder(videoPath, mWidth, mHeight);
AndroidFrameConverter frameConverter = new AndroidFrameConverter();
try {
recorder.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);
recorder.setFormat("mp4");
recorder.setVideoQuality(0);
recorder.setFrameRate(10);
long startTime = 0;
try {
recorder.start();
} catch (FrameRecorder.Exception e) {
e.printStackTrace();
}
int nLen = imageIDs.length;
if (nLen > durations.size())
nLen = durations.size();
for (int i = 0; i < nLen; i++) {
int imageID = imageIDs[i];
Uri imageURI =
Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, ""
+ imageID);
final Bitmap rgb565 =
loader.loadImageSync(imageURI.toString(), options);
Frame frame = frameConverter.convert(rgb565);
//Get frame duration in milliseconds
long duration = (long) ((float) durations.get(i));
recorder.setTimestamp(startTime);
try {
recorder.record(frame);
} catch (FrameRecorder.Exception e) {
e.printStackTrace();
}
startTime += duration;
}
} finally {
try {
Log.v("RECORDER", "Total time: " + recorder.getTimestamp());
recorder.stop();
} catch (FrameRecorder.Exception e) {
e.printStackTrace();
}
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
dialog.dismiss();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(videoPath), "video/mp4");
startActivity(intent);
Toast.makeText(WriteMovieActivityAsync.this, "Video
Saved", Toast.LENGTH_LONG).show();
}
}.execute();
} I get this error on every iteration:
Thanks.
|
First, make sure that BTW, you've asked the same question in #159. Please don't do that. |
Thank you! My problem was the with the duration. On Sat, Jun 6, 2015 at 4:24 PM, Samuel Audet [email protected]
|
Hello , I used the manual instructions to JavaCV to my project but it doesn't work. Please help!
This is from build.gradle:
I think the problem I am having has to do with the bug:
However, the difference in my case is that my application uses the ndk to build a cpp library at runtime.
Tried gradle and maven dependencies. Tried unpacking the .jar files and including the .so files in the folders jniLibs/armeabi-v7a, jniLibs/x86, etc but it seems that the jniLibs subfolders get re-created at runtime.
Is there another way to link JavaCV?
The text was updated successfully, but these errors were encountered: