Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (88)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (8441)

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

    


    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.

    


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

    


    v4l2rtspserver -H 1080 -W 1920 -F 25 -P 8555 /dev/video0


    


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

    


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


    


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

    


    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.

    


    Merge these two streams into one and reassemble an rtsp :

    


    rtsp://192.168.1.57:8555/unicast

rtp://192.168.1.77:12348


    


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

    


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


    


    Error :

    


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


    


    What am I doing wrong ?

    


  • 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%.

    


    const { spawn } = require('child_process');
const fs = require('fs');

function shuffle(array) {
    let currentIndex = array.length,  randomIndex;
  
    // While there remain elements to shuffle.
    while (currentIndex != 0) {
  
      // Pick a remaining element.
      randomIndex = Math.floor(Math.random() * currentIndex);
      currentIndex--;
  
      // And swap it with the current element.
      [array[currentIndex], array[randomIndex]] = [
        array[randomIndex], array[currentIndex]];
    }
  
    return array;
  }

function filter(width, height) {
    const sizeBlock = 16;
    let filterCommands = '';
    let totalBlock = 0;
    const widthLengthBlock = Math.floor(width / sizeBlock);
    const heightLengthBlock = Math.floor(height / sizeBlock);
    let info = [];

    for (let i=0; i < widthLengthBlock; i++) {
        for (let j=0; j < heightLengthBlock; j++) {
            const xPos = i*sizeBlock;
            const yPos = j*sizeBlock;
            filterCommands += `[0]crop=${sizeBlock}:${sizeBlock}:${(xPos)}:${(yPos)}[c${totalBlock}];`;

            info.push({
                id: totalBlock,
                x: xPos,
                y: yPos
            });

            totalBlock += 1;
        }   
    }

    info = shuffle(info);

    for (let i=0; i < info.length; i++) {
        if (i == 0) filterCommands += '[0]';
        if (i != 0) filterCommands += `[o${i}]`;

        filterCommands += `[c${i}]overlay=x=${info[i].x}:y=${info[i].y}`;

        if (i != (info.length - 1)) filterCommands += `[o${i+1}];`;     
    }

    return filterCommands;
}

const query = filter(854, 480);

fs.writeFileSync('filter.txt', query);

const task = spawn('ffmpeg', [
    '-i',
    'C:\\Software Development\\ffmpeg\\blackpink.mp4',
    '-filter_complex_script',
    'C:\\Software Development\\project\\filter.txt',
    '-c:v',
    'libx264',
    '-preset',
    'ultrafast',
    '-pix_fmt',
    'yuv420p',
    '-c:a',
    'libopus',
    '-progress',
    '-',
    'output.mp4',
    '-y'
], {
    cwd: 'C:\\Software Development\\ffmpeg'
});

task.stdout.on('data', data => { 
    console.log(data.toString())
})


    


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