
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (40)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (7263)
-
How to write unit tests for your plugin – Introducing the Piwik Platform
17 novembre 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 verify user permissions). This time you’ll learn how to write unit tests in Piwik. For this tutorial you will need to have basic knowledge of PHP, PHPUnit and the Piwik platform.
When is a test a unit test ?
There are many different opinions on this and it can be sometimes hard to decide. At Piwik we consider a test as a unit test if only a single method or class is being tested and if a test does not have a dependency to the filesystem, web, config, database or to any other plugin.
If a test is slow it can be an indicator that it is not a unit test. “Slow” is of course a bit vague. We will cover how to write other type of tests, such as integration tests, in one of our next blog posts.
Getting started
In this post, we assume that you have already installed Piwik 2.9.0 or later via git, set up your development environment and created a plugin. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik and other Guides that help you to develop a plugin.
Let’s create a unit test
We start by using the Piwik Console to create a new unit test :
./console generate:test --testtype unit
The command will ask you to enter the name of the plugin the created test should belong to. I will use the plugin name “Insights”. Next it will ask you for the name of the test. Here you usually enter the name of the class you want to test. I will use “Widgets” in this example. There should now be a file
plugins/Insights/tests/Unit/WidgetsTest.php
which contains already an example to get you started easily :- /**
- * @group Insights
- * @group WidgetsTest
- * @group Plugins
- */
- class WidgetsTest extends \PHPUnit_Framework_TestCase
- {
- public function testSimpleAddition()
- {
- $this->assertEquals(2, 1+1);
- }
- }
We don’t want to cover how you should write your unit test. This is totally up to you. If you have no experience in writing unit tests yet, we recommend to read articles on the topic, or a book, or to watch videos or anything else that will help you learn best.
Running a test
To run a test we will use the command
tests:run
which allows you to execute a test suite, a specific file or a group of tests.To verify whether the created test works we will run it as follows :
./console tests:run WidgetsTest
This will run all tests having the group
WidgetsTest
. As other tests can use the same group you might want to pass the path to your test file instead :./console tests:run plugins/Insights/tests/Unit/Widgets.php
If you want to run all tests within your plugin pass the name of your plugin as an argument :
./console tests:run insights
Of course you can also define multiple arguments :
./console tests:run insights WidgetsTest
This will execute all tests within the insights plugin having the group WidgetsTest. If you only want to run unit tests within your plugin you can do the following :
./console tests:run insights unit
Advanced features
Isn’t it easy to create a unit test ? We never even created a file ! You can accomplish even more if you want : You can generate other type of tests, you can run tests on Amazon’s AWS and more. Unfortunately, not everything is documented yet so we recommend to discover more features by executing the commands
./console list tests
and./console help tests:run
.If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.
-
Ffmpeg error splitting into individual encoded frames
19 avril 2021, par Vainmonde De CourtenayI have a folder of
.png
images I wanted to make a series of.h264
frames (one frame per.png
). The frames are namedframe001.png
,frame002.png
, ...

First inside the folder containing the .png files I ran


ffmpeg -r 10 -i frame%3d.png -codec libx264 -r 10 video.h264 -y



which did its job, generating one
video.h264
. But now I want to divide that into many smaller .h264 files. Following this advice I tried

ffmpeg -i video.h264 -f image2 -vcodec copy -bsf h264_mp4toannexb frame%03d.h264



but I hit error


[image2 @ 0x55d2fc1f7b20] Application provided invalid, non monotonically increasing dts to muxer in stream 0: -2 >= -2



Full console debug :


# ffmpeg -i video.h264 -f image2 -vcodec copy -bsf h264_mp4toannexb fr%03d.h264
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Input #0, h264, from 'video.h264':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv444p(progressive), 480x852, 10 fps, 10 tbr, 1200k tbn, 20 tbc
Output #0, image2, to 'fr%03d.h264':
 Metadata:
 encoder : Lavf57.83.100
 Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv444p(progressive), 480x852, q=2-31, 10 fps, 10 tbr, 10 tbn, 10 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[image2 @ 0x55d2fc1f7b20] Application provided invalid, non monotonically increasing dts to muxer in stream 0: -2 >= -2
frame= 28 fps=0.0 q=-1.0 Lsize=N/A time=00:00:02.50 bitrate=N/A speed=1.58e+03x 
video:142kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown



