Recherche avancée

Médias (0)

Mot : - Tags -/albums

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (30)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (3574)

  • How to create a custom theme in Piwik – Introducing the Piwik Platform

    23 août 2014, par Thomas Steur — Development

    This is the start of a new blog series where we introduce the capabilities of the Piwik platform. You’ll learn how to write custom plugins & themes, how to use our HTTP APIs and more.

    We have been greatly simplifying our APIs over the last year focusing primarily on one design principle :

    The complexity of our API should never exceed the complexity of your use case.

    In other words, if you have a simple use for our API, we want it to be simple for you to accomplish it. If you have a complex, big, hairy, change-the-world idea, then maybe we can’t make it simple for you to accomplish it, but we want it to be possible.

    Over the next weeks and months you will learn what exactly we mean by this and how we accomplished it.

    FYI, don’t worry if you’re currently using our APIs, we keep them backwards compatible and we announce breaking changes in our platform changelog.

    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.
    • And if you want, generate some test data : ./console visitorgenerator:generate-visits --idsite=1 --limit-fake-visits=600. This can take a while and requires the VisitorGenerator plugin from the Marketplace.

    Let’s start creating our own theme

    We start by using the Piwik Console to create a blank theme :

    ./console generate:theme

    The command will ask you to enter a name, description and version number for your theme. I will simply use “CustomTheme” as the name of the theme. There should now be a folder plugins/CustomTheme which contains some files to get you started easily.

    Before we modify our theme, we have to activate it by visiting the Settings => Themes admin page in our Piwik installation, or alternatively by running the command ./console core:plugin activate YourCustomTheme. If the theme is not activated, we won’t see any changes.

    Theme Contents

    The most important files in our theme are plugins/CustomTheme/stylesheets/theme.less, plugins/CustomTheme/stylesheets/_colors.less and plugins/CustomTheme/stylesheets/_variables.less :

    • theme.less is the file that will be included when your theme is activated. In this file you would include other stylesheet files and overwrite CSS styles.
    • _colors.less contains many less variables allowing you to easily change the colors Piwik uses.
    • _variables.less contains currently only one variable to change the font family. More variables will be added in the future. Note : This is a new feature and the file will be only there in case you have installed Piwik using Git or at least Piwik 2.6.0.

    Changing the font family

    To change the font family simply overwrite the variable @theme-fontFamily-base: Verdana, sans-serif; in _variables.less. That’s it.

    Changing colors

    To change a color, uncomment the less variables of the colors you want to change in _colors.less. I will shortly explain some of them. Usually changing only these colors will be enough to adjust Piwik’s look to your corporate design or to create a look that pleases you :

    @theme-color-brand:                    #d4291f; // The Piwik red which is for instance used in the menu, it also defines the color of buttons, the little arrows and more
    @theme-color-brand-contrast:           #ffffff; // Contrast color to the Piwik red. Usually you need to change it only in case you define a light brand color. For instance to change the text color of buttons
    @theme-color-link:                     #1e93d1; // The link color which is usually a light blue

    @theme-color-widget-title-text:        #0d0d0d; // The text and background color of the header of a widget (Dashboard)
    @theme-color-widget-title-background:  #f2f2f2;

    @theme-color-menu-contrast-text:       #666666; // The text color of a menu item in the reporting sub menu and the admin menu
    @theme-color-menu-contrast-textActive: #0d0d0d; // The text color of an active menu item
    @theme-color-menu-contrast-background: #f2f2f2; // The background color of a menu item

    @graph-colors-data-series[1-8]:        #000000; // The different colors used in graphs

    Making the change visible

    To make a color or font change actually visible when you reload a page in Piwik you will have to delete the compiled CSS file after each change like this :

    rm tmp/assets/asset_manager_global_css.css

    Publishing your Theme on the Marketplace

    In case you want to share your theme with other Piwik users you can do this by pushing your theme to GitHub and creating a tag. Easy as that. Read more about how to distribute a theme.

    Advanced features

    Isn’t it easy to create a custom theme ? All we had to do is to change some less variables. We never even created a file ! Of course, based on our API design principle, you can accomplish more if you want. For instance, you can change icons, CSS stylesheets, templates and more.

    For further customising your Piwik, you can even change the logo and favicon in the Settings => General settings page.

    Would you like to know more about theming ? Go to our Theme guide 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.

    PS : see also this related FAQ : How do I White Label Piwik ?

  • IContainer.open() fails when using with custom ByteChannel to read from

    13 août 2014, par AnilJ

    I am trying to open an IContainer object which is reading from a custom input buffer rather than reading from a media file. The implementation for this custom input buffer is as below.

    The code to create and open the container is as below.

    // Open up the container for READING
    mInputCStore = new CStore();

    IContainerFormat format = IContainerFormat.make();
    if (format.setInputFormat("flv") < 0) {
       throw new IllegalArgumentException("Failed to initialize the input format");
    }

    // Open up the container
    mInputContainer = IContainer.make();
    int retval = mInputContainer.open(mPlaybackContainerStore, IContainer.Type.READ, format);      
    if (retval < 0) {
       // This little trick converts the non friendly integer return value into  
       // a slightly more friendly object to get a human-readable error name
       IError error = IError.make(retval);
       throw new IllegalArgumentException("could not open input container: " + mPlaybackContainerStore + "; Error: " + error.getDescription());
    }

    The above code throwing an exception saying that —

    Exception in thread "main" java.lang.IllegalArgumentException: could not open input container: com.client.video.ContainerStore@61981853; Error: Operation not permitted

    The same custom buffer when used while writing to the container is working successfully. Can someone pls help me understand what is missing in the custom buffer implementation, as far as using it in READ mode and why the reason it is failing ?

    package test;

    import java.io.IOException;
    import java.nio.ByteBuffer;
    import java.nio.channels.ByteChannel;
    import java.util.concurrent.ConcurrentLinkedQueue;

    public class CStore implements ByteChannel {
       private ConcurrentLinkedQueue<datachunk> mChunkQueue = null;
       private int mQueueSize = 0;

       // constructor
       public CStore(String type) {
           mQueueSize = 0;
           mChunkQueue = new ConcurrentLinkedQueue<datachunk>();
           mChunkQueue.clear();
       }

       @Override
       public void close() throws IOException {
           return;
       }

       @Override
       public boolean isOpen() {
           return false;
       }

       @Override
       public int write(ByteBuffer buffer) throws IOException {
           DataChunk chunk = new DataChunk(buffer);
           mChunkQueue.add(chunk);
           mQueueSize += chunk.getLength();
           return 0;
       }

       public int read(ByteBuffer buffer) throws IOException {

           int result = 0;

           DataChunk chunk = mChunkQueue.poll();
           if (chunk != null) {
               buffer = chunk.getBuffer();
               if (buffer != null) {
                   result = 0;
               } else {
                   result = 1;
               }
           }

           return result;
       }
    }
    </datachunk></datachunk>
  • MOOV atom is not being written to the output.

    18 juillet 2014, par AnilJ

    I am facing a problem where a MOOV atom is not written to the end of the file, and the file is not playable by the vlc player. Also, FFmpeg command gives me the following error.

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2334ba0] moov atom not found
    queueout/1000_wrecord.mp4: Invalid data found when processing input

    In my design, I am using an object of DataChunkQueue class to initialize the IContainer object, where it writes into this queue when it calls IContainer.WritePacket(packet) method. Finally when the recording is complete, I am flushing out this queue into a file. However, when I try to play the file, above error is thrown. When I test with the FLV file type however, I am able to playout the file correctly.

    I am not sure what is the issue with the MP4 file and why it does not write the MOOV item to the end. Can anyone offer me an suggestions as to how this can be resolved ?

    I am pasting below some of the code snippets for reference.

    public class DataChunkQueue implements ByteChannel {

       private ConcurrentLinkedQueue<datachunk> mChunkQueue = null;
       private static String BASE_PATH = null;
       private static String mOutputFileName = null;
       private FileChannel mOutputFileChannel = null;

       // constructor
       public DataChunkQueue() {
           mChunkQueue = new ConcurrentLinkedQueue<datachunk>();
       }

       @Override
       public void close() throws IOException {
           return;
       }

       @Override
       public boolean isOpen() {
           return true;
       }

       @Override
       public int write(ByteBuffer buffer) throws IOException {
           DataChunk vChunk = new DataChunk(buffer);
           mChunkQueue.add(vChunk);    
           return 0;
       }

       public int read(ByteBuffer buffer) throws IOException {

           int result = 0;

           buffer = mChunkQueue.poll().GetBuffer();
           if (buffer != null ) {
               result = 0;
           } else {
               result = 1;
           }

           return result;
       }
    }

    private boolean InitStreamEncoder() {

       DataChunkQueue mOutQueue = null;
       // Change this to change the frame rate you record at
       mFrameRate = IRational.make(Constants.FRAME_RATE, 1);

       // try opening a container format
       mOutFormat = IContainerFormat.make();
       mOutFormat.setOutputFormat(mRecordFormat, null, null);

       // Initialize the output container.
       mOutputContainer = IContainer.make();
       int retval = mOutputContainer.open(mOutQueue, IContainer.Type.WRITE, mOutFormat);
       if (retval &lt; 0)
           throw new RuntimeException("could not open data output stream buffer");

       // Guess the Encoding CODEC based on the type of input file.
       ICodec videoCodec = ICodec.guessEncodingCodec(null, null, ("out." + mRecordFormat), null, ICodec.Type.CODEC_TYPE_VIDEO);
       if (videoCodec == null)
           throw new RuntimeException("could not guess a codec");

       // Initialize the encoding parameters.
       mOutStream = mOutputContainer.addNewStream(videoCodec);
       mOutStreamCoder = mOutStream.getStreamCoder();

       mOutStreamCoder.setNumPicturesInGroupOfPictures(Constants.GOP);
       mOutStreamCoder.setCodec(videoCodec);

       //mOutStreamCoder.setBitRate(Constants.BITRATE);
       //mOutStreamCoder.setBitRateTolerance(Constants.TOLERANCE);
       mOutStreamCoder.setPixelType(IPixelFormat.Type.YUV420P);
       mOutStreamCoder.setWidth(Constants.MAIN_SCREEN_WIDTH);
       mOutStreamCoder.setHeight(Constants.MAIN_SCREEN_HEIGHT);
       //mOutStreamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
       //mOutStreamCoder.setGlobalQuality(0);

       mOutStreamCoder.setFrameRate(mFrameRate);
       mOutStreamCoder.setTimeBase(IRational.make(mFrameRate.getDenominator(), mFrameRate.getNumerator()));

       retval = mOutStreamCoder.open(null, null);
       if (retval &lt; 0) {
           System.out.println("could not open input decoder");
           return false;      
       }

       retval = mOutputContainer.writeHeader();
       if (retval &lt; 0) {
           System.out.println("could not write file header");
           return false;
       }

       return true;
    }
    </datachunk></datachunk>

    This function is called at the very end to write the trailer.

    public void Cleanup() {
       if (mOutputContainer != null) {
           mOutputContainer.flushPackets();
           mOutputContainer.writeTrailer();
           mOutputContainer.close();
       }

       if (mOutStreamCoder != null) {
           mOutStreamCoder.close();
           mOutStreamCoder = null;
       }
    }