Skip to content
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

How to import FFmpegMediaMetadataRetriever();? #261

Open
NeighborhoodCoding opened this issue Sep 24, 2022 · 4 comments
Open

How to import FFmpegMediaMetadataRetriever();? #261

NeighborhoodCoding opened this issue Sep 24, 2022 · 4 comments

Comments

@NeighborhoodCoding
Copy link

NeighborhoodCoding commented Sep 24, 2022

I added gradle and lib,
but

FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();

has red lines..

@wseemann
Copy link
Owner

Hello @NeighborhoodCoding

Make sure you are adding:

dependencies {
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-core:1.0.16'
    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever-native:1.0.16'
}

to your app or libraries build.gradle. Sync your project after that and the library should be available then.

Documentation about the library can be found here.

@NeighborhoodCoding
Copy link
Author

NeighborhoodCoding commented Sep 26, 2022

Thanks for your answer.
This works fine.
But

FFmpegMediaMetadataRetriever mmr_ffmpeg = new FFmpegMediaMetadataRetriever();

is not working...

It maybe my importation is some wrong? sorry.

@NeighborhoodCoding
Copy link
Author

Thanks in advance.

I'm currently build APK in windows OS. It is no problem I believe, it is OK? T.T

@wseemann
Copy link
Owner

wseemann commented Feb 14, 2023

Thanks for your answer. I was using mmr by

MediaMetadataRetriever mmr = new MediaMetadataRetriever();
xmmr.setDataSource(this.getApplicationContext(), mVideoUri);

This works fine. mVideoUri is "androud.resource://org.appname/raw/video1" and I don't know about this.getApplicationContext() actually.

But

FFmpegMediaMetadataRetriever mmr_ffmpeg = new FFmpegMediaMetadataRetriever();
mmr_ffmpeg.setDataSource(this.getApplicationContext(), mVideoUri);

is not working...

2022-09-26 15:27:32.081 24063-24096/org.appname/AndroidRuntime: FATAL EXCEPTION: Thread-4
Process: org.vqml_mobile, PID: 24063
java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFFF
at wseemann.media.FFmpegMediaMetadataRetriever.setDataSource(Native Method)
at wseemann.media.FFmpegMediaMetadataRetriever.setDataSource(FFmpegMediaMetadataRetriever.java:189)
at org.vqml_mobile.MainActivity.getResult(MainActivity.java:363)
at org.vqml_mobile.MainActivity.run(MainActivity.java:211)
at java.lang.Thread.run(Thread.java:1012)

It maybe my importation is some wrong? sorry.

As noted in the documentation, setDataSource will throw an exception if an error occurs when attempting to set the data source.

@wseemann wseemann reopened this Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants