
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (55)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (2874)
-
How to add new pages and menu items to Piwik – Introducing the Piwik Platform
11 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 widget). This time you’ll learn how to extend Piwik by adding new pages and menu items. For this tutorial you will need to have basic knowledge of PHP and optionally of Twig which is the template engine we use.
What can be displayed in a page ?
To make it short : You can display any corporate related content, key metrics, news, help pages, custom reports, contact details, information about your server, forms to manage any data and anything else.
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="MyControllerPlugin"
. There should now be a folderplugins/MyControllerPlugin
. - And activate the created plugin under Settings => Plugins.
Let’s start creating a page
We start by using the Piwik Console to create a new page :
./console generate:controller
The command will ask you to enter the name of the plugin the controller should belong to. I will simply use the above chosen plugin name “MyControllerPlugin”. There should now be two files
plugins/MyControllerPlugin/Controller.php
andplugins/MyControllerPlugin/templates/index.twig
which both already contain an example to get you started easily :Controller.php
- class Controller extends \Piwik\Plugin\Controller
- {
- public function index()
- {
- 'answerToLife' => 42
- ));
- }
- }
and templates/index.twig
- {% extends 'dashboard.twig' %}
- {% block content %}
- <strong>Hello world!</strong>
- <br/>
- The answer to life is {{ answerToLife }}
- {% endblock %}
Note : If you are generating the Controller before Piwik 2.7.0 the example will look slightly different.
The controller action
index
assigns the view variableanswerToLife
to the view and renders the Twig templatetemplates/index.twig
. Any variable assigned this way can then be used in the view using for example{{ answerToLife }}
.Using a Twig template to generate the content of your page is actually optional : instead feel free to generate any content as desired and return a string in your controller action.
As the above template
index.twig
is extending the dashboard template the Logo as well as the top menu will automatically appear on top of your content which is defined within the blockcontent
.How to display the page within the admin
If you would like to add the admin menu on the left you have to modify the following parts :
- Extend
\Piwik\Plugin\ControllerAdmin
instead of\Piwik\Plugin\Controller
in the fileController.php
. In a future version of Piwik this step will be no longer neccessary, see #6151 - Extend the template
admin.twig
instead ofdashboard.twig
- Define a headline using an H2-element
- {% extends 'admin.twig' %}
- {% block content %}
- <h2>Hello world!</h2>
- <br/>
- The answer to life is {{ answerToLife }}
- {% endblock %}
Note : Often one needs to add a page to the admin to make a plugin configurable. We have a unified solution for this using the Settings API.
How to display a blank page
If you would like to generate a blank page that shows only your content the template should contain only your markup as follows :
- <strong>Hello world!</strong>
- <br/>
- The answer to life is {{ answerToLife }}
Predefined variables, UI components, security and accessing query parameters
In this blog post we only cover the basics to get you started. We highly recommend to read the MVC guide on our developer pages which covers some of those advanced topics. For instance you might be wondering how to securely access
$_GET
or$_POST
parameters, you might want to restrict the content of your page depending on a user role, and much more.If you would like to know how to make use of JavaScript, CSS and Less have a look at our Working with Piwik’s UI guide.
Note : How to include existing UI components such as a site selector or a date selector will be covered in a future blog post. Also, there are default variables assigned to the view depending on the context. A list of those variables that may or may not be defined is unfortunately not available yet but we will catch up on this.
Let’s add a menu item to make the page accessible
So far you have created a page but you can still not access it. Therefore we need to add a menu item to one of the Piwik menus. We start by using the Piwik Console to create a menu template :
./console generate:menu
The command will ask you to enter the name of the plugin the menu should belong to. I will use again the above chosen plugin name “MyControllerPlugin”. There should now be a file
plugins/MyControllerPlugin/Menu.php
which contains an example to get you started easily :Menu.php
- class Menu extends \Piwik\Plugin\Menu
- {
- public function configureUserMenu(MenuUser $menu)
- {
- // reuse an existing category.
- $menu->addManageItem('My User Item', $this->urlForAction('showList'));
- // or create a custom category
- $menu->addItem('My Custom Category', 'My User Item', $this->urlForDefaultAction());
- }
- }
This is only a part of the generated template since all the examples of the different menus are similar. You can add items to four menus :
configureReportingMenu
To add a new item to the reporting menu which includes all the reports like “Actions” and “Visitors”.configureAdminMenu
To add a new item to the admin menu which includes items like “User settings” and “Websites”.configureTopMenu
To add a new item to the top menu which includes items like “All Websites” and “Logout”.configureUserMenu
To add a new item to the user menu which is accessible when clicking on the username on the top right.
In this blog post we will add a new item to the user menu and to do so we adjust the generated template like this :
- class Menu extends \Piwik\Plugin\Menu
- {
- public function configureUserMenu(MenuUser $menu)
- {
- $menu->addManageItem('My User Item', $this->urlForAction($method = 'index'), $orderId = 30);
- }
- }
That’s it. This will add a menu item named “My User Item” to the “Manage” section of the user menu. When a user chooses the menu item, the “index” method of your controller will be executed and your previously created page will be first rendered and then displayed. Optionally, you can define an order to influence the position of the menu item within the manage section. Following this example you can add an item to any menu for any action. I think you get the point !
Note : In Piwik 2.6.0 and before the above example would look like this :
- class Menu extends \Piwik\Plugin\Menu
- {
- public function configureUserMenu(MenuUser $menu)
- {
- $menu->addManageItem('My User Item', array($module = 'MyControllerPlugin', $action = 'index'), $orderId = 30);
- }
- }
How to test a page
After you have created your page you are surely wondering how to test it. A controller should be usually very simple as it is only the connector between model and view. Therefore, we do usually not create unit or integration test for controllers and for the view less than ever. Instead we would create a UI test that takes a screenshot of your page and compares it with an expected screenshot. Luckily, there is already a section UI tests in our Automated tests guide.
Publishing your Plugin on the Marketplace
In case you want to share your page 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 page ? 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 make use of Vanilla JavaScript, jQuery, AngularJS, Less and CSS, you can reuse UI components, you can access query parameters and much more.
Would you like to know more about this ? Go to our MVC (Model-View-Controller) and Working with Piwik’s UI guides 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.
-
Parsing custom track data from ARCore mp4 recordings
11 juillet 2022, par George EllicksonI'm using the Android ARCore Recording API to record custom data per frame and replay those values in tests to instrument test our ARCore functionality on devices and in CI. However, separately I'd also like to parse the generated mp4 recordings myself, outside of ARCore, and use my per frame recorded data for analysis. In my ARCore app, I'd like to simply be able to add custom text data like following, encoded as utf-8 strings (or really any other simple encoding) for the given ARCore frame :


