Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (86)

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

  • 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (12383)

  • av_interleaved_write_frame() : Cannot allocate memory, Error writing trailer of udp

    30 août 2022, par Technical_Union7716

    I'm transcoding from udp input to mpegts udp output. After several hours ffmpeg used all ram memory. I don't know where the problem is.

    


    Command :

    


    ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i "udp://239.100.1.5:1234?fifo_size=1000000&overrun_nonfatal=1" -map i:0x100 -map i:0x101 -vf 'scale_vaapi=w=720:h=576,hwdownload,format=nv12,fps=25' -c:v mpeg2video -b:v 5000k -minrate 5000k -maxrate 5000k -muxrate 7000k -pcr_period 40 -flags:v +ildct+ilme -top 0 -aspect 16:9 -c:a mp2 -b:a 192k -c:s copy -mpegts_service_id 1 -metadata service_name="Transcoded" -metadata service_provider="HD to SD" -f mpegts "udp://239.120.1.2:7006?pkt_size=1316&bitrate=12000000"


    


    Logs :

    


    Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt709, bottom first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 5000 kb/s, 25 fps, 90k tbn2022-08-23 13:27:04,291


    


    Metadata :

    


    encoder : Lavc59.39.100 mpeg2video


    


    Side data :

    


    cpb: bitrate max/min/avg: 5000000/5000000/5000000 buffer size: 1835008 vbv_delay: N/A
Stream #0:1(und): Audio: mp2, 44100 Hz, stereo, s16, 192 kb/s


    


    Metadata :

    


    encoder : Lavc59.39.100 mp2
2022-08-24 04:08:47,884 av_interleaved_write_frame(): Cannot allocate memory41:02.67 bitrate=7000.0kbits/s speed=0.999x
2022-08-24 04:08:47,893 Last message repeated 1 times
2022-08-24 04:08:47,897 Error writing trailer of udp://239.120.1.2:7006?pkt_size=1316&bitrate=12000000: Cannot allocate memory
2022-08-24 04:08:47,898 frame=1321595 fps= 25 q=2.0 Lsize=45171938kB time=14:41:04.20 bitrate=7000.0kbits/s speed=0.999x
video:32265447kB audio:1239612kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 34.821243%
2022-08-24 04:08:51,469 Error closing file udp://239.120.1.2:7006?pkt_size=1316&bitrate=12000000: Cannot allocate memory
2022-08-24 04:08:51,750 Conversion failed!


    


    Any ideas ?

    


  • 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;