Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (71)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

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

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

Sur d’autres sites (6497)

  • after restarting the page in the browser, the player stops loading

    28 juillet 2024, par Uximy

    I have a problem which is that when I start icecast server on ubuntu and not only on ubuntu but also on windows regardless of the operating system, when I first go to the radio station in icecast2 http://localhost:8000/radio the music plays but after restarting the page in the browser, the player stops loading, I tried the solution with nocache in the browser in the address bar, nothing helps, I looked at many users configs, they did not encounter such problems, I will leave my config below, I also wrote a code on nodejs I will also leave it below, the problem plays the same that if I go to a direct icecast link, what I will do through the node js code + ffmpeg, also about the logs, nothing outputs even a hint of any error that is related to this problem

    


    Config IceCast :

    


    <icecast>&#xA;    <location>Earth</location>&#xA;    <admin>icemaster@localhost</admin>&#xA;    <hostname>localhost</hostname>&#xA;&#xA;    <limits>&#xA;        <clients>100</clients>&#xA;        <sources>10</sources>&#xA;        524288&#xA;        60&#xA;        30&#xA;        10&#xA;        1&#xA;        65536&#xA;    </limits>&#xA;&#xA;    <authentication>&#xA;        hackme&#xA;        hackme&#xA;        admin&#xA;        hackme&#xA;    </authentication>&#xA;&#xA;    &#xA;        <port>8000</port>&#xA;        0.0.0.0&#xA;    &#xA;    &#xA;    &#xA;        <port>8443</port>&#xA;        0.0.0.0&#xA;        <ssl>1</ssl>&#xA;    &#xA;&#xA;    &#xA;        <header value="*"></header>&#xA;        <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;        <header value="GET, POST, OPTIONS"></header>&#xA;        <header value="no-cache, no-store, must-revalidate"></header>&#xA;        <header value="no-cache"></header>&#xA;        <header value="0"></header>&#xA;    &#xA;&#xA;    &#xA;    <mount type="normal">&#xA;        /radio&#xA;        <password>mypassword</password>&#xA;        <public>1</public>&#xA;        100&#xA;        Anime Vibes&#xA;        Anime Vibes&#xA;        <genre>various</genre>&#xA;        audio/ogg&#xA;        65536&#xA;        &#xA;        &#xA;            <header value="*"></header>&#xA;            <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;            <header value="GET, POST, OPTIONS"></header>&#xA;            <header value="no-cache, no-store, must-revalidate"></header>&#xA;            <header value="no-cache"></header>&#xA;            <header value="0"></header>&#xA;        &#xA;    </mount>&#xA;&#xA;    <fileserve>1</fileserve>&#xA;&#xA;    <paths>&#xA;        <logdir>/var/log/icecast2</logdir>&#xA;        <webroot>/etc/icecast2/web</webroot>&#xA;        <adminroot>/etc/icecast2/admin</adminroot>&#xA;       &#xA;        <alias source="/" destination="/status.xsl"></alias>&#xA;        &#xA;        /etc/icecast2/cert/icecast.pem&#xA;        &#xA;    </paths>&#xA;&#xA;    <logging>&#xA;        <accesslog>access.log</accesslog>&#xA;        <errorlog>error.log</errorlog>&#xA;        <playlistlog>playlist.log</playlistlog>&#xA;        <loglevel>1</loglevel> &#xA;        <logsize>10000</logsize> &#xA;        <logarchive>1</logarchive>&#xA;    </logging>&#xA;</icecast>&#xA;

    &#xA;

    Code Node.js :

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const { spawn } = require(&#x27;child_process&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;const https = require(&#x27;https&#x27;);&#xA;const app = express();&#xA;const port = 3000;&#xA;&#xA;const privateKey = fs.readFileSync(&#x27;./cert/privateKey.key&#x27;, &#x27;utf8&#x27;);&#xA;const certificate = fs.readFileSync(&#x27;./cert/certificate.crt&#x27;, &#x27;utf8&#x27;);&#xA;&#xA;const credentials = {&#xA;    key: privateKey,&#xA;    cert: certificate&#xA;};&#xA;&#xA;app.use(express.static(path.join(__dirname)));&#xA;&#xA;// Check if playlist file exists&#xA;const playlistPath = path.join(__dirname, &#x27;playlist.txt&#x27;);&#xA;if (!fs.existsSync(playlistPath)) {&#xA;    console.error(&#x27;Playlist file does not exist&#x27;);&#xA;    process.exit(1);&#xA;}&#xA;&#xA;console.log(`Playlist path: ${playlistPath}`);&#xA;&#xA;// Start FFmpeg process to create continuous stream from playlist&#xA;const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-re&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;concat&#x27;,&#xA;    &#x27;-safe&#x27;, &#x27;0&#x27;,&#xA;    &#x27;-protocol_whitelist&#x27;, &#x27;file,http,https,tcp,tls&#x27;,&#xA;    &#x27;-i&#x27;, playlistPath,&#xA;    &#x27;-c:a&#x27;, &#x27;libvorbis&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;ogg&#x27;,&#xA;    &#x27;-tls&#x27;, &#x27;1&#x27;,&#xA;    &#x27;icecast://source:mypassword@localhost:8443/radio&#x27;&#xA;]);&#xA;&#xA;ffmpegProcess.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(`FFmpeg stdout: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.stderr.on(&#x27;data&#x27;, (data) => {&#xA;    console.error(`FFmpeg stderr: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;    console.log(`FFmpeg process exited with code ${code}`);&#xA;});&#xA;&#xA;app.get(&#x27;/radio&#x27;, (req, res) => {&#xA;    res.setHeader(&#x27;Content-Type&#x27;, &#x27;audio/ogg&#x27;);&#xA;    res.setHeader(&#x27;Transfer-Encoding&#x27;, &#x27;chunked&#x27;);&#xA;&#xA;    const requestOptions = {&#xA;        hostname: &#x27;localhost&#x27;,&#xA;        port: 8443,&#xA;        path: &#x27;/radio&#x27;,&#xA;        method: &#x27;GET&#x27;,&#xA;        headers: {&#xA;            &#x27;Accept&#x27;: &#x27;audio/ogg&#x27;&#xA;        },&#xA;        rejectUnauthorized: false&#xA;    };&#xA;&#xA;    const request = https.request(requestOptions, (response) => {&#xA;        response.pipe(res);&#xA;&#xA;        response.on(&#x27;end&#x27;, () => {&#xA;            res.end();&#xA;        });&#xA;    });&#xA;&#xA;    request.on(&#x27;error&#x27;, (err) => {&#xA;        console.error(`Request error: ${err.message}`);&#xA;        res.status(500).send(&#x27;Internal Server Error&#x27;);&#xA;    });&#xA;&#xA;    request.end();&#xA;});&#xA;https.globalAgent.options.ca = [certificate];&#xA;// Create HTTPS server&#xA;const httpsServer = https.createServer(credentials, app);&#xA;&#xA;httpsServer.listen(port, () => {&#xA;    console.log(`Server is running at https://localhost:${port}`);&#xA;});&#xA;

    &#xA;

    I hope for your help and any advice, thanks in advance

    &#xA;

  • ffmpeg-php loading videos but not generating jpeg (thumbnails)

    16 mars 2021, par Ali Hamdar

    The website is now running on :&#xA;finlandbooking.online

    &#xA;

    Sorry for this noob question first of all.&#xA;This is a social media script, when you upload a video, it shows a black thumbnail - you can play the video, but the thumbnail is black. I checked the issue with developers tools, it seems that it's showing error 404 - image not found. ffmpeg, as far as I understood, is supposed to generate an image and display it as a thumbnail. The image is supposed to be located in /uploads/images/ - Kindly check this part of the code and let me know why it's not working :

    &#xA;

    else if ($action == &#x27;upload_post_video&#x27;) {&#xA;if (empty($cl["is_logged"])) {&#xA;    $data[&#x27;status&#x27;] = 400;&#xA;    $data[&#x27;error&#x27;]  = &#x27;Invalid access token&#x27;;&#xA;}&#xA;else {&#xA;    $data[&#x27;err_code&#x27;] = "invalid_req_data";&#xA;    $data[&#x27;status&#x27;]   = 400;&#xA;    $post_data        = $me[&#x27;draft_post&#x27;];&#xA;&#xA;    if (not_empty($_FILES[&#x27;video&#x27;]) &amp;&amp; not_empty($_FILES[&#x27;video&#x27;][&#x27;tmp_name&#x27;])) {&#xA;        if (empty($post_data)) {&#xA;            $post_id   = cl_create_orphan_post($me[&#x27;id&#x27;], "video");&#xA;            $post_data = cl_get_orphan_post($post_id);&#xA;&#xA;            cl_update_user_data($me[&#x27;id&#x27;],array(&#xA;                &#x27;last_post&#x27; => $post_id&#xA;            ));&#xA;        }&#xA;&#xA;        if (not_empty($post_data) &amp;&amp; $post_data["type"] == "video") {&#xA;            if (empty($post_data[&#x27;media&#x27;])) {&#xA;                $file_info      =  array(&#xA;                    &#x27;file&#x27;      => $_FILES[&#x27;video&#x27;][&#x27;tmp_name&#x27;],&#xA;                    &#x27;size&#x27;      => $_FILES[&#x27;video&#x27;][&#x27;size&#x27;],&#xA;                    &#x27;name&#x27;      => $_FILES[&#x27;video&#x27;][&#x27;name&#x27;],&#xA;                    &#x27;type&#x27;      => $_FILES[&#x27;video&#x27;][&#x27;type&#x27;],&#xA;                    &#x27;file_type&#x27; => &#x27;video&#x27;,&#xA;                    &#x27;folder&#x27;    => &#x27;videos&#x27;,&#xA;                    &#x27;slug&#x27;      => &#x27;original&#x27;,&#xA;                    &#x27;allowed&#x27;   => &#x27;mp4,mov,3gp,webm&#x27;,&#xA;                );&#xA;&#xA;                $file_upload = cl_upload($file_info);&#xA;                $upload_fail = false;&#xA;                $post_id     = $post_data[&#x27;id&#x27;];&#xA;&#xA;                if (not_empty($file_upload[&#x27;filename&#x27;])) {&#xA;                    try {&#xA;                        require_once(cl_full_path("core/libs/ffmpeg-php/vendor/autoload.php"));&#xA;&#xA;                        $ffmpeg         =  new FFmpeg(cl_full_path($config[&#x27;ffmpeg_binary&#x27;]));&#xA;                        $thumb_path     =  cl_gen_path(array(&#xA;                            "folder"    => "images",&#xA;                            "file_ext"  => "jpeg",&#xA;                            "file_type" => "image",&#xA;                            "slug"      => "poster",&#xA;                        ));&#xA;&#xA;                        $ffmpeg->input($file_upload[&#x27;filename&#x27;]);&#xA;                        $ffmpeg->set(&#x27;-ss&#x27;,&#x27;3&#x27;);&#xA;                        $ffmpeg->set(&#x27;-vframes&#x27;,&#x27;1&#x27;);&#xA;                        $ffmpeg->set(&#x27;-f&#x27;,&#x27;mjpeg&#x27;);&#xA;                        $ffmpeg->output($thumb_path)->ready();&#xA;                    } &#xA;&#xA;                    catch (Exception $e) {&#xA;                        $upload_fail = true;&#xA;                    }&#xA;&#xA;                    if (empty($upload_fail)) {&#xA;                        $img_id      =  $db->insert(T_PUBMEDIA, array(&#xA;                            "pub_id" => $post_id,&#xA;                            "type"   => "video",&#xA;                            "src"    => $file_upload[&#x27;filename&#x27;],&#xA;                            "time"   => time(),&#xA;                            "json_data" => json(array(&#xA;                                "poster_thumb" => $thumb_path&#xA;                            ),true)&#xA;                        ));&#xA;&#xA;                        if (is_posnum($img_id)) {&#xA;                            $data[&#x27;status&#x27;] =  200;&#xA;                            $data[&#x27;video&#x27;]  =  array(&#xA;                                "source"    => cl_get_media($file_upload[&#x27;filename&#x27;]),&#xA;                                "poster"    => cl_get_media($thumb_path),&#xA;                            );&#xA;                        }&#xA;                    }&#xA;                }&#xA;            }&#xA;            else {&#xA;                $data[&#x27;err_code&#x27;] = "total_limit_exceeded";&#xA;                $data[&#x27;status&#x27;]   = 400;&#xA;            }&#xA;        }&#xA;        else {&#xA;            cl_delete_orphan_posts($me[&#x27;id&#x27;]);&#xA;            cl_update_user_data($me[&#x27;id&#x27;],array(&#xA;                &#x27;last_post&#x27; => 0&#xA;            ));&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

    }

    &#xA;

  • Muting ffmpeg warnings when loading video with OpenCV

    26 mai 2017, par cbuchart

    I’m using OpenCV to process a set of MPEG videos. For some of them following warning is displayed when reading a frame or seeking (it is printed by the ffmpeg library).

    [mpeg2video @ 026b0d20] warning : first frame is no keyframe

    The thing is that such messages are printed together other valid output of my application and they are bothering final users. Is there any way to suppress such warning messages programmatically, other than re-coding the videos with an external tool ?

    I’m already muting the standard output and error, as well as using a custom (dummy) OpenCV error handler. Below a MCVE for testing.

    PS : I understand the warning and actually the full project handles those scenarios so videos are correctly read.


    Example code to reproduce the problem

    #include <iostream>
    #include <opencv2></opencv2>core/core.hpp>
    #include <opencv2></opencv2>highgui/highgui.hpp>

    int handleError(int status, const char* func_name,
                   const char* err_msg, const char* file_name,
                   int line, void* userdata)
    {
     return 0;
    }

    int main()
    {
     std::cout &lt;&lt; "Start!" &lt;&lt; std::endl;

     cv::VideoCapture reader;
     if (!reader.open("Sample.mpg")) {
       std::cout &lt;&lt; "Failed opening video" &lt;&lt; std::endl;
       return 0;
     }

     cv::redirectError(handleError);

     std::cout.setstate(std::ios_base::failbit);
     std::cout &lt;&lt; "std::cout mute test..." &lt;&lt; std::endl; // OK, muted

     std::cerr.setstate(std::ios_base::failbit);
     std::cerr &lt;&lt; "std::cerr mute test..." &lt;&lt; std::endl; // OK, muted

     cv::Mat tmpImage;
     try {
       tmpImage = tmpImage * tmpImage; // OK, OpenCV error muted
     } catch (...) {}

     // Here the warning is printed
     reader.read(tmpImage);

     std::cout.clear();
     std::cerr.clear();
     std::cout &lt;&lt; "Finished!" &lt;&lt; std::endl;

     return 0;
    }
    </iostream>

    The Sample.mpg video can be downloaded from the Internet Archive : https://archive.org/download/ligouHDR-HC1_sample1/Sample.mpg

    This is the current output of the program :

    enter image description here


    I’m using VS 2010 and OpenCV 2.4.10. Following DLLs are the only ones with the executable (no other OpenCV-related DLL is reachable in the PATH).

    • opencv_core2410.dll
    • opencv_ffmpeg2410.dll
    • opencv_highgui2410.dll