I have tried the problem with multiple videos and the same thing. In fact when I check, the new files do appear. But they aren't really .h264's (just a few bytes large - appear to be ghost files) and I'm guessing this is down to the error displayed above.


-
Shotdetect : compiling error ("undefined reference")
8 juillet 2015, par VoprosnikI am using Cygwin and I trying to install the program Shotdetect. I downloaded the source with git and also downloaded, compiled and installed ffmpeg through git.
Installation of shotdetect doesn’t follow the ./configure && make && make install routine, but a cmake system of which I have no experience. Nonetheless there is a script that automates compiling and installation.
Near the final stages of the compiling, I get a long series of errors concerning some ffmpeg modules :
Linking CXX executable shotdetect-cmd.exe
/usr/local/lib/libavformat.a(matroskadec.o): In function `matroska_decode_buffer':
/git/ffmpeg/libavformat/matroskadec.c:1321: undefined reference to `BZ2_bzDecompressInit'
/git/ffmpeg/libavformat/matroskadec.c:1336: undefined reference to `BZ2_bzDecompress'
/git/ffmpeg/libavformat/matroskadec.c:1329: undefined reference to `BZ2_bzDecompressEnd'
/git/ffmpeg/libavformat/matroskadec.c:1339: undefined reference to `BZ2_bzDecompressEnd'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
/git/ffmpeg/libavcodec/opusdec.c:374: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_frame':
/git/ffmpeg/libavcodec/opusdec.c:220: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_init_resample':
/git/ffmpeg/libavcodec/opusdec.c:161: undefined reference to `swr_init'
/git/ffmpeg/libavcodec/opusdec.c:167: undefined reference to `swr_convert'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_frame':
/git/ffmpeg/libavcodec/opusdec.c:234: undefined reference to `swr_convert'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_flush_resample':
/git/ffmpeg/libavcodec/opusdec.c:115: undefined reference to `swr_convert'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
/git/ffmpeg/libavcodec/opusdec.c:406: undefined reference to `swr_close'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_flush':
/git/ffmpeg/libavcodec/opusdec.c:567: undefined reference to `swr_close'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_close':
/git/ffmpeg/libavcodec/opusdec.c:589: undefined reference to `swr_free'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_init':
/git/ffmpeg/libavcodec/opusdec.c:642: undefined reference to `swr_alloc'
/usr/local/lib/libavcodec.a(tiff.o): In function `tiff_uncompress_lzma':
/git/ffmpeg/libavcodec/tiff.c:396: undefined reference to `lzma_stream_decoder'
/git/ffmpeg/libavcodec/tiff.c:401: undefined reference to `lzma_code'
/git/ffmpeg/libavcodec/tiff.c:402: undefined reference to `lzma_end'
/usr/local/lib/libavcodec.a(utils.o): In function `recode_subtitle':
/git/ffmpeg/libavcodec/utils.c:2672: undefined reference to `libiconv_open'
/git/ffmpeg/libavcodec/utils.c:2707: undefined reference to `libiconv_close'
/git/ffmpeg/libavcodec/utils.c:2693: undefined reference to `libiconv'
/git/ffmpeg/libavcodec/utils.c:2694: undefined reference to `libiconv'
/git/ffmpeg/libavcodec/utils.c:2707: undefined reference to `libiconv_close'
/git/ffmpeg/libavcodec/utils.c:2707: undefined reference to `libiconv_close'
/git/ffmpeg/libavcodec/utils.c:2707: undefined reference to `libiconv_close'
/usr/local/lib/libavcodec.a(utils.o): In function `avcodec_open2':
/git/ffmpeg/libavcodec/utils.c:1698: undefined reference to `libiconv_open'
/git/ffmpeg/libavcodec/utils.c:1705: undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
CMakeFiles/shotdetect-cmd.dir/build.make:122: recipe for target 'shotdetect-cmd.exe' failed
make[2]: *** [shotdetect-cmd.exe] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/shotdetect-cmd.dir/all' failed
make[1]: *** [CMakeFiles/shotdetect-cmd.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2Searching online for similar errors, I found the following proposed solutions
1) fix pkg-config setup so configure will find out all dependencies ;
2) build ffmpeg (libavcodec) without external dependencies ;
3) add external dependencies manually with configure —extra-ldflags
I guess the problem lies on how i compiled ffmpeg (just configure with no options) but other than that have no idea what to do with either of the above suggestions. Should I recompile ffmpeg with different options ?