Recherche avancée

Médias (91)

Autres articles (71)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

  • Prérequis à l’installation

    31 janvier 2010, par

    Préambule
    Cet article n’a pas pour but de détailler les installations de ces logiciels mais plutôt de donner des informations sur leur configuration spécifique.
    Avant toute chose SPIPMotion tout comme MediaSPIP est fait pour tourner sur des distributions Linux de type Debian ou dérivées (Ubuntu...). Les documentations de ce site se réfèrent donc à ces distributions. Il est également possible de l’utiliser sur d’autres distributions Linux mais aucune garantie de bon fonctionnement n’est possible.
    Il (...)

Sur d’autres sites (6397)

  • Xuggler decoding h264 issues

    18 juin 2014, par Valenthorpe

    I’m trying to use Xuggler to transcode IP Camera rtsp streams to rtmp streams (all with h264 codecs). I currently have 2 IP cameras to test with, and wrote a basic Java program using Xuggler to do the transcoding of these streams.

    Here’s snippet of code in question :

       // Setup the Input Container
       InContainer = IContainer.make();
       if(InContainer.open(InUrl, IContainer.Type.READ, null, false, false) < 0)
       {
           System.err.println("Could not open input container");
           return false;
       }
       System.out.println("Input cointainer opened...");

       // Loop until we find the key packet
       IPacket keyPacket = IPacket.make();
       InContainer.readNextPacket(keyPacket);
       //System.out.println("Waiting on key frame...");
       //while(InContainer.readNextPacket(keyPacket) >= 0 && !keyPacket.isKeyPacket()) {
           //System.out.println(keyPacket.toString());
       //}
       System.out.println(keyPacket.toString());
       System.out.println(bytesToHex(keyPacket.getData().getByteArray(0, keyPacket.getData().getSize())));

       videoStreamId = -1;
       int numStreams = InContainer.getNumStreams();
       System.out.println("Num. Streams in Container: " + numStreams);
       for(int i = 0; i < numStreams; i++){
           IStream stream = InContainer.getStream(i);
           IStreamCoder coder = stream.getStreamCoder();

           if(coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO)
           {
               VideoDecoder = coder;
               videoStreamId = i;

               if(VideoDecoder.open(null, null) < 0){
                   System.err.println("Could not open video decoder for input container");
                   return false;
               }
               System.out.println("Video decoder opened...");
               // Need to decode at least one key frame
               IVideoPicture keyPicture = IVideoPicture.make(VideoDecoder.getPixelType(), 0, 0);
               int bytesDecoded = VideoDecoder.decodeVideo(keyPicture, keyPacket, 0);
               if(bytesDecoded < 0)
               {
                   throw new RuntimeException("Unable to decode key video packet");
               }

               System.out.println(DatatypeConverter.printBase64Binary(VideoDecoder.getExtraData().getByteArray(0, VideoDecoder.getExtraData().getSize())));
           }
           else // The stream has an unkown codec type, and no codec ID, we need to set the StreamCoder
           {
               coder.setCodec(ICodec.findDecodingCodec(ICodec.ID.CODEC_ID_H264));
               coder.setWidth(352);
               coder.setHeight(288);
               coder.setPixelType(IPixelFormat.Type.YUV420P);

               VideoDecoder = coder;
               videoStreamId = i;

               /*
               // Create the Extradata buffer
               byte[] start_sequence = new byte[]{0, 0, 1};
               byte[] extraData1 = DatatypeConverter.parseBase64Binary("Z0IAHtoFglMCKQI=");
               byte[] extraData2 = DatatypeConverter.parseBase64Binary("aN4Fcg==");
               int extraDataSize = extraData1.length + extraData2.length + start_sequence.length * 2;
               int destPos = 0;
               byte[] extraData = new byte[extraDataSize];
               System.arraycopy(start_sequence, 0, extraData, destPos, start_sequence.length);
               destPos += start_sequence.length;
               System.arraycopy(extraData1, 0, extraData, destPos, extraData1.length);
               destPos += extraData1.length;
               System.arraycopy(start_sequence, 0, extraData, destPos, start_sequence.length);
               destPos += start_sequence.length;
               System.arraycopy(extraData2, 0, extraData, destPos, extraData2.length);
               */
               if(VideoDecoder.open(null, null) < 0)
               {
                   System.err.println("Could not open video decoder for input container");
                   return false;
               }

               /*
               // Set the StreamCoder extradata
               IBuffer extraBuffer = IBuffer.make(null, extraData, 0, extraDataSize);
               int result = VideoDecoder.setExtraData(extraBuffer, 0, extraDataSize, true);
               if(result < 0)
               {
                   System.err.println("Could not set the coder ExtraData");
               }
               else
               {
                   System.out.println("VideoDecoder ExtraData set!");
               }*/

               //System.out.println(DatatypeConverter.printBase64Binary(VideoDecoder.getExtraData().getByteArray(0, VideoDecoder.getExtraData().getSize())));

               IVideoPicture keyPicture = IVideoPicture.make(VideoDecoder.getPixelType(), VideoDecoder.getWidth(), VideoDecoder.getHeight());
               int bytesDecoded = VideoDecoder.decodeVideo(keyPicture, keyPacket, 0); //key/keyPacket
               if(bytesDecoded < 0)
               {
                   throw new RuntimeException("Unable to decode key video packet");
               }
           }

       }

    This program is able to successfully transcode one of the camera’s streams without any problems.
    The other, however, has been giving me constant headaches for several days now. In the loop to look at the container’s streams, I have an else statement because the problem stream has CODEC_TYPE_UNKOWN and CODEC_ID_NONE, so i thought i would need to set everything manually. I’ve gotten all kinds of errors such as :

    15:22:36.964 [main] ERROR org.ffmpeg - [h264 @ 0000000000423870] no frame!

    I get this error EVERY time i try to decode a frame. I realize this usually means that no key frames have been read and that the decoder needs the SPS/PPS information for h264 decoding, which i’ve tried to manually set (you can see in one of the commented sections), but with no success.
    I’ve even tried creating a packet, filling it with the SPS/PPS info, setting the key packet to true, etc... also with no success. Even in the while loop (currently commented out) the program never seems to get a key frame from the one camera.

    I’ve also gotten this warning from Xuggler :

    16:22:43.412 [main] WARN  com.xuggle.xuggler - Could not find streams in input container (../../../../../../../csrc/com/xuggle/xuggler/Container.cpp:898)

    ... which i’ve also looked into but none of the solutions i’ve seen have worked.

    I’ve tried running both of these camera’s streams through FFMPEG itself in the command line
    and both are transcoded with no errors. I also thought that maybe Xuggler was built with too old of a version of FFMPEG to support rtsp streaming properly, but i went back and downloaded many of the older builds (0.10, 1.0.1 - 1.2, and current 2.2) and tried through the command line and all have succeeded.

    I’ve seen a lot of threads across the Xuggler google group that address problems with rtsp streams and the "no frame !" error, but none of them have had a solution (or at least one that worked for me).
    Does anyone have any idea what might be causing this ? I have absolutely no ideas left ! (First time posting here as well, my apologies if I did anything incorrectly or left out information) Thanks.

  • AVI video streaming over internet with FFMPAG/AVCONV or NGINX RTMP servers

    20 mai 2014, par Emmanuel Brunet

    I’ve got a general question regarding video streaming, FFMPEG/AVCONV and RTMP.

    I’ve read a lot of posts since several days to find out how to stream video over internet. But no answer fit my needs. I found examples with.mp4 to web/flv conversion .. and so on but none that works withe AVI real time video streaming.

    I need a straightforward example to put this in place.

    How to set up AVI video streaming over internet with much browser compatibility as possible using ffmpeg/avconv on debian / ubuntu and if possible the NGINX RTMP server ?

    I’ve set up an NGINX-1.70 server on debian (but could use another one), added the RTMP module configured with only the basic examples and I’d like to use FFMPEG (avconf) to convert AVI videos on the fly and make them available for streaming over internet (in a format that can be displayed by a wide range of browsers).

    Up to now, I understand that I need to setup a streaming server (ffmpeg/avconv server ?) or NGINX (my favorite), to convert videos on the fly with a bunch of horrible ffmpeg options and connect the output stream to the streaming server. That’s all ... still a long way to go to work out what I’m expecting !

    How can I do that ?

    Thanks for your help

  • Piwik 2.1 – Changes for Plugin developers

    24 février 2014, par Piwik Core Team — Development

    This blog post is aimed at developers of Piwik Plugins. If you are simply using Piwik and not developing plugins for Piwik, you do not need to read this post.

    Piwik 2.1 will be released in a few days . This blog post will inform Piwik Plugin developers of the changes in Piwik 2.1 that may require that you update your plugin to work with this latest version.

    Breaking API changes

    Piwik can now handle an unlimited number of users having Super User access (#2589 #4564). In the past Piwik was limited to one Super User who was defined in the config file. From now on all users with Super User access are defined in the database the same way a regular user is. This brought some API changes but we will stay backward compatible until the first of April 2014. This gives you some time to migrate any custom plugins you may use. Although there is a layer for backward compatibility we recommend to make sure your plugin works with Piwik as soon as possible before April 1st.

    List of changes

    Deprecated methods

    The following methods are deprecated and we recommend to use the new methods from now on. There are also some methods which won’t be replaced so make sure to adjust the logic of your plugin.

    \Piwik\Piwik::isUserIsSuperUser => \Piwik\Piwik::hasUserSuperUserAccess
    \Piwik\Piwik::setUserIsSuperUser => \Piwik\Piwik::setUserHasSuperUserAccess
    \Piwik\Piwik::checkUserIsSuperUser => \Piwik\Piwik::checkUserHasSuperUserAccess
    \Piwik\Access::isSuperUser => \Piwik\Access::hasSuperUserAccess
    \Piwik\Access::checkUserIsSuperUser => \Piwik\Access::checkUserHasSuperUserAccess
    \Piwik\Access::setSuperUser => \Piwik\Access::setSuperUserAccess
    \FakeAccess::checkUserIsSuperUser => FakeAccess::checkUserHasSuperUserAccess
    \FakeAccess::setSuperUser => FakeAccess::setSuperUserAccess
    \Piwik\Piwik::isUserIsSuperUserOrTheUser => \Piwik\Piwik::hasUserSuperUserAccessOrIsTheUser
    \Piwik\Piwik::checkUserIsSuperUserOrTheUser => \Piwik\Piwik::checkUserHasSuperUserAccessOrIsTheUser
    \FakeAccess::getSuperUserLogin => No replacement
    \Piwik\Piwik::getSuperUserLogin => No replacement, returns the userLogin of the first Super User we find in the database
    \Piwik\Piwik::getSuperUserEmail => No replacement, returns an empty string from now on
    \Piwik\Access::getSuperUserLogin => No replacement, returns the userLogin of the first Super User we find in the database

    Config Super User

    As mentioned, the Super User was defined in the config and you have accessed the Super User’s data either by using a convenient method like Piwik::getSuperUserLogin or directly via the Config object as follows :

    \Piwik\Config::getInstance->superUser

    As the config user is no longer defined in the config this will no longer work in the future. To stay backward compatible we return the first super user found in the database. This is not necessarily always the same user. So if you have used the super user login in some way in your plugin, make sure you are using the new function such as Piwik::getSuperUserLogin

    Extended Auth Interface

    The last change affects plugins who specify their own Authentication mechanism, for instance when using the custom LoginLDAP plugin. From now on the interface \Piwik\Auth (​https://github.com/piwik/piwik/blob/master/core/Auth.php) requires the methods setTokenAuth and setLogin. There is no backward compatibility layer but we had a look at some plugins defining a custom Authentication adapter to make sure those methods are already defined there as expected.

    For another example of a Login plugin, check out the LoginHttpAuth plugin on the Marketplace.

    After updating the plugin

    After you have made changes in your plugin to keep it compatible with Piwik 2.1, your plugin will no longer work with previous Piwik versions. Therefore you should define the minimum required version in your plugin.json file as follows :

    "require": {
    "piwik": ">=2.1"
    }

    Summary

    Piwik 2.1 introduces some changes in the Piwik Core APIs. This blog post explains how to modify any Plugins compatible with Piwik 2.0 to be compatible with Piwik 2.1. Thank you for taking the time to update your plugins !

    Let us know if you have any feedback. Happy hacking !

    PS : if you use the Web Analytics APIs and the Web Tracking APIs, we guarantee that we will support backwards compatibility of our Web APIs.