Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (4)

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

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (2398)

  • FFmpeg cant recognize 3 channels with each 32 bit

    4 avril 2022, par Chryfi

    I am writing the linearized depth buffer of a game to openEXR using FFmpeg. Unfortunately, FFmpeg does not adhere to the openEXR file specification fully (like allowing unsigned integer for one channel) so I am writing one float channel to openEXR, which is put into the green channel with this command -f rawvideo -pix_fmt grayf32be -s %WIDTH%x%HEIGHT% -r %FPS% -i - -vf %DEFVF% -preset ultrafast -tune zerolatency -qp 6 -compression zip1 -pix_fmt gbrpf32le %NAME%_depth_%d.exr.

    


    The float range is from 0F to 1F and it is linear. I can confirm that the calculation and linearization is correct by testing 16 bit integer (per pixel component) PNG in Blender compositor. The 16 bit integer data is written like this short s = (short) (linearzieDepth(depth) * (Math.pow(2,16) - 1)) whereas for float the linearized value is directly written to OpenEXR without multiplying with a value.

    


    However, when viewing the openEXR file it doesn't have the same "gradient" as the 16 bit png... when viewing them side by side, it appears as if the values near 0 are not linear, and they are not as dark as they should be like in the 16 bit png.
(And yes, I set the image node to linear), and comparing it with 3d tracking data from the game I cant reproduce the depth and cant mask things using the depth buffer where as with the png I can.

    


    How is it possible for a linear float range to turn out so different to a linear integer range in an image ?

    


    UPDATE :

    


    I now write 3 channels to the ffmpeg with this code

    


    float f2 = this.linearizeDepth(depth);

buffer.putFloat(f2);
buffer.putFloat(0);
buffer.putFloat(0);


    


    the byte buffer is of the size width * height * 3 * 4 -> 3 channels with each 4 bytes. The command is now -f rawvideo -pix_fmt gbrpf32be -s %WIDTH%x%HEIGHT% -r %FPS% -i - -vf %DEFVF% -preset ultrafast -tune zerolatency -qp 6 -compression zip1 -pix_fmt gbrpf32le %NAME%_depth_%d.exr which should mean that the input (byte buffer) is expecting 32 bit floats with 3 channels. This is how it turns out

    


    FFmpeg is somehow splitting up channels or whatever... could be a bug, could be my fault ?

    


  • Ip camera using ffmpeg drawing on screen

    6 mars 2014, par user3177342

    I'm using ffmpeg 1.2 to take video from ip camera.I make it draw on the screen, so I wonder if there is some event mechanism to to know if it is time to call av_read_frame ?
    If I read frame not so frequent as the camera gives frames i get segmentation fault = on some malloc functions inside ffmpeg routines(video_get_buffer)

    I also get segmentation fault just when drawing on screen.

    In Render function call every 0 miliseconds

    void BasicGLPane::DrawNextFrame()
    {
    int f=1;
    while(av_read_frame(pFormatCtx, &packet)>=0)
       {
           // Is this a packet from the video stream?
           if(packet.stream_index==videoStream)
           {


               // Decode video frame
               avcodec_decode_video2(pCodecCtx, pFrame, &FrameFinished,
                                     &packet);

               // Did we get a video frame?
               if(FrameFinished)
               {
                   f++;
                   this->fram->Clear();
                  // if (pFrame->pict_type == AV_PICTURE_TYPE_I) wxMessageBox("I cadr");
                   if (pFrame->pict_type != AV_PICTURE_TYPE_I)
                   printMVMatrix(f, pFrame, pCodecCtx);
                   pFrameRGB->linesize[0]= pCodecCtx->width*3; // in case of rgb4  one plane

                   sws_scale(swsContext, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
                   //glGenTextures(1, &VideoTexture);
                   if ((*current_Vtex)==VideoTexture) current_Vtex = &VideoTexture2;else current_Vtex = &VideoTexture;
                   glBindTexture(GL_TEXTURE_2D, (*current_Vtex));
                   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
                   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
                   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
                   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, pCodecCtx->width, pCodecCtx->height, GL_RGB, GL_UNSIGNED_BYTE, pFrameRGB->data[0]);
                   //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, pCodecCtx->width, pCodecCtx->height, 0, GL_RGB, GL_UNSIGNED_BYTE, pFrameRGB->data[0]);
                   //glDeleteTextures(1, &VideoTexture);
                   GLenum err;
                   while ((err = glGetError()) != GL_NO_ERROR)
                   {
                       cerr << "OpenGL error: " << err << endl;
                   }
                 //  av_free(buffer);
               }
           }

           // Free the packet that was allocated by av_read_frame
           av_free_packet(&packet);
           if (f>1) break;
       }

    //av_free(pFrameRGB);
    }

    The picture I get on the screen is strange (green quads and red lines are motion vectors of those quads)

    http://i.stack.imgur.com/9HJ9t.png

  • Inconsistant rendering in libmelt XML and C interface and 'hold' producer and avformat consumer

    14 octobre 2016, par Leif Andersen

    I am trying to create a short video that is just a single image. (I know its a bit silly, but its a test for something bigger).

    The code I have for rendering it is :

    #include <framework></framework>mlt.h>
    #include
    #include

    int main() {
     if(mlt_factory_init(NULL)) {
       mlt_profile p = mlt_profile_init(NULL);
       mlt_consumer target = mlt_factory_consumer(p, "avformat",
       mlt_producer source = mlt_factory_producer(p, "hold", "/Users/leif/logo.png");
       mlt_producer_set_in_and_out(source, 0, 10);
       mlt_consumer_connect(target, mlt_producer_service(source));
       mlt_consumer_start(target);

       sleep(5);
       mlt_consumer_stop(target);

       mlt_consumer_close(target);
       mlt_producer_close(source);
       mlt_factory_close();
     } else {
       printf("No\n");
     }

     return 0;
    }

    Where logo.png is this file.

    When I run this code and play output.mp4, the picture comes out all garbelled. There is a green line in the middle and the logo is superimposed on itself a lot.

    On the other hand, if I change the consumer to be SDL, the image plays just fine.

    And finally, if I change the consumer to be XML, and then use the melt command line application to render it :

    melt -consumer avformat:xmlout.mp4 output.xml

    and play the video, it also plays fine.

    Is there something I am missing in the avformat consumer that I should be setting ? Or something else that I am missing here ?

    Edit : For reference, the outputted xml file : output.xml is :

    &lt;?xml version="1.0" encoding="utf-8"?>
    <mlt version="6.2.0" root="/Users/leif/src/video/private" title="Anonymous Submission" parent="producer0" in="0" out="10">
         <profile description="DV/DVD PAL" width="720" height="576" progressive="0" colorspace="601"></profile>
     <producer title="Anonymous Submission" in="0" out="10">
       <property>15000</property>
       <property>pause</property>
       <property>/Users/leif/logo.png</property>
       <property>1.06667</property>
       <property>0</property>
       <property>onefield</property>
       <property>hold</property>
       <property>1</property>
     </producer>
    </mlt>