Recherche avancée

Médias (91)

Autres articles (98)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

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

Sur d’autres sites (6190)

  • Display FFMPEG decoded frame in a GLFW window

    17 juin 2020, par Infecto

    I am implementing the client program of a game where the server sends encoded frames of the game to the client (via UDP), while the client decodes them (via FFMPEG) and displays them in a GLFW window. 
My program has two threads :

    



      

    1. Thread 1 : renders the content of the uint8_t* variable dataToRender
    2. 


    3. Thread 2 : keeps obtaining frames from the server, decodes them and updates dataToRender accordingly
    4. 


    



    Thread 1 does the typical rendering of a GLFW window in a while-loop. I have already tried to display some dummy frame data (a completely red frame) and it worked :

    



    while (!glfwWindowShouldClose(window)) {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    ...

    glBindTexture(GL_TEXTURE_2D, tex_handle);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, window_width, window_height, 0, GL_RGB, GL_UNSIGNED_BYTE, dataToRender);
    ...
    glfwSwapBuffers(window);
}


    



    Thread 2 is where I am having trouble. I am unable to properly store the decoded frame into my dataToRender variable. On top if it, the frame data is originally in YUV format and needs to be converted to RGB. I use FFMPEG's sws_scale for that, which also gives me a bad dst image pointers error output in the console. Here's the code snippet responsible for that part :

    



            size_t data_size = frameBuffer.size();  // frameBuffer is a std::vector where I accumulate the frame data chunks
        uint8_t* data = frameBuffer.data();  // convert the vector to a pointer
        picture->format = AV_PIX_FMT_RGB24;
        av_frame_get_buffer(picture, 1);
        while (data_size > 0) {
            int ret = av_parser_parse2(parser, c, &pkt->data, &pkt->size,
                data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
            if (ret < 0) {
                fprintf(stderr, "Error while parsing\n");
                exit(1);
            }
            data += ret;
            data_size -= ret;

            if (pkt->size) {
                swsContext = sws_getContext(
                    c->width, c->height,
                    AV_PIX_FMT_YUV420P, c->width, c->height,
                    AV_PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL
                );
                uint8_t* rgb24[1] = { data };
                int rgb24_stride[1] = { 3 * c->width };
                sws_scale(swsContext, rgb24, rgb24_stride, 0, c->height, picture->data, picture->linesize);

                decode(c, picture, pkt, outname);
                // TODO: copy content of picture->data[0] to "dataToRender" maybe?
            }
        }


    



    I have already tried doing another sws_scale to copy the content to dataToRender and I cannot get rid of the bad dst image pointers error. Any advice or solution to the problem would be greatly appreciated as I have been stuck for days on this.

    


  • mxf : Support AAC

    12 août 2014, par Luca Barbato
    mxf : Support AAC
    

    Update mxf_set_audio_pts to use the container-provided information.

    The UL is marked as "to be changed in the future", but the current
    samples in the wild do use it.

    • [DBH] libavformat/mxf.c
    • [DBH] libavformat/mxfdec.c
  • Add logo or watermark to Converted video using ffmpeg and PHP

    27 mars 2022, par Medicare Advisors

    We are converting videos to MP4 using FFMPEG.

    


    We did a lot of research, however we cannot figure out how to add the company logo as a logo or a water mark to the converted video

    


    PHP code

    


    &lt;?php &#xA;$uploads_dir = &#x27;original/&#x27;;&#xA;$file_name = basename($_FILES[&#x27;file&#x27;][&#x27;name&#x27;]);&#xA;$output_name = explode(&#x27;.&#x27;, $file_name)[0];&#xA;$uploaded_file = $uploads_dir . $file_name;&#xA;$convert_status = [&#x27;mp4&#x27; => 0, &#x27;webm&#x27; => 0];&#xA;&#xA;if(isset($_POST[&#x27;submit&#x27;])) {&#xA;  if(move_uploaded_file($_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;], $uploaded_file)) {&#xA;    // Make sure to get the correct path to ffmpeg&#xA;    // Run $ where ffmpeg to get the path&#xA;    $ffmpeg = &#x27;/bin/ffmpeg&#x27;;&#xA;    &#xA;    // MP4&#xA;    $video_mp4 = $output_name . &#x27;.mp4&#x27;;&#xA;    exec($ffmpeg . &#x27; -i "&#x27; . $uploaded_file . &#x27;" -vcodec h264 -acodec libfdk_aac "./converted/&#x27; . $video_mp4 . &#x27;" -y 1>convert.txt 2>&amp;1&#x27;, $output, $convert_status[&#x27;mp4&#x27;]);&#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;&#xA;   &#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;  }&#xA;}&#xA;?>&#xA;

    &#xA;

    The logo we want to add is on : https://propeview.com/wp-content/uploads/2021/08/logo-whiteb.png

    &#xA;