LibVLC for Android - libvlc.getThumbnail() returns null

This forum is about all development around libVLC.
liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 30 Nov 2014 18:12

Hi,

I am using LibVLC in Android(version 0.9.9) to play RTSP streams, and I want to take a snapshot from the stream that is currently playing.

I tried to use this method:

Code: Select all

libvlc.getThumbnail(mrl, i_width, i_height)
but it always return null.

According to this: https://forum.videolan.org/viewtopic.php?f=35&t=122463, it was possible to take snapshot from RTSP stream by modifying the source code and recompile the library in version 0.1.x.

What is the right way to get a snapshot by invoking the getThumbnail() method?

Or do I have to checkout to version 0.1.x, add 'enable-encoder=png', and recompile the library?

Many thanks,
Liuting

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 02 Dec 2014 04:46

That function is for VLC for Android so that it can get thumbnails for the video library. It was not designed for taking general snapshots.

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 03 Dec 2014 21:52

Hi Edward,

Many thanks for your reply.

Now I've enable the sout module in configure.sh and also add 'enable-encoder=png' in rules.mak, after compiling with no error, when running in Android it give me this error:
core video output: Encoding support not compiled-in!
Seems the ffmpeg change didn't get compiled, what should I do to get it compiled?

I am compiling on version 0.9.10.

Regards,
Liuting

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 04 Dec 2014 05:51

Did you rebuild both libVLC and VLC for Android? Try cleaning and rebuilding if the change wasn't picked up.

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 04 Dec 2014 10:35

Hi Edward,

Thanks for your help, after I did 'touch vlc/contrib/contrib-android-arm-linux-androideabi/ffmpeg/' and run 'sh compile.sh' again, here are pieces of the compiling log:
Enabled decoders:
aac cdxl jpegls
aac_latm cinepak jv
aasc cljr kgv1
ac3 cllc kmvc
adpcm_4xm comfortnoise lagarith
adpcm_adx cook libgsm
adpcm_ct cscd libgsm_ms
adpcm_ea cyuv libopenjpeg
adpcm_ea_maxis_xa dca loco
adpcm_ea_r1 dfa mace3
adpcm_ea_r2 dnxhd mace6
adpcm_ea_r3 dpx mdec
adpcm_ea_xas dsicinaudio metasound
adpcm_g722 dsicinvideo mimic
adpcm_g726 dvbsub mjpeg
adpcm_ima_amv dvdsub mjpegb
adpcm_ima_apc dvvideo mlp
adpcm_ima_dk3 dxa mmvideo
adpcm_ima_dk4 dxtory motionpixels
adpcm_ima_ea_eacs eac3 mp1
adpcm_ima_ea_sead eacmv mp1float
adpcm_ima_iss eamad mp2
adpcm_ima_qt eatgq mp2float
adpcm_ima_smjpeg eatgv mp3
adpcm_ima_wav eatqi mp3adu
adpcm_ima_ws eightbps mp3adufloat
adpcm_ms eightsvx_exp mp3float
adpcm_sbpro_2 eightsvx_fib mp3on4
adpcm_sbpro_3 escape124 mp3on4float
adpcm_sbpro_4 escape130 mpc7
adpcm_swf exr mpc8
adpcm_thp ffv1 mpeg1video
adpcm_vima ffvhuff mpeg2video
adpcm_xa fic mpeg4
adpcm_yamaha flac msa1
aic flashsv msmpeg4v1
alac flashsv2 msmpeg4v2
alias_pix flic msmpeg4v3
als flv msrle
amrnb fourxm mss1
amrwb fraps mss2
amv frwu msvideo1
anm g2m mszh
ansi g723_1 mts2
ape gif mvc1
ass gsm mvc2
asv1 gsm_ms mxpeg
asv2 h261 nellymoser
atrac1 h263 nuv
atrac3 h263i on2avc
atrac3p h264 paf_audio
aura hevc paf_video
aura2 hnm4_video pam
avs huffyuv pbm
bethsoftvid iac pcm_alaw
bfi idcin pcm_bluray
bink iff_byterun1 pcm_dvd
binkaudio_dct iff_ilbm pcm_f32be
binkaudio_rdft imc pcm_f32le
bmp indeo2 pcm_f64be
bmv_audio indeo3 pcm_f64le
bmv_video indeo4 pcm_lxf
brender_pix indeo5 pcm_mulaw
c93 interplay_dpcm pcm_s16be
cavs interplay_video pcm_s16le
cdgraphics jpeg2000 pcm_s16le_planar
pcm_s24be rv10 vble
pcm_s24daud rv20 vc1
pcm_s24le rv30 vc1image
pcm_s24le_planar rv40 vcr1
pcm_s32be s302m vmdaudio
pcm_s32le sanm vmdvideo
pcm_s32le_planar sgi vmnc
pcm_s8 sgirle vorbis
pcm_s8_planar shorten vp3
pcm_u16be sipr vp5
pcm_u16le smackaud vp6
pcm_u24be smacker vp6a
pcm_u24le smc vp6f
pcm_u32be sol_dpcm vp7
pcm_u32le sp5x vp8
pcm_u8 srt vp9
pcm_zork sunrast vqa
pcx svq1 wavpack
pgm svq3 webp
pgmyuv tak wmalossless
pgssub targa wmapro
pictor theora wmav1
png thp wmav2
ppm tiertexseqvideo wmavoice
prores tiff wmv1
ptx tmv wmv2
qcelp truehd wmv3
qdm2 truemotion1 wmv3image
qdraw truemotion2 wnv1
qpeg truespeech ws_snd1
qtrle tscc xan_dpcm
r10k tscc2 xan_wc3
r210 tta xan_wc4
ra_144 twinvq xbm
ra_288 txd xl
ralf ulti xsub
rawvideo utvideo xwd
rl2 v210 yop
roq v210x zerocodec
roq_dpcm v410 zlib
rpza vb zmbv

