Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (57)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • 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 (5956)

  • FFmpeg : undefined references to av_frame_alloc()

    6 août 2014, par dontrythisathome

    I want to get into FFmpeg developing and i started following these samples tutorial here : here

    I started with the first tutorial - tutorial01.c - but i run into this problem ’undefined references to av_frame_alloc()’.

    I’m on Ubuntu 12.04 LTS.

    This is my program :

    /*
    * File:   main.c
    * Author: dontrythisathome
    *
    * Created on 3 giugno 2014, 23.02
    */

    #include
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libavutil></libavutil>frame.h>
    #include <libswscale></libswscale>swscale.h>
    /*
    *
    */
    void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
       {
           FILE   *pFile;
           char  szFilename[32];
           int       y;

           //Apre il file
           sprintf(szFilename, "frame%d.ppm", iFrame);
           pFile=fopen(szFilename, "wb");
           if(pFile==NULL)
           {return; }

           //Scrive l'intestazione del file ( Larghezza x Altezza su video)
           fprintf(pFile, "P6\n%d %d\n255\n", width, height);

           //Scrive i data pixel
           for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);
           }

           //Chiude il file
           fclose(pFile);
         }
    /*
    *
    */
    /*Main Function*/
    int main(int argc, char *argv[])
    {
       AVFormatContext *pFormatCtx;
       int                                     i, videoStreamIdx;
       AVCodecContext   *pCodecCtx;
       AVCodec                      *pCodec;
       AVFrame                      *pFrame;
       AVFrame                      *pFrameRGB;
       AVPacket                     packet;
       int                                     frameFinished;
       int                                     numBytes;
       uint8_t                           *buffer;
       static struct SwsContext  *img_convert_ctx;

       if(argc &lt; 2){
           printf("Inserisci un file video\n");
           return -1;
       }

       //Registra tutti i formati e i codec
       av_register_all();

       //Apre il file video
       if(avformat_open_input(&amp;pFormatCtx, argv[1], NULL, NULL) != 0)
       {return -1;} //Impossibile aprire il file

       //Recupera le informazioni dello stream
       if(avformat_find_stream_info(pFormatCtx, NULL) &lt; 0)
       {return -1;} // Couldn't find stream information

       //Versa le informazioni del file sullo standard error
       av_dump_format(pFormatCtx, 0, argv[1], 0);

       //Trova il primo stream video
       videoStreamIdx=-1;
       for(i=0; inb_streams; i++)
       {
           if(pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
           { videoStreamIdx=i;
               break;}
       }

       if(videoStreamIdx==-1)
           return -1; // Impossibile trovare lo stream video

       // Punta al contenuto del codec per lo stream video
       pCodecCtx = pFormatCtx->streams[videoStreamIdx]->codec;

       // Trova il decoder per lo stream video
       pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
       if(pCodec==NULL)
       {
           fprintf(stderr, "Codec Non Supportato!\n");
           return -1; //Impossibile trovare il codec
       }

       //Apre il codec
       if(avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0)
       {return -1;} //Impossibile aprire il codec

       //Alloca il frame video
       pFrame = av_frame_alloc();

       //Alloca una struct AVFrame
       pFrameRGB = av_frame_alloc();
       if(pFrameRGB==NULL)
       {return -1;}

       //Determina la grandezza necessaria per il buffer e lo alloca
       numBytes = avpicture_get_size(PIX_FMT_RGB24,
                                                                               pCodecCtx->width,
                                                                               pCodecCtx->height);

       buffer = (uint8_t *) av_malloc(numBytes*sizeof(uint8_t));

       //Assegna le parti appropriate del buffer sulla superficie dell'immagine in pFrameRGB
       //Tenere presente che pFrameRGB è un AVFrame, ma AVFrame è una superset di AVPicture
       avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height);

       int w = pCodecCtx->width;
       int h = pCodecCtx->height;
       img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt,
                                                                                          w, h, PIX_FMT_RGB24,
                                                                                           SWS_LANCZOS, NULL, NULL, NULL);

       //Legge i frame e salva i primi 5 frame su disco
      i=0;
      while((av_read_frame(pFormatCtx, &amp;packet)>=0) &amp;&amp; (i&lt;5))
      {
          //Questo è il packet dello stream video?
          if(packet.stream_index==videoStreamIdx)
          {
              //Decodifica il frame video
              avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished, &amp;packet);

              //Si è riusiciti ad ottenere il frame video?
              if(frameFinished)
              {
                  i++;
                  sws_scale(img_convert_ctx, (const uint8_t * const *)pFrame->data,
                                           pFrame->linesize, 0, pCodecCtx->height,
                                           pFrameRGB->data, pFrameRGB->linesize);
                  SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);
              }
          }

          //Libera il pacchetto che era allocato da av_read_frame
          av_free_packet(&amp;packet);
      }

      //Libera l'immagine RGB
      av_free(buffer);
      av_free(pFrameRGB);

      //Libera il frame YUV
      av_free(pFrame);

      //Chiude il codec
      avcodec_close(pCodecCtx);

      //Chiude il file video
      avformat_close_input(&amp;pFormatCtx);

      /*FINE PROGRAMMA*/

       return 0;
    }

    This is the build output :

    "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
    make[1]: ingresso nella directory "/home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid"
    "/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/simplemediaplayerforandroid
    make[2]: ingresso nella directory "/home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid"
    mkdir -p dist/Debug/GNU-Linux-x86
    gcc     -o dist/Debug/GNU-Linux-x86/simplemediaplayerforandroid build/Debug/GNU-Linux-x86/main.o -L/usr/lib/x86_64-linux-gnu -lavformat -lavcodec -lavutil -lswscale -lz -lbz2
    build/Debug/GNU-Linux-x86/main.o: In function `main':
    /home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid/main.c:105: undefined reference to `av_frame_alloc'
    /home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid/main.c:108: undefined reference to `av_frame_alloc'
    collect2: ld returned 1 exit status
    make[2]: *** [dist/Debug/GNU-Linux-x86/simplemediaplayerforandroid] Errore 1
    make[2]: uscita dalla directory "/home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid"
    make[1]: *** [.build-conf] Errore 2
    make[1]: uscita dalla directory "/home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid"
    make: *** [.build-impl] Errore 2

    BUILD FAILED (exit value 2, total time: 143ms)

    I also linked the correct library path and headers path because there is no error with that.

    But when i try to build the program from the terminal with these commands :

    gcc -o prog1 /home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid/main.c -lavformat -lavcodec -lavutil -lswscale -lz -lbz2

    And the output is different :

    /home/dontrythisathome/Programmazione/C-C++/SimpleMediaPlayerForAndroid/main.c:11:29: fatal error: libavutil/frame.h: File o directory non esistente
    compilation terminated.

    The output says that there is no file or directory existing.
    What is the problem ?

  • Converting videos to flv using FFMPEG and losing the duration

    22 avril 2012, par Aline Bossi

    I use FFMPEG to convert some videos for the extension FLV, thereafter through an application is sent this video to a web page, where it is displayed through the JW Player. My problem happens on the website because the player does not display the total time of the video, thus I can not move forward or back my video. For conversion use the following code :

    -i "{ArquivoOrigem}" -vcodec flv -f flv -r 29.97 -s 320x240 -aspect 16:9 -b 200k -ac 1 -ar 22050 -ab 56k d "{ArquivoDestino}"

    So, is there any way I can do that ?
    tks

  • 2011 In Open Source Multimedia

    5 janvier 2012, par Multimedia Mike — Open Source Multimedia

    Sometimes I think that the pace of multimedia technology is slowing down. Obviously, I’m not paying close enough attention. I thought I would do a little 2011 year-end review of what happened in the world of open source multimedia, mainly for my own benefit. Let me know in the comments what I missed.

    The Split
    The biggest deal in open source multimedia was the matter of the project split. Where once stood one project (FFmpeg) there now stands two (also Libav). Where do things stand with the projects now ? Still very separate but similar. Both projects obsessively monitor each other’s git commits and prodigiously poach each other’s work, both projects being LGPL and all. Most features that land in one code base end up in the other. Thus, I refer to FFmpeg and Libav collectively as “the projects”.

    Some philosophical reasons for the split included project stagnation and development process friction. Curiously, these problems are fond memories now and the spirit of competition has pushed development forward at a blinding pace.

    People inside the project have strong opinions about the split ; that’s understandable. People outside the project have strong opinions about the split ; that’s somewhat less understandable, but whatever. After 5 years of working for Adobe on the Flash Player (a.k.a. the most hated software in all existence if internet nerds are to be believed on the matter), I’m so over internet nerd drama.

    For my part, I just try to maintain some appearance of neutrality since I manage some shared resources for the open source multimedia community (like the wiki and samples repo) and am trying to keep them from fracturing as well.

    Apple and Open Source
    It was big news that Apple magnanimously open sourced their lossless audio codec. That sets a great example and precedent.

    New Features
    I mined the 'git log' of the projects in order to pick out some features that were added during 2011.

    First off, Apple’s ProRes video codec was reverse engineered and incorporated into the multimedia libraries. And for some weird reason, this is an item that made the rounds in the geek press. I’m not entirely sure why, but it may have something to do with inter-project conflict. Anyway, here is the decoder in action, playing a video of some wild swine, one of the few samples we have :



    Other new video codecs included a reverse engineered Indeo 4 decoder. Gotta catch ‘em all ! That completes our collection of Indeo codecs. But that wasn’t enough– this year, we got a completely revised Indeo 3 decoder (the previous one, while functional, exhibited a lot of code artifacts betraying a direct ASM ->C translation). Oh, and many thanks to Kostya for this gem :



    That’s the new Origin Xan decoder (best known for Wing Commander IV cinematics) in action, something I first started reverse engineering back in 2002. Thanks to Kostya for picking up my slack yet again.

    Continuing with the codec section, there is a decoder for Adobe Flash Screen Video 2 — big congrats on this ! One of my jobs at Adobe was documenting this format to the outside world and I was afraid I could never quite make it clear enough to build a complete re-implementation. But the team came through.

    Let’s see, there are decoders for VBLE video, Ut Video, Windows Media Image (WMVP/WMP2), Bink audio version ‘b’, H.264 4:2:2 intra frames, and MxPEG video. There is a DPX image encoder, a Cirrus Logic AccuPak video encoder, and a v410 codec.

    How about some more game stuff ? The projects saw — at long last — an SMJPEG demuxer. This will finally allow usage and testing of the SMJPEG IMA ADPCM audio decoder I added about a decade ago. Funny story behind that– I was porting all of my decoders from xine which included the SMJPEG ADPCM. I just never quite got around to writing a corresponding demuxer. Thanks to Paul Mahol for taking care of that.

    Here’s a DFA playback system for a 1995 DOS CD-ROM title called Chronomaster. No format is too obscure, nor its encoded contents too cheesy :



    There’s now a demuxer for a format called XMV that was (is ?) prevalent on Xbox titles. Now the projects can handle FMV files from many Xbox games, such as Thrillville.



    The projects also gained the ability to play BMV files. I think this surfing wizard comes from Discworld II. It’s non-computer-generated animation at a strange resolution.



    More demuxers : xWMA, PlayStation Portable PMP format, and CRI ADX format ; muxer for OpenMG audio and LATM muxer/demuxer.

    One more thing : an AVX-optimized fast Fourier transform (FFT). If you have a machine that supports AVX, there’s no way you’ll even notice the speed increase of a few measly FFT calls for audio coding/decoding, but that’s hardly the point. The projects always use everything on offer for any CPU.

    Please make me aware of features that I missed in the list !

    Continuous Testing
    As a result of the split, each project has its own FATE server, one for FFmpeg and one for Libav. As of the new year, FFmpeg has just over 1000 tests while Libav had 965. This is one area where I’m obviously ecstatic to see competition. Some ad-hoc measurements on my part indicate that the total code coverage via the FATEs has not appreciably increased. But that’s a total percentage. Both the test count and the code count have been steadily rising.

    Google Summer of Code and Google Code-In
    Once again, the projects were allowed to participate in the Google Summer of Code as well as Google Code-In. I confess that I didn’t keep up with these too carefully (and Code-In is still in progress as of this writing). I do know that the project split occurred after FFmpeg had already been accepted for GSoC season 2011 and the admins were gracious enough to allow FFmpeg and Libav to allow both projects to participate in the same slot as long as they could both be mature about it.

    Happy New Year
    Let’s see what we can accomplish in 2012.