Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (12)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (4618)

  • FFMPEG : Cannot read properties of undefined (reading 'format')

    1er avril 2023, par Donnyb

    I am currently to convert a video file to produce a thumbnail through ffmpeg, react-dropzone, and express. However I keep getting a error of "Cannot read properties of undefined (reading 'format')" in my console. For some reason it can not read the "metadata.format.duration" in my program, I have checked if ffmpeg is properly installed by running the ffmpeg —version in my console, and I get all the details, along with ffprobe —version as well.

    


    Here is my code :
upload.js

    


    router.post("/thumbnail", (req, res) => {
    let thumbsFilePath ="";
    let fileDuration ="";

    // req.body.filepath
    ffmpeg.ffprobe(req.body.filepath, function(err, metadata){
        console.dir(metadata);
        console.log(metadata.format.duration);

        fileDuration = metadata.format.duration;
    })

    ffmpeg(req.body.filepath) //req.body.filepath
    .on('filenames', function (filenames) {
        console.log('Will generate ' + filenames.join(', '))
        console.log(filenames);
        thumbsFilePath = "./uploads/thumbnails/" + filenames[0];
        
    })
    .on('end', function () {
        console.log('Screenshots taken');
        return res.json({ success: true, thumbsFilePath: thumbsFilePath, fileDuration: fileDuration})
    })
    .screenshots({
        // Will take screens at 20%, 40%, 60% and 80% of the video
        count: 3,
        folder: './uploads/thumbnails',
        size:'320x240',
        // %b input basename ( filename w/o extension )
        filename:'thumbnail-%b.png'
    });
})


    


    FrontEnd drop code :
