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

Can not get metadata for audio #4

Closed
Sinhbk opened this issue Dec 5, 2013 · 7 comments
Closed

Can not get metadata for audio #4

Sinhbk opened this issue Dec 5, 2013 · 7 comments

Comments

@Sinhbk
Copy link

Sinhbk commented Dec 5, 2013

Hello,

I tried to get metadata for mp3, mp2 file, but the error was taken at set_data_source.

Can you check it or I need to configure some place to make it work.

@wseemann
Copy link
Owner

wseemann commented Dec 5, 2013

Can you post the URLs you were trying to use?

@Sinhbk
Copy link
Author

Sinhbk commented Dec 6, 2013

I tried audio files in sdcard and its not work. URL: /mnt/sdcard/DCIM/music.mp2 .
For video files. Its working perfectly.

@Sinhbk
Copy link
Author

Sinhbk commented Dec 6, 2013

Can you give me a way to write code C log to java side. Using printf as in code does not work.
Many thanks!

@Sinhbk
Copy link
Author

Sinhbk commented Dec 6, 2013

I wrote log and found that the error was taken in method
if (avformat_open_input(&state->pFormatCtx, path, NULL, NULL) != 0) {
printf("Metadata could not be retrieved\n");
*ps = NULL;
return FAILURE;
}
the path: /mnt/sdcard/DCIM/music.mp2. I tried adding prefix "file://" to the path but it still not work.

@wseemann
Copy link
Owner

wseemann commented Dec 6, 2013

You need to include the following header: #include <android/log.h>

You can then print debug statements with: __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "Some statement");

There is no "error" in the library. It's not working with mp2 files because I didn't compile the library with mp2 support. Re-compile FFmpeg with mp2 support and it will work fine.

@wseemann wseemann closed this as completed Dec 6, 2013
@wseemann
Copy link
Owner

wseemann commented Dec 7, 2013

I recompiled the library with all codecs enabled and commited the resulting libraries. Please re-download and try again.

@Sinhbk
Copy link
Author

Sinhbk commented Dec 7, 2013

It works. Thanks for your help!

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