val data = "Hello world!"
val buffer = ByteBuffer.wrap(data.encodeToByteArray())
frame.recordTrackData(TRACK_UUID_MY_DATA, buffer



I can't find any docs or good examples though of parsing the mp4 from ARCore and no luck in their arcore-android-sdk repo either. I've tried ffmpeg / ffprobe to figure out how the data is bundled into the MP4, but I'm stumped on which track to use and how best to deserialize as I'm unsure how the bytes are actually encoded under the hood.


Using ffmpeg, I just get information like this about the tracks :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'HoverCapture/ar-recording-tests/src/androidTest/res/raw/ar_recording_2_photos.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2022-01-20T22:03:13.000000Z
 Duration: 00:00:17.12, start: 0.000000, bitrate: 26865 kb/s
 Stream #0:0[0x1](und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown, progressive), 1920x1080, 25615 kb/s, 28.08 fps, 29.58 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Data: none (mett / 0x7474656D), 18 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 Stream #0:2[0x3](und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown, progressive), 640x480, 1929 kb/s, 28.12 fps, 29.42 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 vendor_id : [0][0][0][0]
 Stream #0:3[0x4](und): Data: none (mett / 0x7474656D), 18 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 Stream #0:4[0x5](und): Data: none (mett / 0x7474656D), 54 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 Stream #0:5[0x6](und): Data: none (mett / 0x7474656D), 54 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 Stream #0:6[0x7](und): Data: none (mett / 0x7474656D), 0 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.
 Stream #0:7[0x8](und): Data: none (mett / 0x7474656D), 6 kb/s (default)
 Metadata:
 creation_time : 2022-01-20T22:03:13.000000Z
 handler_name : ISO Media file produced by Google Inc. Created on: 01/20/2022.



-
Compiling FFmpeg staticly using NDK
27 février 2017, par David BarishevI have been trying to compile ffmpeg into a static library in order to use it in my android application, but i couldn’t get it to work.
Im working with FFmpeg 3.2.4, and ndk r13b, using bash on windows 10(Ubuntu 14.04).
Here is what i did :
-
I made a stand alone toolchain for x86_64 and api 21 using :
python make_standalone_toolchain.py --api 21 --arch x86_64 --install-dir {}
-
Made a configuration script :
./configure \
--target-os=linux \
--arch=x86 \
--prefix=<output path="path"> \
--cross-prefix=<stand alone="alone" toolchain="toolchain" path="path">/bin/x86_64-linux-android- \
--sysroot=<stand alone="alone" toolchain="toolchain" path="path">/sysroot \
--enable-cross-compile \
--pkg-config-flags="--static" \
--enable-yasm \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
make install
</stand></stand></output>
It produced an FFmpeg executable, however when i ran it on my API 23 emulator, i got an error message :
error: only position independent executables (PIE) are supported.
How can i fix it ? Also i’m not sure about my configuration, there wasn’t up to date sources on how to compile it correctly for every ABI (arm,arm64,x86,x86_64,mips,mips64) that i need for my application.
I have seen many script, and im not too familiar with compiling native code, so i wasn’t sure what settings i need, for example like C flags and etc.To be precise on how i tried to configure FFmpeg :
- I need a static library
- I Only need the ffmpeg command line utility
- I want to compile the library for every ABI i listed above.This configuration tried to compile for x86_64.
- Running on android of course
I would greatly appreciate some help on how to configure and compile this correctly.
EDIT
I tried compiling for x86, on an Ubuntu 16.04 (x86_64) VM, using roughly the same config , and i got a different error.
I made a standalone toolchain for x86 :
python make_standalone_toolchain.py --arch x86 --api 19 --install-dir ~/x86_toolchain
And made this configuration file :
./configure \
--target-os=linux \
--arch=x86 \
--prefix=~/ffmpeg_x86_build \
--cross-prefix=~/x86_toolchain/bin/i686-linux-android- \
--sysroot=~/x86_toolchain/sysroot \
--enable-cross-compile \
--pkg-config-flags="--static" \
--enable-yasm \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages \
make clean
make installThe error im getting now is :
~/x86_toolchain/bin/i686-linux-android-gcc is unable to create an executable file.
C compiler test failed.In the log file, it seems like it cant access the compiler, even though he is OK (i tested it with a simple hello world).Also its not a permission problem(Everybody has read write access)
~/x86_toolchain/bin/i686-linux-android-gcc -fPIC -c -o /tmp/ffconf.yYKPHtht.o /tmp/ffconf.Nxskyxyb.c
./configure: 874: ./configure: ~/x86_toolchain/bin/i686-linux-android-gcc: not found
C compiler test failed.So i’m clearly doing something wrong.Does anyone know why ? And how should i do it instead ?
-