Recherche avancée

Médias (91)

Autres articles (83)

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

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (7242)

  • Saving the openGL context as a video output

    16 septembre 2016, par activatedgeek

    I am currently trying to save the animation made in openGL to a video file. I have tried using openCV’s videowriter but to no advantage. I have successfully been able to generate a snapshot and save it as bmp using the SDL library. If I save all snapshots and then generate the video using ffmpeg, that is like collecting 4 GB worth of images. Not practical.
    How can I write video frames directly during rendering ?
    Here the code i use to take snapshots when I require :

    void snapshot(){
    SDL_Surface* snap = SDL_CreateRGBSurface(SDL_SWSURFACE,WIDTH,HEIGHT,24, 0x000000FF, 0x0000FF00, 0x00FF0000, 0);
    char * pixels = new char [3 *WIDTH * HEIGHT];
    glReadPixels(0, 0,WIDTH, HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, pixels);

    for (int i = 0 ; i <height>pixels) + snap->pitch * i, pixels + 3 * WIDTH * (HEIGHT-i - 1), WIDTH*3 );

    delete [] pixels;
    SDL_SaveBMP(snap, "snapshot.bmp");
    SDL_FreeSurface(snap);
    }
    </height>

    I need the video output. I have discovered that ffmpeg can be used to create videos from C++ code but have not been able to figure out the process. Please help !

    EDIT : I have tried using openCV CvVideoWriter class but the program crashes ("segmentation fault") the moment it is declared.Compilation shows no errors ofcourse. Any suggestions to that ?

    SOLUTION FOR PYTHON USERS (Requires Python2.7,python-imaging,python-opengl,python-opencv, codecs of format you want to write to, I am on Ubuntu 14.04 64-bit) :

    def snap():
       pixels=[]
       screenshot = glReadPixels(0,0,W,H,GL_RGBA,GL_UNSIGNED_BYTE)
       snapshot = Image.frombuffer("RGBA",W,H),screenshot,"raw","RGBA",0,0)
       snapshot.save(os.path.dirname(videoPath) + "/temp.jpg")
       load = cv2.cv.LoadImage(os.path.dirname(videoPath) + "/temp.jpg")
       cv2.cv.WriteFrame(videoWriter,load)

    Here W and H are the window dimensions (width,height). What is happening is I am using PIL to convert the raw pixels read from the glReadPixels command into a JPEG image. I am loading that JPEG into the openCV image and writing to the videowriter. I was having certain issues by directly using the PIL image into the videowriter (which would save millions of clock cycles of I/O), but right now I am not working on that. Image is a PIL module cv2 is a python-opencv module.

  • Saving the openGL context as a video output

    2 juin 2023, par psiyum

    I am currently trying to save the animation made in openGL to a video file. I have tried using openCV's videowriter but to no advantage. I have successfully been able to generate a snapshot and save it as bmp using the SDL library. If I save all snapshots and then generate the video using ffmpeg, that is like collecting 4 GB worth of images. Not practical.&#xA;How can I write video frames directly during rendering ?&#xA;Here the code i use to take snapshots when I require :

    &#xA;&#xA;

    void snapshot(){&#xA;SDL_Surface* snap = SDL_CreateRGBSurface(SDL_SWSURFACE,WIDTH,HEIGHT,24, 0x000000FF, 0x0000FF00, 0x00FF0000, 0);&#xA;char * pixels = new char [3 *WIDTH * HEIGHT];&#xA;glReadPixels(0, 0,WIDTH, HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, pixels);&#xA;&#xA;for (int i = 0 ; i <height>pixels) &#x2B; snap->pitch * i, pixels &#x2B; 3 * WIDTH * (HEIGHT-i - 1), WIDTH*3 );&#xA;&#xA;delete [] pixels;&#xA;SDL_SaveBMP(snap, "snapshot.bmp");&#xA;SDL_FreeSurface(snap);&#xA;}&#xA;</height>

    &#xA;&#xA;

    I need the video output. I have discovered that ffmpeg can be used to create videos from C++ code but have not been able to figure out the process. Please help !

    &#xA;&#xA;

    EDIT : I have tried using openCV CvVideoWriter class but the program crashes ("segmentation fault") the moment it is declared.Compilation shows no errors ofcourse. Any suggestions to that ?

    &#xA;&#xA;

    SOLUTION FOR PYTHON USERS (Requires Python2.7,python-imaging,python-opengl,python-opencv, codecs of format you want to write to, I am on Ubuntu 14.04 64-bit) :

    &#xA;&#xA;

    def snap():&#xA;    pixels=[]&#xA;    screenshot = glReadPixels(0,0,W,H,GL_RGBA,GL_UNSIGNED_BYTE)&#xA;    snapshot = Image.frombuffer("RGBA",W,H),screenshot,"raw","RGBA",0,0)&#xA;    snapshot.save(os.path.dirname(videoPath) &#x2B; "/temp.jpg")&#xA;    load = cv2.cv.LoadImage(os.path.dirname(videoPath) &#x2B; "/temp.jpg")&#xA;    cv2.cv.WriteFrame(videoWriter,load)&#xA;

    &#xA;&#xA;

    Here W and H are the window dimensions (width,height). What is happening is I am using PIL to convert the raw pixels read from the glReadPixels command into a JPEG image. I am loading that JPEG into the openCV image and writing to the videowriter. I was having certain issues by directly using the PIL image into the videowriter (which would save millions of clock cycles of I/O), but right now I am not working on that. Image is a PIL module cv2 is a python-opencv module.

    &#xA;

  • Commercial avi decoder for iOS [closed]

    31 janvier 2013, par pawelqus

    Can you recommend any commercial 3-party library for decoding AVI files in iOS App ? There are many apps in the AppStore that can to do that. I don't want to use ffmpeg because of the legal issues.