
Recherche avancée
Médias (10)
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (52)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (7942)
-
make : *** [ffmpeg_g] Error 1
22 décembre 2014, par P C SAS3hi i am trying to install ffmpeg . i choose to do it from source because i am using a vps server so i did these steps i am using git command for getting source from github after compiling i got the below result
#cd ~/ffmpeg_sources
#git clone --depth 1 git://source.ffmpeg.org/ffmpeg
#cd ffmpeg
#PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
install prefix /root/ffmpeg_build
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
yasm yes
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AVX enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast yes
EBX available yes
EBP available yes
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static yes
shared no
postprocessing support yes
new filter support yes
network support yes
threading support pthreads
safe bitstream reader yes
SDL support no
opencl enabled no
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled no
makeinfo supports HTML no
External libraries:
iconv libopus libx264
libfdk_aac libvorbis zlib
libmp3lame libvpx
Enabled decoders:
aac bfi gsm
aac_latm bink gsm_ms
aasc binkaudio_dct h261
ac3 binkaudio_rdft h263
ac3_fixed bintext h263i
adpcm_4xm bmp h263p
adpcm_adx bmv_audio h264
adpcm_afc bmv_video hevc
adpcm_ct brender_pix hnm4_video
adpcm_dtk c93 huffyuv
adpcm_ea cavs iac
adpcm_ea_maxis_xa cdgraphics idcin
adpcm_ea_r1 cdxl idf
adpcm_ea_r2 cinepak iff_byterun1
adpcm_ea_r3 cljr iff_ilbm
adpcm_ea_xas cllc imc
adpcm_g722 comfortnoise indeo2
adpcm_g726 cook indeo3
adpcm_g726le cpia indeo4
adpcm_ima_amv cscd indeo5
adpcm_ima_apc cyuv interplay_dpcm
adpcm_ima_dk3 dca interplay_video
adpcm_ima_dk4 dfa jacosub
adpcm_ima_ea_eacs dirac jpeg2000
adpcm_ima_ea_sead dnxhd jpegls
adpcm_ima_iss dpx jv
adpcm_ima_oki dsd_lsbf kgv1
adpcm_ima_qt dsd_lsbf_planar kmvc
adpcm_ima_rad dsd_msbf lagarith
adpcm_ima_smjpeg dsd_msbf_planar libfdk_aac
adpcm_ima_wav dsicinaudio libopus
adpcm_ima_ws dsicinvideo libvorbis
adpcm_ms dvbsub libvpx_vp8
adpcm_sbpro_2 dvdsub libvpx_vp9
adpcm_sbpro_3 dvvideo loco
adpcm_sbpro_4 dxa mace3
adpcm_swf dxtory mace6
adpcm_thp eac3 mdec
adpcm_vima eacmv metasound
adpcm_xa eamad microdvd
adpcm_yamaha eatgq mimic
aic eatgv mjpeg
alac eatqi mjpegb
alias_pix eightbps mlp
als eightsvx_exp mmvideo
amrnb eightsvx_fib motionpixels
amrwb escape124 movtext
amv escape130 mp1
anm evrc mp1float
ansi exr mp2
ape ffv1 mp2float
apng ffvhuff mp3
ass ffwavesynth mp3adu
asv1 fic mp3adufloat
asv2 flac mp3float
atrac1 flashsv mp3on4
atrac3 flashsv2 mp3on4float
atrac3p flic mpc7
aura flv mpc8
aura2 fourxm mpeg1video
avrn fraps mpeg2video
avrp frwu mpeg4
avs g2m mpegvideo
avui g723_1 mpl2
ayuv g729 msa1
bethsoftvid gif msmpeg4v1
msmpeg4v2 qcelp twinvq
msmpeg4v3 qdm2 txd
msrle qdraw ulti
mss1 qpeg utvideo
mss2 qtrle v210
msvideo1 r10k v210x
mszh r210 v308
mts2 ra_144 v408
mvc1 ra_288 v410
mvc2 ralf vb
mxpeg rawvideo vble
nellymoser realtext vc1
nuv rl2 vc1image
on2avc roq vcr1
opus roq_dpcm vima
paf_audio rpza vmdaudio
paf_video rv10 vmdvideo
pam rv20 vmnc
pbm rv30 vorbis
pcm_alaw rv40 vp3
pcm_bluray s302m vp5
pcm_dvd sami vp6
pcm_f32be sanm vp6a
pcm_f32le sgi vp6f
pcm_f64be sgirle vp7
pcm_f64le shorten vp8
pcm_lxf sipr vp9
pcm_mulaw smackaud vplayer
pcm_s16be smacker vqa
pcm_s16be_planar smc wavpack
pcm_s16le smvjpeg webp
pcm_s16le_planar snow webvtt
pcm_s24be sol_dpcm wmalossless
pcm_s24daud sonic wmapro
pcm_s24le sp5x wmav1
pcm_s24le_planar srt wmav2
pcm_s32be ssa wmavoice
pcm_s32le stl wmv1
pcm_s32le_planar subrip wmv2
pcm_s8 subviewer wmv3
pcm_s8_planar subviewer1 wmv3image
pcm_u16be sunrast wnv1
pcm_u16le svq1 ws_snd1
pcm_u24be svq3 xan_dpcm
pcm_u24le tak xan_wc3
pcm_u32be targa xan_wc4
pcm_u32le targa_y216 xbin
pcm_u8 text xbm
pcm_zork theora xface
pcx thp xl
pgm tiertexseqvideo xsub
pgmyuv tiff xwd
pgssub tmv y41p
pictor truehd yop
pjs truemotion1 yuv4
png truemotion2 zero12v
ppm truespeech zerocodec
prores tscc zlib
prores_lgpl tscc2 zmbv
ptx tta
Enabled encoders:
a64multi libopus pgmyuv
a64multi5 libvorbis png
aac libvpx_vp8 ppm
ac3 libvpx_vp9 prores
ac3_fixed libx264 prores_aw
adpcm_adx libx264rgb prores_ks
adpcm_g722 ljpeg qtrle
adpcm_g726 mjpeg r10k
adpcm_ima_qt movtext r210
adpcm_ima_wav mp2 ra_144
adpcm_ms mp2fixed rawvideo
adpcm_swf mpeg1video roq
adpcm_yamaha mpeg2video roq_dpcm
alac mpeg4 rv10
alias_pix msmpeg4v2 rv20
amv msmpeg4v3 s302m
ass msvideo1 sgi
asv1 nellymoser snow
asv2 pam sonic
avrp pbm sonic_ls
avui pcm_alaw srt
ayuv pcm_f32be ssa
bmp pcm_f32le subrip
cinepak pcm_f64be sunrast
cljr pcm_f64le svq1
comfortnoise pcm_mulaw targa
dca pcm_s16be tiff
dnxhd pcm_s16be_planar tta
dpx pcm_s16le utvideo
dvbsub pcm_s16le_planar v210
dvdsub pcm_s24be v308
dvvideo pcm_s24daud v408
eac3 pcm_s24le v410
ffv1 pcm_s24le_planar vorbis
ffvhuff pcm_s32be wavpack
flac pcm_s32le webvtt
flashsv pcm_s32le_planar wmav1
flashsv2 pcm_s8 wmav2
flv pcm_s8_planar wmv1
g723_1 pcm_u16be wmv2
gif pcm_u16le xbm
h261 pcm_u24be xface
h263 pcm_u24le xsub
h263p pcm_u32be xwd
huffyuv pcm_u32le y41p
jpeg2000 pcm_u8 yuv4
jpegls pcx zlib
libfdk_aac pgm zmbv
libmp3lame
Enabled hwaccels:
Enabled parsers:
aac dvd_nav mpegvideo
aac_latm dvdsub opus
ac3 flac png
adx gsm pnm
bmp h261 rv30
cavsvideo h263 rv40
cook h264 tak
dca hevc vc1
dirac mjpeg vorbis
dnxhd mlp vp3
dpx mpeg4video vp8
dvbsub mpegaudio vp9
Enabled demuxers:
aac h261 mxg
ac3 h263 nc
act h264 nistsphere
adf hevc nsv
adp hls nut
adx hnm nuv
aea ico ogg
afc idcin oma
aiff idf paf
amr iff pcm_alaw
anm ilbc pcm_f32be
apc image2 pcm_f32le
ape image2_alias_pix pcm_f64be
apng image2_brender_pix pcm_f64le
aqtitle image2pipe pcm_mulaw
asf image_bmp_pipe pcm_s16be
ass image_dpx_pipe pcm_s16le
ast image_exr_pipe pcm_s24be
au image_j2k_pipe pcm_s24le
avi image_jpeg_pipe pcm_s32be
avr image_jpegls_pipe pcm_s32le
avs image_pictor_pipe pcm_s8
bethsoftvid image_png_pipe pcm_u16be
bfi image_sgi_pipe pcm_u16le
bink image_sunrast_pipe pcm_u24be
bintext image_tiff_pipe pcm_u24le
bit image_webp_pipe pcm_u32be
bmv ingenient pcm_u32le
boa ipmovie pcm_u8
brstm ircam pjs
c93 iss pmp
caf iv8 pva
cavsvideo ivf pvf
cdg jacosub qcp
cdxl jv r3d
cine latm rawvideo
concat live_flv realtext
data lmlm4 redspark
daud loas rl2
dfa lrc rm
dirac lvf roq
dnxhd lxf rpl
dsf m4v rsd
dsicin matroska rso
dts mgsts rtp
dtshd microdvd rtsp
dv mjpeg sami
dxa mlp sap
ea mlv sbg
ea_cdata mm sdp
eac3 mmf sdr2
epaf mov segafilm
ffm mp3 shorten
ffmetadata mpc siff
filmstrip mpc8 sln
flac mpegps smacker
flic mpegts smjpeg
flv mpegtsraw smush
fourxm mpegvideo sol
frm mpl2 sox
g722 mpsub spdif
g723_1 msnwc_tcp srt
g729 mtv stl
gif mv str
gsm mvi subviewer
gxf mxf subviewer1
sup vc1t webvtt
swf vivo wsaud
tak vmd wsvqa
tedcaptions vobsub wtv
thp voc wv
tiertexseq vplayer xa
tmv vqf xbin
truehd w64 xmv
tta wav xwma
tty wc3 yop
txd webm_dash_manifest yuv4mpegpipe
vc1
Enabled muxers:
a64 ipod pcm_s24le
ac3 ircam pcm_s32be
adts ismv pcm_s32le
adx ivf pcm_s8
aiff jacosub pcm_u16be
amr latm pcm_u16le
asf lrc pcm_u24be
asf_stream m4v pcm_u24le
ass matroska pcm_u32be
ast matroska_audio pcm_u32le
au md5 pcm_u8
avi microdvd psp
avm2 mjpeg rawvideo
bit mkvtimestamp_v2 rm
caf mlp roq
cavsvideo mmf rso
crc mov rtp
dash mp2 rtp_mpegts
data mp3 rtsp
daud mp4 sap
dirac mpeg1system segment
dnxhd mpeg1vcd smjpeg
dts mpeg1video smoothstreaming
dv mpeg2dvd sox
eac3 mpeg2svcd spdif
f4v mpeg2video spx
ffm mpeg2vob srt
ffmetadata mpegts stream_segment
filmstrip mpjpeg swf
flac mxf tee
flv mxf_d10 tg2
framecrc null tgp
framemd5 nut truehd
g722 oga uncodedframecrc
g723_1 ogg vc1
gif oma vc1t
gxf opus voc
h261 pcm_alaw w64
h263 pcm_f32be wav
h264 pcm_f32le webm
hds pcm_f64be webm_dash_manifest
hevc pcm_f64le webp
hls pcm_mulaw webvtt
ico pcm_s16be wtv
ilbc pcm_s16le wv
image2 pcm_s24be yuv4mpegpipe
image2pipe
Enabled protocols:
cache http rtmpt
concat httpproxy rtp
crypto icecast srtp
data md5 subfile
ffrtmphttp mmsh tcp
file mmst udp
ftp pipe udplite
gopher rtmp unix
hls
Enabled filters:
adelay dejudder pad
aecho delogo pan
aeval deshake perms
aevalsrc drawbox perspective
afade drawgrid phase
aformat earwax pixdesctest
ainterleave ebur128 pp
allpass edgedetect psnr
alphaextract elbg pullup
alphamerge equalizer removelogo
amerge extractplanes replaygain
amix fade rgbtestsrc
amovie field rotate
anull fieldmatch sab
anullsink fieldorder scale
anullsrc flanger select
apad format sendcmd
aperms fps separatefields
aphaser framepack setdar
aresample framestep setfield
aselect geq setpts
asendcmd gradfun setsar
asetnsamples haldclut settb
asetpts haldclutsrc showcqt
asetrate hflip showinfo
asettb highpass showspectrum
ashowinfo histeq showwaves
asplit histogram shuffleplanes
astats hqdn3d signalstats
astreamsync hqx silencedetect
atempo hue silenceremove
atrim idet sine
avectorscope il smartblur
bandpass interlace smptebars
bandreject interleave smptehdbars
bass join split
bbox kerndeint spp
biquad lenscorrection stereo3d
blackdetect life super2xsai
blackframe lowpass swapuv
blend lut telecine
boxblur lut3d testsrc
cellauto lutrgb thumbnail
channelmap lutyuv tile
channelsplit mandelbrot tinterlace
codecview mcdeint transpose
color mergeplanes treble
colorbalance movie trim
colorchannelmixer mp unsharp
colorlevels mpdecimate uspp
colormatrix mptestsrc vflip
compand negate vignette
concat noformat volume
copy noise volumedetect
crop null w3fdif
cropdetect nullsink xbr
curves nullsrc yadif
dctdnoiz overlay zoompan
decimate owdenoise
Enabled bsfs:
aac_adtstoasc imx_dump_header mp3_header_decompress
chomp mjpeg2jpeg noise
dump_extradata mjpega_dump_header remove_extradata
h264_mp4toannexb mov2textsub text2movsub
Enabled indevs:
dv1394 lavfi v4l2
fbdev oss
Enabled outdevs:
fbdev oss v4l2
License: nonfree and unredistributable
Creating config.mak, config.h, and doc/config.texi...
config.h is unchanged
config.asm is unchanged
libavutil/avconfig.h is unchangednow i am trying to run make command but getting the following error
make
POD doc/ffmpeg.pod
POD doc/ffprobe.pod
POD doc/ffserver.pod
POD doc/ffmpeg-all.pod
POD doc/ffprobe-all.pod
POD doc/ffserver-all.pod
MAN doc/ffmpeg.1
MAN doc/ffprobe.1
MAN doc/ffserver.1
MAN doc/ffmpeg-all.1
MAN doc/ffprobe-all.1
MAN doc/ffserver-all.1
LD ffmpeg_g
libavcodec/libavcodec.a(tiertexseqv.o): In function `seq_decode_op1':
/root/ffmpeg_sources/ffmpeg/libavcodec/tiertexseqv.c:111: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(xsubdec.o): In function `decode_frame':
/root/ffmpeg_sources/ffmpeg/libavcodec/xsubdec.c:121: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(xsubenc.o): In function `put_xsub_rle':
/root/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
/root/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
/root/ffmpeg_sources/ffmpeg/libavcodec/xsubenc.c:45: undefined reference to `ff_log2_tab'
libavcodec/libavcodec.a(aacps.o):/root/ffmpeg_sources/ffmpeg/libavcodec/aacps.c:196: more undefined references to `ff_log2_tab' follow
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1can anyone help me for it . thank you in advance
-
azap from LinuxTV dvb-apps strange signal behavior with Hauppauge WinTV-HVR 950Q [migrated]
27 février 2012, par mmomentWhat I want to do
I have a Hauppauge WinTV-HVR 950Q USB-TV-Stick. I want to use this stick to successively tune to and read in a certain live TV stream.
What I do
I trigger a scan and save the scan results in a file. I call it channels.conf, like the v4l documentary proposes.
scan /home/username/Documents/dvb/atsc/us-CA-SF-Bay-Area > /home/username/Documents/dvb/atsc/conf/home_channels.conf
Everything works fine, the scan returns something like this(A correct channel file) :
[0003]:503000000:8VSB:49:52:3
[0005]:503000000:8VSB:81:84:5
[0006]:503000000:8VSB:97:100:6
26 San Francisco, CA:551000000:8VSB:49:52:3
26 San Francisco, CA:551000000:8VSB:65:68:4
KTSF-D3:551000000:8VSB:81:84:5
KTSF-D4:551000000:8VSB:97:100:6
KTSF-D5:551000000:8VSB:113:116:7
KTSF-D6:551000000:8VSB:129:132:8
KPIX-DT:563000000:8VSB:49:52:1
KKPX ION:635000000:8VSB:49:52:3
KKPX qubo:635000000:8VSB:65:68:4
IONLife:635000000:8VSB:81:84:5
100:635000000:8VSB:487:488:100
200:635000000:8VSB:417:418:200
201:635000000:8VSB:422:423:201
202:635000000:8VSB:427:428:202
203:635000000:8VSB:432:433:203
204:635000000:8VSB:412:413:204
300:635000000:8VSB:442:443:300
400:635000000:8VSB:457:458:400
KSTS-HD:683000000:8VSB:49:52:3
Telemundo Exitos TV:683000000:8VSB:65:68:4
CNL-SOI:683000000:8VSB:81:84:5
KQEH:689000000:8VSB:49:52:1
KQED:689000000:8VSB:65:68:2
LIFE:689000000:8VSB:81:84:3
KIDS:689000000:8VSB:97:100:4
V-me:689000000:8VSB:113:116:5Then I tune to a channel from the scan results. KIDS for example :
azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS
What I expect the program to do :
I expect the program to be tuned and to deliver results similar to this :
username@username:~$ azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 689000000 Hz
video pid 0x0061, audio pid 0x0064
status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00dc | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
...What it does :
In 2 out of 5 tries the azap just doesn't work at all.
username@username:~$ azap -r -c Documents/dvb/atsc/conf/channels.conf KIDS
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 689000000 Hz
video pid 0x0061, audio pid 0x0064
status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 0000 | snr 00e4 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 0000 | snr 00c2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 0000 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
...The rest of the time it generally works initially, then switches the status to 00 and can not be used any more, even if there is incoming signal.
status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00d2 | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00c8 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00d2 | snr 00d2 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00dc | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00e6 | snr 00e6 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 00 | signal 00e6 | snr 00dc | ber 00000000 | unc 00000000 | FE_HAS_LOCK
...The output even shows that there is high signal to noise ratio, low or rather no block errors or uncorrected errors at all at first, then it
This keeps me wondering since I see no reason for the program to switch. After double checking with a real TV I am very sure that I always have an incoming signal and that there should not be any reasons for a behavior like this.Question
Can any of you guys see a reason for this behavior, could it be a problem with the Hardware that I'm using or rather a Software issue ? Did anybody experience the same issues, how did you fix it ? Any help is greatly appreciated !
-
How to create a widget – Introducing the Piwik Platform
4 septembre 2014, par Thomas Steur — DevelopmentThis is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a scheduled task in Piwik). This time you’ll learn how to create a new widget. For this tutorial you will need to have basic knowledge of PHP.
What is a widget in Piwik ?
Widgets can be added to your dashboards or exported via a URL to embed it on any page. Most widgets in Piwik represent a report but a widget can display anything. For instance a RSS feed of your corporate news. If you prefer to have most of your business relevant data in one dashboard why not display the number of offline sales, the latest stock price, or other key metrics together with your analytics data ?
Getting started
In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.
To summarize the things you have to do to get setup :
- Install Piwik (for instance via git).
- Activate the developer mode :
./console development:enable --full
. - Generate a plugin :
./console generate:plugin --name="MyWidgetPlugin"
. There should now be a folderplugins/MyWidgetPlugin
. - And activate the created plugin under Settings => Plugins.
Let’s start creating a widget
We start by using the Piwik Console to create a widget template :
./console generate:widget
The command will ask you to enter the name of the plugin the widget should belong to. I will simply use the above chosen plugin name “MyWidgetPlugin”. It will ask you for a widget category as well. You can select any existing category, for instance “Visitors”, “Live !” or “Actions”, or you can define a new category, for instance your company name. There should now be a file
plugins/MyWidgetPlugin/Widgets.php
which contains already some examples to get you started easily :- class Widgets extends \Piwik\Plugin\Widgets
- {
- /**
- * Here you can define the category the widget belongs to. You can reuse any existing widget category or define your own category.
- * @var string
- */
- protected $category = 'ExampleCompany';
- /**
- * Here you can add one or multiple widgets. You can add a widget by calling the method "addWidget()" and pass the name of the widget as well as a method name that should be called to render the widget. The method can be defined either directly here in this widget class or in the controller in case you want to reuse the same action for instance in the menu etc.
- */
- protected function init()
- {
- $this->addWidget('Example Widget Name', $method = 'myExampleWidget');
- $this->addWidget('Example Widget 2', $method = 'myExampleWidget', $params = array('myparam' => 'myvalue'));
- }
- /**
- * This method renders a widget as defined in "init()". It's on you how to generate the content of the widget. As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the "templates" directory of your plugin.
- *
- * @return string
- */
- public function myExampleWidget()
- {
- $view = new View('@MyWidgetPlugin/myViewTemplate');
- return $view->render();
- }
- }
As you might have noticed in the generated template we put emphasis on adding comments to explain you directly how to continue and where to get more information. Ideally this saves you some time and you don’t even have to search for more information on our developer pages. The category is defined in the property
$category
and can be changed at any time. Starting from Piwik 2.6.0 the generator will directly create a translation key if necessary to make it easy to translate the category into any language. Translations will be a topic in one of our future posts until then you can explore this feature on our Internationalization guide.A simple example
We can define one or multiple widgets in the
init
method by callingaddWidget($widgetName, $methodName)
. To do so we define the name of a widget which will be seen by your users as well as the name of the method that shall render the widget.protected $category = 'Example Company';
public function init()
{
// Registers a widget named 'News' under the category 'Example Company'.
// The method 'myCorporateNews' will be used to render the widget.
$this->addWidget('News', $method = 'myCorporateNews');
}
public function myCorporateNews()
{
return file_get_contents('http://example.com/news');
}This example would display the content of the specified URL within the widget as defined in the method
myCorporateNews
. It’s on you how to generate the content of the widget. Any string returned by this method will be displayed within the widget. You can use for example a View to render a Twig template. For simplification we are fetching the content from another site. A more complex version would cache this content for faster performance. Caching and views will be covered in one of our future posts as well.Did you know ? To make your life as a developer as stress-free as possible the platform checks whether the registered method actually exists and whether the method is public. If not, Piwik will display a notification in the UI and advice you with the next step.
Checking permissions
Often you do not want to have the content of a widget visible to everyone. You can check for permissions by using one of our many convenient methods which all start with
\Piwik\Piwik::checkUser*
. Just to introduce some of them :// Make sure the current user has super user access
\Piwik\Piwik::checkUserHasSuperUserAccess();
// Make sure the current user is logged in and not anonymous
\Piwik\Piwik::checkUserIsNotAnonymous();And here is an example how you can use it within your widget :
public function myCorporateNews()
{
// Make sure there is an idSite URL parameter
$idSite = Common::getRequestVar('idSite', null, 'int');
// Make sure the user has at least view access for the specified site. This is useful if you want to display data that is related to the specified site.
Piwik::checkUserHasViewAccess($idSite);
$siteUrl = \Piwik\Site::getMainUrlFor($idSite);
return file_get_contents($siteUrl . '/news');
}In case any condition is not met an exception will be thrown and an error message will be presented to the user explaining that he does not have enough permissions. You’ll find the documentation for those methods in the Piwik class reference.
How to test a widget
After you have created your widgets you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command
./console generate:test
to create a test. To manually test a widget you can add a widget to a dashboard or export it.Publishing your Plugin on the Marketplace
In case you want to share your widgets with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.
Advanced features
Isn’t it easy to create a widget ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can clarify parameters that will be passed to your widget, you can create a method in the Controller instead of the Widget class to make the same method also reusable for adding it to the menu, you can assign different categories to different widgets, you can remove any widgets that were added by the Piwik core or other plugins and more.
Would you like to know more about widgets ? Go to our Widgets class reference in the Piwik Developer Zone.
If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.