i add a function in libvlcjni.c and compiled a new libvlcjni.so
Code: Select all
jboolean Java_org_videolan_vlc_LibVLC_snapshot(JNIEnv *env, jobject thiz, jstring path, jint width, jint height)
{
/* get media player */
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
if (!mp){
return JNI_FALSE;
}
jboolean isCopy;
/* Get C string */
const char* save_path = (*env)->GetStringUTFChars(env, path, &isCopy);
// take a snapshot
libvlc_video_take_snapshot(mp, 0, save_path, width, height);
(*env)->ReleaseStringUTFChars(env, path, save_path);
return JNI_TRUE;
}
and i called this native function in android, the error message of logcat:
avcodec encoder cannot find encoder PNG Image
*** Your Libav/FFmpeg installation is crippled. ***
*** Please check with your Libav/FFmpeg packager. ***
*** This is NOT a VLC media player issue. ***
main encoder Streaming / Transcoding failed
main encoder It seems your Libav/FFmpeg (libavcodec) installation lacks the following encoder:
PNG Image.
If you don't know how to fix this, ask for support from your distribution.
This is not an error inside VLC media player.
Do not contact the VideoLAN project about this issue.
main encoder no suitable encoder module for fourcc `png '.
VLC probably does not support this image format.
main video output Failed to convert image for snapshot
and how can i fix this problem?