Recherche avancée

Médias (0)

Mot : - Tags -/navigation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (49)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (10995)

  • Error with FFmpeg and FS in React : "ErrnoError : FS error"

    23 juillet 2024, par namwan

    I'm working on a React application where I'm using the @ffmpeg/ffmpeg library to compress images and videos. I'm facing an issue with the virtual file system (FS) when trying to read and write files using FFmpeg. I'm getting the following error :

    


    ErrnoError: FS error


    


    Here's the relevant part of my code :

    


    import React, { useState } from "react";&#xA;import { FFmpeg } from "@ffmpeg/ffmpeg";&#xA;&#xA;const ffmpeg = new FFmpeg();&#xA;&#xA;const fetchFile = async (filePath) => {&#xA;    const file = await ffmpeg.readFile(filePath);&#xA;    alert("hello");&#xA;    return new Uint8Array(file).buffer;&#xA;};&#xA;&#xA;&#xA;const Main = () => {&#xA;    const [file, setFile] = useState(null);&#xA;    const [compressedFile, setCompressedFile] = useState("");&#xA;&#xA;    const loadFFmpeg = async () => {&#xA;        if (!ffmpeg.isLoaded) {&#xA;          await ffmpeg.load();&#xA;        }&#xA;      };      &#xA;&#xA;    const getFile = (event) => {&#xA;        const selectedFile = event.target.files[0];&#xA;        &#xA;        if (selectedFile) {&#xA;            setFile(selectedFile);&#xA;        }&#xA;    };&#xA;&#xA;    const compressImage = (selectedFile) => {&#xA;        const img = new Image();&#xA;        img.src = URL.createObjectURL(selectedFile);&#xA;        img.onload = () => {&#xA;            const canvas = document.createElement(&#x27;canvas&#x27;);&#xA;            const MAX_WIDTH = 300;&#xA;            const MAX_HEIGHT = 300;&#xA;            let width = img.width;&#xA;            let height = img.height;&#xA;&#xA;            if (width > height) {&#xA;                if (width > MAX_WIDTH) {&#xA;                    height *= MAX_WIDTH / width;&#xA;                    width = MAX_WIDTH;&#xA;                }&#xA;            } else {&#xA;                if (height > MAX_HEIGHT) {&#xA;                    width *= MAX_HEIGHT / height;&#xA;                    height = MAX_HEIGHT;&#xA;                }&#xA;            }&#xA;&#xA;            canvas.width = width;&#xA;            canvas.height = height;&#xA;            const ctx = canvas.getContext(&#x27;2d&#x27;);&#xA;            ctx.drawImage(img, 0, 0, width, height);&#xA;            const dataUrl = canvas.toDataURL(&#x27;image/jpeg&#x27;, 1.0);&#xA;            setCompressedFile(dataUrl);&#xA;        };&#xA;    };&#xA;&#xA;    const compressVideo = async (selectedFile) => {&#xA;        try {&#xA;            await loadFFmpeg();&#xA;    &#xA;            const arrayBuffer = await selectedFile.arrayBuffer();&#xA;            const fileName = selectedFile.name;&#xA;    &#xA;            await ffmpeg.writeFile(fileName, new Uint8Array(arrayBuffer));&#xA;    &#xA;            await ffmpeg.exec(&#xA;                &#x27;-i&#x27;,&#xA;                fileName,&#xA;                &#x27;-vf&#x27;,&#xA;                &#x27;scale=640:-1&#x27;,&#xA;                &#x27;-c:a&#x27;,&#xA;                &#x27;aac&#x27;,&#xA;                &#x27;-strict&#x27;,&#xA;                &#x27;-2&#x27;,&#xA;                &#x27;output.mp4&#x27;&#xA;            );&#xA;    &#xA;            const data = await fetchFile(&#x27;output.mp4&#x27;);&#xA;            const compressedVideoBlob = new Blob([data], { type: &#x27;video/mp4&#x27; });&#xA;            const compressedVideoUrl = URL.createObjectURL(compressedVideoBlob);&#xA;            setCompressedFile(compressedVideoUrl);&#xA;    &#xA;            await ffmpeg.unlink(fileName);&#xA;            await ffmpeg.unlink(&#x27;output.mp4&#x27;);&#xA;    &#xA;            alert(&#x27;Compression successful&#x27;);&#xA;        } catch (error) {&#xA;            console.error(&#x27;Error:&#x27;, error);&#xA;            alert(&#x27;Compression failed. Please check the console for more details.&#x27;);&#xA;        }&#xA;    };&#xA;        &#xA;&#xA;    const handleSubmit = async (e) => {&#xA;        e.preventDefault();&#xA;&#xA;        if (file) {&#xA;            const fileType = file.name.split(&#x27;.&#x27;).pop().toLowerCase();&#xA;&#xA;            if (fileType === &#x27;png&#x27; || fileType === &#x27;jpg&#x27; || fileType === &#x27;jpeg&#x27;) {&#xA;                compressImage(file);&#xA;            } else if (fileType === &#x27;mp4&#x27; || fileType === &#x27;h264&#x27;) {&#xA;                compressVideo(file);&#xA;            } else {&#xA;                alert(&#x27;Please select a valid file type (png, jpg, jpeg for images or mp4, h264 for videos).&#x27;);&#xA;            }&#xA;        }&#xA;    };&#xA;&#xA;    const handleDownload = () => {&#xA;        if (file) {&#xA;            const downloadLink = document.createElement(&#x27;a&#x27;);&#xA;            downloadLink.href = compressedFile;&#xA;&#xA;            const fileExtension = file.name.split(&#x27;.&#x27;).pop().toLowerCase();&#xA;&#xA;            downloadLink.download = `compressed_file.${fileExtension}`;&#xA;    &#xA;            document.body.appendChild(downloadLink);&#xA;            downloadLink.click();&#xA;            document.body.removeChild(downloadLink);&#xA;        }&#xA;    };&#xA;&#xA;    return (&#xA;        &lt;>&#xA;            <h1>Main Page</h1>&#xA;            <form>&#xA;                <label>Upload</label>&#xA;                <input type="&#x27;file&#x27;" />&#xA;                <br /><br />&#xA;                <input type="submit" value="Compress" />&#xA;            </form>&#xA;            {compressedFile &amp;&amp; (&#xA;                &lt;>&#xA;                    <h2>Compressed File Preview</h2>&#xA;                    {file &amp;&amp; file.name &amp;&amp; ( &#xA;                        file.name.split(&#x27;.&#x27;).pop().toLowerCase() === &#x27;mp4&#x27; || file.name.split(&#x27;.&#x27;).pop().toLowerCase() === &#x27;h264&#x27; ? (&#xA;                            <video width="300" controls="controls">&#xA;                                <source src="{compressedFile}" type="video/mp4"></source>&#xA;                                Your browser does not support the video tag.&#xA;                            </video>&#xA;                        ) : (&#xA;                            <img src="http://stackoverflow.com/feeds/tag/{compressedFile}" alt="Compressed file preview" style='max-width: 300px; max-height: 300px' />&#xA;                        )&#xA;                    )}&#xA;                    <br /><br />&#xA;                    <button>Download Compressed File</button>&#xA;                >&#xA;            )}&#xA;        >&#xA;    );&#xA;};&#xA;&#xA;export default Main;&#xA;

    &#xA;

    I'm using ffmpeg.readFile and ffmpeg.writeFile to read and write files to FFmpeg's virtual file system. I've also tried using ffmpeg.read and ffmpeg.write but still encounter the same issue.

    &#xA;

    Could someone please help me understand what might be causing this FS error and how to resolve it ?

    &#xA;

  • Nginx RTMP "Server Error : No Such Stream"

    7 août 2024, par Tony Ruth

    I am trying to capture and stream video within my network 10.100.64.1/24 using libnginx-mod-rtmp. I followed a tutorial. I used the same URL for publishing and playing : rtmp ://10.100.64.4/lab/test But the player does not find the stream.

    &#xA;

    My nginx settings :

    &#xA;

    rtmp {&#xA;&#xA;    server {&#xA;&#xA;        listen 1935;&#xA;        chunk_size 4096;&#xA;        allow publish 127.0.0.1;&#xA;        allow publish 10.100.64.4/24;&#xA;        deny publish all;&#xA;        allow play 127.0.0.1;&#xA;        allow play 10.100.64.4/24;&#xA;        deny play all;&#xA;&#xA;        application lab {&#xA;&#xA;            live on;&#xA;            idle_streams off;&#xA;            record all;&#xA;            record_path /media/HLEV/GoPro/Raw;&#xA;            record_unique on;&#xA;        } &#xA;    }&#xA;} &#xA;

    &#xA;

    The server lives on 10.100.64.4, so I published a video using ffmpeg :

    &#xA;

    ffmpeg -stream_loop -1 -re -i MyVideo.flv -c:v copy -c:a aac -ar 44100 -ac 1 -f flv -flvflags no_duration_filesize rtmp://10.100.64.4/lab/test&#xA;

    &#xA;

    The publishing looks good. Last line of the above command :

    &#xA;

    frame=54030 fps= 60 q=-1.0 size=  119584kB time=00:15:01.00 bitrate=1087.3kbits/s speed=   1x &#xA;

    &#xA;

    And I can see that the video is being saved locally from the record block of the nginx settings.

    &#xA;

    Then I try to play the stream using ffplay :

    &#xA;

    ffplay -i rtmp://10.100.64.4/lab/test&#xA;ffplay version 5.1.5-0&#x2B;deb12u1 Copyright (c) 2003-2024 the FFmpeg developers&#xA;  built with gcc 12 (Debian 12.2.0-14)&#xA;  configuration: --prefix=/usr --extra-version=0&#x2B;deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared&#xA;  libavutil      57. 28.100 / 57. 28.100&#xA;  libavcodec     59. 37.100 / 59. 37.100&#xA;  libavformat    59. 27.100 / 59. 27.100&#xA;  libavdevice    59.  7.100 / 59.  7.100&#xA;  libavfilter     8. 44.100 /  8. 44.100&#xA;  libswscale      6.  7.100 /  6.  7.100&#xA;  libswresample   4.  7.100 /  4.  7.100&#xA;  libpostproc    56.  6.100 / 56.  6.100&#xA;[rtmp @ 0x7fe7940015c0] Server error: No such stream=    0B f=0/0   &#xA;rtmp://127.0.0.1/lab/test: Operation not permitted&#xA;    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 &#xA;

    &#xA;

    ffplay does not find the stream.

    &#xA;

    I can observe both the publish and play commands by examine the access log of nginx :

    &#xA;

    sudo tail -2 /var/log/nginx/access.log &#xA;10.100.64.4 [07/Aug/2024:12:24:56 -0500] PUBLISH "lab" "test" "" - 45365243 529 "" "FMLE/3.0 (compatible; Lavf59.27" (5m 36s)&#xA;10.100.64.4 [07/Aug/2024:12:25:03 -0500] PLAY "lab" "test" "" - 368 412 "" "LNX 9,0,124,2" (0s)&#xA;

    &#xA;

    I have tried using different video streams (directly from a webcam instead of from ffmpeg). I have also tried using different players (VLC instead of ffplay).

    &#xA;

    How do I connect to the stream ?&#xA;Do you need different URLs for publishing versus playing ? The way I understood it, publishing is on port 1395 and playing is on port 80, so there is no conflict with using the same URL.&#xA;Is there a way to list the currently active streams on my server ?

    &#xA;

  • vcpkg error : BUILD_FAILED when "Getting CMake variables for x64-windows"

    24 août 2024, par Rok Benko

    I'm trying to install ffmpeg via vcpkg on Windows by running the following command :

    &#xA;

    vcpkg.exe install ffmpeg

    &#xA;

    The installation throws an error when getting CMake variables for x64-windows.

    &#xA;

    -- Getting CMake variables for x64-windows&#xA;CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):&#xA;    Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v&#xA;    Working Directory: C:/Users/xxxxx/vcpkg/buildtrees/pkgconf/x64-windows-rel/vcpkg-parallel-configure&#xA;    Error code: 1&#xA;    See logs for more information:&#xA;      C:\Users\xxxxx\vcpkg\buildtrees\pkgconf\cmake-get-vars-x64-windows-dbg-CMakeCache.txt.log&#xA;      C:\Users\xxxxx\vcpkg\buildtrees\pkgconf\cmake-get-vars-x64-windows-rel-CMakeCache.txt.log&#xA;      C:\Users\xxxxx\vcpkg\buildtrees\pkgconf\cmake-get-vars-x64-windows-dbg-CMakeConfigureLog.yaml.log&#xA;      C:\Users\xxxxx\vcpkg\buildtrees\pkgconf\cmake-get-vars-x64-windows-rel-CMakeConfigureLog.yaml.log&#xA;      C:\Users\xxxxx\vcpkg\buildtrees\pkgconf\cmake-get-vars-x64-windows-out.log&#xA;&#xA;Call Stack (most recent call first):&#xA;  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:269 (vcpkg_execute_required_process)&#xA;  installed/x64-windows/share/vcpkg-cmake-get-vars/vcpkg_cmake_get_vars.cmake:15 (vcpkg_cmake_configure)&#xA;  installed/x64-windows/share/vcpkg-tool-meson/vcpkg_configure_meson.cmake:323 (vcpkg_cmake_get_vars)&#xA;  installed/x64-windows/share/vcpkg-tool-meson/vcpkg_configure_meson.cmake:458 (vcpkg_generate_meson_cmd_args)&#xA;  ports/pkgconf/portfile.cmake:9 (vcpkg_configure_meson)&#xA;  scripts/ports.cmake:192 (include)&#xA;&#xA;&#xA;error: building pkgconf:x64-windows failed with: BUILD_FAILED&#xA;See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.&#xA;Elapsed time to handle pkgconf:x64-windows: 1.9 s&#xA;Please ensure you&#x27;re using the latest port files with `git pull` and `vcpkg update`.&#xA;Then check for known issues at:&#xA;  https://github.com/microsoft/vcpkg/issues?q=is%3Aissue&#x2B;is%3Aopen&#x2B;in%3Atitle&#x2B;pkgconf&#xA;You can submit a new issue at:&#xA;  https://github.com/microsoft/vcpkg/issues/new?title=xxxxx&#xA;

    &#xA;

    What does this error mean ? The suggested git pull and vcpkg update didn't solve the error. The directory is up to date.

    &#xA;

    PS : I opened logs, but I have no idea how to solve the error. I don't understand them.

    &#xA;