AddVideo.js

    


    const onDrop = (files) => {&#xA;&#xA;        let formData = new FormData();&#xA;        const config = {&#xA;            header: { &#x27;content-type&#x27;: &#x27;multipart/form-data&#x27; }&#xA;        }&#xA;        console.log(files)&#xA;        formData.append("file", files[0])&#xA;&#xA;        axios.post(&#x27;http://localhost:5000/api/upload/uploadfiles&#x27;, formData, config)&#xA;            .then(response => {&#xA;                if (response.data.success) {&#xA;&#xA;                    let variable = {&#xA;                        filePath: response.data.filePath,&#xA;                        fileName: response.data.fileName&#xA;                    }&#xA;                    setFilePath(response.data.filePath)&#xA;&#xA;                    //gerenate thumbnail with this filepath ! &#xA;&#xA;                    axios.post(&#x27;http://localhost:5000/api/upload/thumbnail&#x27;, variable)&#xA;                        .then(response => {&#xA;                            if (response.data.success) {&#xA;                                setDuration(response.data.fileDuration)&#xA;                                setThumbnail(response.data.thumbsFilePath)&#xA;                            } else {&#xA;                                alert(&#x27;Failed to make the thumbnails&#x27;);&#xA;                            }&#xA;                        })&#xA;&#xA;&#xA;                } else {&#xA;                    alert(&#x27;failed to save the video in server&#x27;)&#xA;                }&#xA;            })&#xA;&#xA;    }&#xA;&#xA;    return (&#xA;        <div style="{{">&#xA;            <div style="{{">&#xA;                {/*  */}&#xA;            </div>&#xA;&#xA;            <formcontrol>&#xA;            <div style="{{">&#xA;            &#xA;                        {({ getRootProps, getInputProps }) => (&#xA;                            <div style="{{" solid="solid">&#xA;                                <input />&#xA;                                <icon type="plus" style="{{"></icon>&#xA;&#xA;                            </div>&#xA;                        )}&#xA;                    &#xA;            </div>&#xA;            </formcontrol>&#xA;        </div>&#xA;    )&#xA;}&#xA;

    &#xA;

    The video I am trying to upload is a mp4 file. I am using fluent-ffmpeg as a dependency.

    &#xA;

  • How to maximize ffmpeg crop and overlay thousand block in same time ?

    22 juin 2022, par yuno saga

    I try to encrypt a frame of video to random of 16x16 block. so the result will be like artifact video. but exactly it can be decode back. only the creation that know the decode algorithm. but my problem is ffmpeg encode so slow. 3 minutes video, 854x480 (480p) https://www.youtube.com/watch?v=dyRsYk0LyA8. this example result frame that have been filter https://i.ibb.co/0nvLzkK/output-9.jpg. each frame have 1589 block. how to speed up this things ? 3 minutes only 24 frame done. the vido have 5000 thousand frame, so for 3 minutes video it takes 10 hours. i dont know why ffmpeg only take my cpu usage 25%.

    &#xA;

    const { spawn } = require(&#x27;child_process&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;&#xA;function shuffle(array) {&#xA;    let currentIndex = array.length,  randomIndex;&#xA;  &#xA;    // While there remain elements to shuffle.&#xA;    while (currentIndex != 0) {&#xA;  &#xA;      // Pick a remaining element.&#xA;      randomIndex = Math.floor(Math.random() * currentIndex);&#xA;      currentIndex--;&#xA;  &#xA;      // And swap it with the current element.&#xA;      [array[currentIndex], array[randomIndex]] = [&#xA;        array[randomIndex], array[currentIndex]];&#xA;    }&#xA;  &#xA;    return array;&#xA;  }&#xA;&#xA;function filter(width, height) {&#xA;    const sizeBlock = 16;&#xA;    let filterCommands = &#x27;&#x27;;&#xA;    let totalBlock = 0;&#xA;    const widthLengthBlock = Math.floor(width / sizeBlock);&#xA;    const heightLengthBlock = Math.floor(height / sizeBlock);&#xA;    let info = [];&#xA;&#xA;    for (let i=0; i &lt; widthLengthBlock; i&#x2B;&#x2B;) {&#xA;        for (let j=0; j &lt; heightLengthBlock; j&#x2B;&#x2B;) {&#xA;            const xPos = i*sizeBlock;&#xA;            const yPos = j*sizeBlock;&#xA;            filterCommands &#x2B;= `[0]crop=${sizeBlock}:${sizeBlock}:${(xPos)}:${(yPos)}[c${totalBlock}];`;&#xA;&#xA;            info.push({&#xA;                id: totalBlock,&#xA;                x: xPos,&#xA;                y: yPos&#xA;            });&#xA;&#xA;            totalBlock &#x2B;= 1;&#xA;        }   &#xA;    }&#xA;&#xA;    info = shuffle(info);&#xA;&#xA;    for (let i=0; i &lt; info.length; i&#x2B;&#x2B;) {&#xA;        if (i == 0) filterCommands &#x2B;= &#x27;[0]&#x27;;&#xA;        if (i != 0) filterCommands &#x2B;= `[o${i}]`;&#xA;&#xA;        filterCommands &#x2B;= `[c${i}]overlay=x=${info[i].x}:y=${info[i].y}`;&#xA;&#xA;        if (i != (info.length - 1)) filterCommands &#x2B;= `[o${i&#x2B;1}];`;     &#xA;    }&#xA;&#xA;    return filterCommands;&#xA;}&#xA;&#xA;const query = filter(854, 480);&#xA;&#xA;fs.writeFileSync(&#x27;filter.txt&#x27;, query);&#xA;&#xA;const task = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-i&#x27;,&#xA;    &#x27;C:\\Software Development\\ffmpeg\\blackpink.mp4&#x27;,&#xA;    &#x27;-filter_complex_script&#x27;,&#xA;    &#x27;C:\\Software Development\\project\\filter.txt&#x27;,&#xA;    &#x27;-c:v&#x27;,&#xA;    &#x27;libx264&#x27;,&#xA;    &#x27;-preset&#x27;,&#xA;    &#x27;ultrafast&#x27;,&#xA;    &#x27;-pix_fmt&#x27;,&#xA;    &#x27;yuv420p&#x27;,&#xA;    &#x27;-c:a&#x27;,&#xA;    &#x27;libopus&#x27;,&#xA;    &#x27;-progress&#x27;,&#xA;    &#x27;-&#x27;,&#xA;    &#x27;output.mp4&#x27;,&#xA;    &#x27;-y&#x27;&#xA;], {&#xA;    cwd: &#x27;C:\\Software Development\\ffmpeg&#x27;&#xA;});&#xA;&#xA;task.stdout.on(&#x27;data&#x27;, data => { &#xA;    console.log(data.toString())&#xA;})&#xA;

    &#xA;

  • How would I add an audio channel to an rtsp stream ?

    9 septembre 2022, par PlayerWet

    Good companions. It turns out that my Raspberry does not give more than itself when it comes to joining video with audio at good quality and sending it by rtsp. But I think I could send the video in rtsp format and then the audio in mp3, but I would need to join it again on another computer (nas Debian) on my home lan where I have the Shinobi program (security camera manager) installed.

    &#xA;

    I would need something that can somehow grab the rtsp stream and another mp3 audio and merge them into a new rtsp stream. Is this possible ? or is it a crazy idea.

    &#xA;

    On the one hand I send this, which is the transmission of the camera by rtsp through v4l2rtspserver :

    &#xA;

    v4l2rtspserver -H 1080 -W 1920 -F 25 -P 8555 /dev/video0&#xA;

    &#xA;

    And separately I send an audio in mp3 with sound from a usb microphone through ffmpeg :

    &#xA;

    ffmpeg -ac 1 -f alsa -i hw:1,0 -acodec libmp3lame -ab 32k -ac 1 -f rtp rtp://192.168.1.77:12348&#xA;

    &#xA;

    My idea is to put both things together on a nas server in a new rtsp stream (or another idea).

    &#xA;

    But I don't know if with ffmpeg I can capture the video from an rtsp video stream and then be able to join it with the mp3 audio and form another new rtsp stream.

    &#xA;

    Merge these two streams into one and reassemble an rtsp :

    &#xA;

    rtsp://192.168.1.57:8555/unicast&#xA;&#xA;rtp://192.168.1.77:12348&#xA;

    &#xA;

    I have tried this way but it gives me an error :

    &#xA;

    ffmpeg \&#xA;    -i rtsp://192.168.1.57:8555/unicast \&#xA;    -i rtp://192.168.1.37:12348 \&#xA;    -acodec copy -vcodec libx264 \&#xA;    -f rtp_mpegts "rtp://192.168.1.77:5000?ttl=2"&#xA;

    &#xA;

    Error :

    &#xA;

    [h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced&#xA;    Last message repeated 1 times&#xA;[h264 @ 0x55ac6acaf4c0] decode_slice_header error&#xA;[h264 @ 0x55ac6acaf4c0] no frame!&#xA;[h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced&#xA;    Last message repeated 1 times&#xA;[h264 @ 0x55ac6acaf4c0] decode_slice_header error&#xA;[h264 @ 0x55ac6acaf4c0] no frame!&#xA;[h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced&#xA;    Last message repeated 1 times&#xA;

    &#xA;

    What am I doing wrong ?

    &#xA;