Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (104)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

  • Monitoring de fermes de MediaSPIP (et de SPIP tant qu’à faire)

    31 mai 2013, par

    Lorsque l’on gère plusieurs (voir plusieurs dizaines) de MediaSPIP sur la même installation, il peut être très pratique d’obtenir d’un coup d’oeil certaines informations.
    Cet article a pour but de documenter les scripts de monitoring Munin développés avec l’aide d’Infini.
    Ces scripts sont installés automatiquement par le script d’installation automatique si une installation de munin est détectée.
    Description des scripts
    Trois scripts Munin ont été développés :
    1. mediaspip_medias
    Un script de (...)

Sur d’autres sites (5212)

  • avfilter/vf_tinterlace : support full-range YUV

    9 décembre 2022, par Niklas Haas
    avfilter/vf_tinterlace : support full-range YUV
    

    This filter, when used in the "pad" mode, currently makes the
    distinction between limited and full range solely by testing for YUVJ
    pixel formats at link setup time. This is deprecated and should be
    improved to perform the detection based on the per-frame metadata.

    In order to make this distinction based on color range metadata, which
    is only known at the time of filtering frames, for simplicity, we simply
    allocate two copies of the "black" frame - one for limited range and the
    other for full range metadata. This could be done more dynamically (e.g.
    as-needed or simply by blitting the appropriate pixel value directly),
    but this change is relatively simple and preserves the structure of the
    existing code.

    This commit actually fixes a bug in FATE - the new output is correct for
    the first time. The previous md5 ref was of a frame that incorrectly
    combined full-range pixel data with limited-range black fields. The
    corresponding result has been updated.

    Signed-off-by : Niklas Haas <git@haasn.dev>

    • [DH] libavfilter/tinterlace.h
    • [DH] libavfilter/vf_tinterlace.c
    • [DH] tests/ref/fate/filter-pixfmts-tinterlace_pad
  • JavaCV Fetch RTSP Meet "avcodec_open2() error -40 : Could not open audio codec" Error

    6 avril 2019, par Jeremy Lu

    I am trying to use javacv to fetch a rtsp monitoring camera and grabber the frames, but meet "avcodec_open2() error -40 : Could not open audio codec" error when the grabber is prepare to start after setup the parameters.

    Javacv version :

    • org.bytedeco.javacv-platform, 1.4.1
    • org.bytedeco.javacpp-presets.opencv-platform, 3.4.1-1.4.1

    Here is the Jave Exception Infomation :

    org.bytedeco.javacv.FrameGrabber$Exception: avcodec_open2() error -40: Could not open audio codec.  
     at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:835) ~[javacv-1.4.1.jar:1.4.1]  
     at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:663) ~[javacv-1.4.1.jar:1.4.1]  

    rtsp infomation :
    For the rtsp source, I also tried to download the FFplay and use command

    .\ffplay.exe -rtsp_transport tcp rtsp://admin:DWUUUP@10.193.8.71

    to show the frames from monitoring camera, and it works, and with following information

    • Input #0, rtsp, from ’rtsp ://admin:DWUUUP@10.193.8.71’ :

      • Metadata :
        • title : Media Presentation
      • Duration : N/A, start : 0.000000, bitrate : N/A
        • Stream #0:0 : Video : h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 15 fps, 24.17 tbr, 90k tbn, 30 tbc
        • Stream #0:1 : Audio : aac, 16000 Hz, 1 channels, fltp
    • [aac @ 000001fc123be880] Audio object type 0 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.

    And here is the source code :

    FFmpegFrameGrabber grabber = new FFmpegFrameGrabber ("rtsp://admin:DWUUUP@10.193.8.71");
    grabber.setImageHeight(640);
    grabber.setImageWidth(360);
    grabber.setOption("rtsp_transport", "tcp");
    grabber.start(); // Where meet the problem

    Java2DFrameConverter converter = new Java2DFrameConverter();
    BufferedImage bufferedImage = converter.convert( grabber.grab() );
    ByteArrayOutputStream bateArrayOutputStream = new ByteArrayOutputStream();
    ImageIO.write(bufferedImage, "jpeg", bateArrayOutputStream);
    byte[] data = bateArrayOutputStream.toByteArray();
    bateArrayOutputStream.close();

    I have tested to change the rtsp to a mp4 file, the code can work.

    How can I fix this problem ? Thanks very much !

  • How to fix here "EPIPE" in Node js Socket.io

    23 avril, par Mehdi008

    Receiving this error :

    &#xA;

    Error: write EPIPE&#xA;        at afterWriteDispatched (node:internal/stream_base_commons:161:15)&#xA;        at writeGeneric (node:internal/stream_base_commons:152:3)&#xA;        at Socket._writeGeneric (node:net:958:11)&#xA;        at Socket._write (node:net:970:8)&#xA;        at doWrite (node:internal/streams/writable:598:12)&#xA;        at clearBuffer (node:internal/streams/writable:783:7)&#xA;        at onwrite (node:internal/streams/writable:653:7)&#xA;        at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:107:10)&#xA;    Emitted &#x27;error&#x27; event on Socket instance at:&#xA;        at emitErrorNT (node:internal/streams/destroy:169:8)&#xA;        at emitErrorCloseNT (node:internal/streams/destroy:128:3)&#xA;        at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {&#xA;      errno: -4047,&#xA;      code: &#x27;EPIPE&#x27;,&#xA;      syscall: &#x27;write&#x27;&#xA;    }&#xA;

    &#xA;

    // for this code: const { spawn } = require("child_process");&#xA;&#xA;module.exports = (socket, pool) => {&#xA;    &#xA;    let stream_req_token = "";&#xA;    let rtmps_array = [];&#xA;&#xA;    socket.on("stream_request_token",async(token)=>{&#xA;&#xA;        const stream_reqs = await pool`SELECT * FROM stream_request WHERE token=${token}`;&#xA;&#xA;&#xA;        if(stream_reqs.length === 0){&#xA;            &#xA;            socket.emit("token_validation_response",false);&#xA;            return;&#xA;        }&#xA;&#xA;        const stream_req = stream_reqs[0];&#xA;&#xA;        if(!stream_req.is_valid){&#xA;&#xA;            socket.emit("token_validation_response",false);&#xA;            return;&#xA;        }&#xA;&#xA;        socket.emit("token_validation_response",true);&#xA;&#xA;        stream_req_token = token;&#xA;&#xA;&#xA;    })&#xA;&#xA;    socket.on("rtmps_array",async(array)=>{&#xA;&#xA;        try{&#xA;&#xA;            const rtmps = JSON.parse(array);&#xA;&#xA;        const streams_requests = await pool`SELECT id FROM stream_request WHERE token=${stream_req_token}`;&#xA;        const stream_req_id = streams_requests[0].id;&#xA;&#xA;        rtmps_array = rtmps;&#xA;&#xA;        rtmps.map(async(rtmp)=>{&#xA;&#xA;            await pool`INSERT INTO stream (platform,url,url_key,stream_request_id) &#xA;            VALUES(${rtmp.platform},${rtmp.url},${rtmp.key},${stream_req_id})`;&#xA;        })&#xA;&#xA;        socket.emit("rtmps_array_response",true);&#xA;&#xA;        } catch(err){&#xA;&#xA;            console.log(err);&#xA;            socket.emit("rtmps_array_response",false);&#xA;&#xA;        }&#xA;&#xA;&#xA;    })&#xA;&#xA;    //Start Streaming&#xA;    let ffmpegProcess = null;&#xA;    let isStreaming = false; // Flag to track streaming state&#xA;&#xA;  socket.on("stream", (chunk) => {&#xA;    if (!ffmpegProcess) {&#xA;        console.log(&#x27;Initializing FFmpeg process...&#x27;);&#xA;&#xA;        // Spawn FFmpeg process&#xA;        const resolution = "1280x720"; // Change to "1920x1080" for 1080p&#xA;&#xA;        const ffmpegArgs = [&#xA;            "-i", "pipe:0", // Input from stdin&#xA;            "-c:v", "libx264", // Video codec&#xA;            "-preset", "veryfast", // Low latency encoding&#xA;            "-b:v", "4500k", // Target average bitrate (4.5 Mbps)&#xA;            "-minrate", "2500k", // Minimum bitrate&#xA;            "-maxrate", "6000k", // Maximum bitrate&#xA;            "-bufsize", "16000k", // Buffer size (twice the max bitrate)&#xA;            "-r", "30", // **FORCE 30 FPS**&#xA;            "-g", "60", // Keyframe interval (every 2 seconds)&#xA;            "-tune", "zerolatency", // Low latency tuning&#xA;            "-sc_threshold", "0", // Constant bitrate enforcement&#xA;            "-flags", "&#x2B;global_header",&#xA;          &#xA;            // **Resolution Fix**&#xA;            "-s", resolution, // **Set resolution to 720p or 1080p**&#xA;            "-aspect", "16:9", // **Maintain aspect ratio**&#xA;            &#xA;            // **Frame Rate Fix**&#xA;            "-vsync", "cfr", // **Forces Constant Frame Rate (CFR)**&#xA;            "-fps_mode", "cfr", // **Prevents FFmpeg from auto-adjusting FPS**&#xA;            &#xA;            // Audio settings&#xA;            "-c:a", "aac",&#xA;            "-b:a", "128k", // Audio bitrate&#xA;            "-ar", "44100", // Audio sample rate&#xA;            "-ac", "2", // Stereo audio&#xA;          &#xA;            "-f", "flv" // Output format&#xA;          ];&#xA;      &#xA;          // Map the streams to multiple RTMP destinations&#xA;          rtmps_array.forEach((rtmp) => {&#xA;            ffmpegArgs.push("-map", "0:v:0", "-map", "0:a:0", "-f", "flv", `${rtmp.url}/${rtmp.key}`);&#xA;          });&#xA;      &#xA;          // Spawn FFmpeg process&#xA;          ffmpegProcess = spawn("ffmpeg", ffmpegArgs);&#xA;&#xA;        ffmpegProcess.stderr.on(&#x27;data&#x27;, (data) => {&#xA;            console.log(`FFmpeg STDERR: ${data}`);&#xA;    });&#xA;&#xA;        ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;            console.log(`FFmpeg process closed with code ${code}`);&#xA;            ffmpegProcess = null; // Reset process&#xA;            isStreaming = false; // Reset streaming state&#xA;        });&#xA;&#xA;        ffmpegProcess.on(&#x27;error&#x27;, (err) => {&#xA;            console.error(`FFmpeg process error: ${err.message}`);&#xA;            ffmpegProcess = null; // Reset process&#xA;            isStreaming = false; // Reset streaming state&#xA;        });&#xA;&#xA;        console.log(&#x27;FFmpeg process started.&#x27;);&#xA;        isStreaming = true; // Set streaming state to true&#xA;    }&#xA;&#xA;    // Write chunk to FFmpeg process&#xA;    if (isStreaming &amp;&amp; ffmpegProcess &amp;&amp; ffmpegProcess.stdin &amp;&amp; !ffmpegProcess.stdin.destroyed) {&#xA;        try {&#xA;            ffmpegProcess.stdin.write(chunk); // Write chunk to stdin&#xA;            console.log(&#x27;Chunk written to FFmpeg.&#x27;);&#xA;        } catch (err) {&#xA;            console.error(&#x27;Error writing chunk to FFmpeg stdin:&#x27;, err.message);&#xA;        }&#xA;    } else {&#xA;        console.error(&#x27;FFmpeg process or stdin is not ready.&#x27;);&#xA;    }&#xA;});&#xA;&#xA;socket.on("stop-stream", async() => {&#xA;    console.log(&#x27;Stream Stopped.&#x27;);&#xA;&#xA;    if(stream_req_token.length !== 0){&#xA;&#xA;        await pool`UPDATE stream_request &#xA;               SET is_valid=false&#xA;               WHERE token=${stream_req_token}`&#xA;&#xA;        await pool`DELETE FROM current_streams WHERE id=${stream_req_token}`;       &#xA;    }&#xA;&#xA;    if (ffmpegProcess) {&#xA;        isStreaming = false; // Set streaming state to false&#xA;&#xA;        try {&#xA;            // Check if stdin is open before closing&#xA;            if (ffmpegProcess.stdin) {&#xA;                ffmpegProcess.stdin.end(); // End stdin safely&#xA;            }&#xA;&#xA;            // Wait for FFmpeg to close before setting to null&#xA;            ffmpegProcess.on("close", () => {&#xA;                console.log("FFmpeg process closed.");&#xA;                ffmpegProcess = null;&#xA;            });&#xA;&#xA;            // Kill FFmpeg process&#xA;            ffmpegProcess.kill("SIGTERM"); // Use SIGTERM for graceful exit&#xA;&#xA;        } catch (err) {&#xA;            console.error("Error while stopping FFmpeg:", err.message);&#xA;        }&#xA;    } else {&#xA;        console.log("No active FFmpeg process.");&#xA;    }&#xA;});&#xA;&#xA;&#xA;socket.on(&#x27;error&#x27;, (err) => {&#xA;  console.error(&#x27;Socket error:&#x27;, err);&#xA;});&#xA;&#xA;socket.on("disconnect", async() => {&#xA;    console.log(&#x27;Client Disconnected.&#x27;);&#xA;&#xA;    if(stream_req_token.length !== 0){&#xA;&#xA;        await pool`UPDATE stream_request &#xA;               SET is_valid=false&#xA;               WHERE token=${stream_req_token}`;&#xA;&#xA;        await pool`DELETE FROM current_streams WHERE id=${stream_req_token}`;       &#xA;&#xA;    }&#xA;    &#xA;    if (ffmpegProcess) {&#xA;        isStreaming = false; // Set streaming state to false&#xA;&#xA;        try {&#xA;            // Check if stdin is open before closing&#xA;            if (ffmpegProcess.stdin) {&#xA;                ffmpegProcess.stdin.end(); // End stdin safely&#xA;            }&#xA;&#xA;            // Wait for FFmpeg to close before setting to null&#xA;            ffmpegProcess.on("close", () => {&#xA;                console.log("FFmpeg process closed.");&#xA;                ffmpegProcess = null;&#xA;            });&#xA;&#xA;            // Kill FFmpeg process&#xA;            ffmpegProcess.kill("SIGTERM"); // Use SIGTERM for graceful exit&#xA;&#xA;&#xA;        } catch (err) {&#xA;            console.error("Error while stopping FFmpeg:", err.message);&#xA;        }&#xA;    } else {&#xA;        console.log("No active FFmpeg process.");&#xA;    }&#xA;});&#xA;&#xA;};&#xA;

    &#xA;

    &#xA;