Enabled encoders:
png

Enabled hwaccels:

Enabled parsers:
aac dvdsub mpegvideo
aac_latm flac opus
ac3 gsm png
adx h261 pnm
bmp h263 rv30
cavsvideo h264 rv40
cook hevc tak
dca mjpeg vc1
dirac mlp vorbis
dnxhd mpeg4video vp3
dvbsub mpegaudio vp8

Enabled demuxers:
aac image2pipe pcm_u32be
ac3 ingenient pcm_u32le
adx ipmovie pcm_u8
aea iss pmp
aiff iv8 pva
amr ivf qcp
anm jv r3d
apc latm rawvideo
ape lmlm4 rl2
asf lxf rm
ass m4v roq
au matroska rpl
avi mjpeg rso
avs mlp rtp
bethsoftvid mm rtsp
bfi mmf sap
bink mov sdp
bmv mp3 segafilm
c93 mpc shorten
caf mpc8 siff
cavsvideo mpegps smacker
cdg mpegts smjpeg
cdxl mpegtsraw smush
daud mpegvideo sol
dfa msnwc_tcp sox
dirac mtv spdif
dnxhd mv srt
dsicin mvi str
dts mxf swf
dv mxg tak
dxa nc thp
ea nsv tiertexseq
ea_cdata nut tmv
eac3 nuv truehd
ffmetadata ogg tta
filmstrip oma tty
flac paf txd
flic pcm_alaw vc1
flv pcm_f32be vc1t
fourxm pcm_f32le vmd
g722 pcm_f64be voc
g723_1 pcm_f64le vqf
gsm pcm_mulaw w64
gxf pcm_s16be wav
h261 pcm_s16le wc3
h263 pcm_s24be wsaud
h264 pcm_s24le wsvqa
hevc pcm_s32be wtv
hls pcm_s32le wv
hnm pcm_s8 xa
idcin pcm_u16be xmv
iff pcm_u16le xwma
ilbc pcm_u24be yop
image2 pcm_u24le yuv4mpegpipe

Enabled muxers:

Enabled protocols:
concat httpproxy rtmpt
crypto icecast rtp
ffrtmphttp md5 srtp
file mmsh tcp
gopher mmst udp
hls pipe unix
http rtmp

Enabled filters:

Enabled bsfs:

Enabled indevs:

Enabled outdevs:

License: LGPL version 2.1 or later
Creating config.mak and config.h...
libavutil/avconfig.h is unchanged
cd ffmpeg && /Applications/Xcode.app/Contents/Developer/usr/bin/make install-libs install-headers
Does this mean the PNG encoder got compiled already?

After replaced /jni and /armeabi-v7a of my project, I am still getting the error and no data written into the png file.
core video output: Encoding support not compiled-in!
core video output: Failed to convert image for snapshot
Best,
Liuting

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 04 Dec 2014 10:54

Did you clean and rebuild in vlc/ for the changes to take effect?

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 04 Dec 2014 11:23

Hi Edward, sorry I am new to this. What command should I use to clean rebuild vlc/ ?

Thanks for your detailed guidance.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 04 Dec 2014 11:28

cd vlc/build-android-arm-linux-androideabi && make clean

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 04 Dec 2014 14:19

Hi Edward, after I cleaned /vlc and re-run ./compile.sh, but the error is still there ..

Is there anything else that could be wrong?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 04 Dec 2014 21:01

Did you enable sout in configure.sh?

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 04 Dec 2014 22:46

Yes I deleted -disable-sout from configure.sh.

And in android/vlc/contrib/src/ffmpeg/rules.mak, I changed 'FFMPEGCONF += --disable-encoders --disable-muxers' to 'FFMPEGCONF += --disable-encoders --enable-encoder=png --disable-muxers'.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby edwardw » 04 Dec 2014 22:49

Try removing "--disable-encoders".

liutingdu
New Cone
New Cone
Posts: 9
Joined: 22 Sep 2014 18:05
VLC version: Android 0.9.10
Operating System: Mac OS
Location: Dublin

Re: LibVLC for Android - libvlc.getThumbnail() returns null

Postby liutingdu » 05 Dec 2014 12:02

Hi Edward,
Finally I got it working by cloning the project again, make changes before the first compile, then the changes got compiled in.
Thank you so much for all your kindly help!
Liuting


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests