Recherche avancée

Médias (91)

Autres articles (49)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (9017)

  • 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.

  • Excluding ARMv5 and ARMv6 devices from Google Play

    14 mai 2015, par Taras

    I build a ffmpeg based library for my project and the outputs are really huge. Is it OK to remove the support of old arm processors and leave only arm-v7 and x86 libraries ?

    I suspect that arm-v7 won’t work on older arm processors.

    The application min sdk is 4.0.3 and the question is whether the percentage of devices with old ARM is too small so I can filter them out on Google Play ?

  • ffmpeg static build produces huge files

    3 mai 2014, par user3581244

    I’ve recently managed to get a static build of ffmpeg installed on an EC2 instance :

    http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.2014-03-05.tar.gz

    But when I perform this command on a video file :

    ffmpeg -ss 00:00:00 -i VIDEO0031.mp4 -r 8 -vframes 32 -vbsf remove_extra -an -vcodec pam -f rawvideo -y test_002.pam

    It produces a file that is 190MB which is huge and then it messes up the other commands I use to convert it into a gif file.

    Does anyone know if this is just an issue with using a static build ? I didn’t experience this issue using an older ffmpeg install ( v0.6 I believe ) so am tempted to go back to the old install but I also need to have ffprobe installed so am worried this would cause issues.

    A bit of a random question but I thought it was worth asking just in case someone had come across a similar thing.

    Thanks !