Recherche avancée

Médias (0)

Mot : - Tags -/page unique

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

Autres articles (80)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (6716)

  • ffmpeg command to add moving text watermark to video [closed]

    13 octobre 2023, par Imran Khan
    

    

            // Constants for watermark movement, direction change intervals, fade intervals, and overlap duration
        const MOVE_SPEED = 3;
        const DIRECTION_CHANGE_MIN = 3000;
        const DIRECTION_CHANGE_MAX = 6000;
        const FADE_INTERVAL_MIN = 10000;
        const FADE_INTERVAL_MAX = 20000;
        const OVERLAP_DURATION = 2000;

        // Get references to the video container and watermarks
        const container = document.querySelector('.video-container');
        const watermark1 = document.getElementById('watermark1');
        const watermark2 = document.getElementById('watermark2');

        // Helper function to get a random integer between min and max (inclusive)
        function getRandomInt(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }

        // Helper function to get a random direction (either 1 or -1)
        function getRandomDirection() {
            return Math.random() > 0.5 ? 1 : -1;
        }

        // Set the initial position of the watermark inside the video container
        function setInitialPosition(watermark) {
            const x = getRandomInt(0, container.offsetWidth - watermark.offsetWidth);
            const y = getRandomInt(0, container.offsetHeight - watermark.offsetHeight);
            watermark.style.left = `${x}px`;
            watermark.style.top = `${y}px`;
            watermark.style.opacity = 1;
        }

        // Function to handle continuous movement of the watermark
        function continuousMove(watermark) {
            let dx = getRandomDirection() * MOVE_SPEED;
            let dy = getRandomDirection() * MOVE_SPEED;

            // Inner function to handle the actual movement logic
            function move() {
                let x = parseInt(watermark.style.left || 0) + dx;
                let y = parseInt(watermark.style.top || 0) + dy;

                // Check boundaries and reverse direction if necessary
                if (x < 0 || x > container.offsetWidth - watermark.offsetWidth) {
                    dx = -dx;
                }
                if (y < 0 || y > container.offsetHeight - watermark.offsetHeight) {
                    dy = -dy;
                }

                // Apply the new position
                watermark.style.left = `${x}px`;
                watermark.style.top = `${y}px`;

                // Continue moving
                setTimeout(move, 100);
            }

            move();

            // Change direction at random intervals
            setInterval(() => {
                const randomChoice = Math.random();
                if (randomChoice < 0.33) {
                    dx = getRandomDirection() * MOVE_SPEED;
                    dy = 0;
                } else if (randomChoice < 0.66) {
                    dy = getRandomDirection() * MOVE_SPEED;
                    dx = 0;
                } else {
                    dx = getRandomDirection() * MOVE_SPEED;
                    dy = getRandomDirection() * MOVE_SPEED;
                }
            }, getRandomInt(DIRECTION_CHANGE_MIN, DIRECTION_CHANGE_MAX));
        }

        // Handle the fading out of the old watermark and fading in of the new watermark
        function fadeOutAndIn(oldWatermark, newWatermark) {
            setTimeout(() => {
                setInitialPosition(newWatermark);
                newWatermark.style.opacity = 1;
            }, 0);

            setTimeout(() => {
                oldWatermark.style.opacity = 0;
            }, OVERLAP_DURATION);

            // Continue the cycle
            setTimeout(() => fadeOutAndIn(newWatermark, oldWatermark), getRandomInt(FADE_INTERVAL_MIN, FADE_INTERVAL_MAX));
        }

        // Initialize the watermarks
        setInitialPosition(watermark1);
        continuousMove(watermark1);
        setTimeout(() => fadeOutAndIn(watermark1, watermark2), getRandomInt(FADE_INTERVAL_MIN, FADE_INTERVAL_MAX));
        continuousMove(watermark2);
    

    


    body, html {
            height: 100%;
            margin: 0;
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #eee;
        }

        .video-container {
            width: 50vw;
            height: 50vh;
            background-color: black;
            position: relative;
            overflow: hidden;
        }

        .watermark {
            font-size: 22px;
            position: absolute;
            color: white;
            opacity: 0;
            transition: opacity 2s;
        }

    


    &#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;&#xA;&#xA;    <div class="video-container">&#xA;        <span class="watermark">watermark</span>&#xA;        <span class="watermark">watermark</span>&#xA;    </div>&#xA;    &#xA;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

    I am trying to achieve an animation effect using ffmpeg. I am adding text watermark to an input video and animate the text diagonally, horizontally or vertically changed randomly. Here is what I have achieved so far.

    &#xA;

    ffmpeg -i video.mp4 -c:v libx264 -preset veryfast -crf 25 -tune zerolatency -vendor ap10 -pix_fmt yuv420p -filter:v "drawtext=fontfile=./fonts/Roboto/Roboto-Light.ttf:text=&#x27;Watermark&#x27;:fontcolor=white:alpha=0.5:fontsize=60:y=h/10*mod(t\,10):x=w/10*mod(t\,10):enable=1" -c:a copy watermark.mp4

    &#xA;

    Here is what I want it to work.

    &#xA;

    Initial Position :&#xA;The watermark randomly placed in the video the first time they appear.

    &#xA;

    Continuous Movement :&#xA;The watermark continuously moves within the video.&#xA;The direction and speed of the watermark's movement are random. It can move diagonally, purely horizontally, or purely vertically.&#xA;When the watermark reaches the boundaries of the video, it bounces back, changing its direction.

    &#xA;

    Direction Change :&#xA;During its continuous movement, the watermark will suddenly change its direction at random intervals between 3 to 6 seconds.&#xA;When changing direction, the watermark can randomly determined move diagonally, purely horizontally, or purely vertically.

    &#xA;

    Fade In and Out :&#xA;Every 10 to 20 seconds (randomly determined), the current watermark begins to fade out.&#xA;As the old watermark starts to fade out, a new watermark fades in at a random position, ensuring that there's always a visible watermark on the screen.&#xA;These two watermarks (the fading old one and the emerging new one) overlap on the screen for a duration of 2 seconds, after which the old watermark completely disappears.&#xA;These patterns and characteristics together provide a dynamic, constantly moving, and changing watermark for the video

    &#xA;

    To achieve the result I think we can use the drawtext multiple times. I have attached the HTML and JavaScript variant just for the reference to understand the result but I am trying to do this using ffmpeg.

    &#xA;

  • How to open MIL avi video fiile

    12 février 2017, par ahme0307

    I have some (AVI) videos with MIL(Matrox Imaging Library) codec. I have tried multiple codecs but i am not able to open.
    I have tried VLC, K-lite codecs,ffmpeg, here is the log file from k-Lite

    >##LAV Splitter Source (internal)::Video
    >
    >Media Type 0:
    >--------------------------
    >Video: MIL  256x256 5fps 489kbps
    >AM_MEDIA_TYPE:
    >majortype: MEDIATYPE_Video {73646976-0000-0010-8000-00AA00389B71}
    >subtype: Unknown GUID Name {204C494D-0000-0010-8000-00AA00389B71}
    >formattype: FORMAT_VideoInfo {05589F80-C356-11CE-BF01-00AA0055595A}
    >bFixedSizeSamples: 0
    >bTemporalCompression: 1
    >lSampleSize: 1
    >cbFormat: 128
    >
    >VIDEOINFOHEADER:
    >rcSource: (0,0)-(256,256)
    >rcTarget: (0,0)-(256,256)
    >dwBitRate: 489508
    >dwBitErrorRate: 0
    >AvgTimePerFrame: 2000000
    >
    >BITMAPINFOHEADER:
    >biSize: 80
    >biWidth: 256
    >biHeight: 256
    >biPlanes: 1
    >biBitCount: 24
    >biCompression: MIL
    >biSizeImage: 196608
    >biXPelsPerMeter: 0
    >biYPelsPerMeter: 0
    >biClrUsed: 0
    >biClrImportant: 0
    >
    >pbFormat:
    >
    >

    I also tried ffplay and here is the output
    enter image description here

    The only software i came across that can open this video is from Matrox and it doesn’t allow exporting to other formats
    enter image description here
    I appreciate if some one can direct me to codecs that can handle this videos. I would like convert to other video formats for further processing.

  • Remove old/broken PPC/Altivec code.

    13 juillet 2014, par Erik de Castro Lopo
    Remove old/broken PPC/Altivec code.
    

    * Removes FLAC__lpc_restore_signal_asm_ppc_altivec_16*
    from lpc.h and stream_decoder.c
    * Removes PPC-specific code from cpu.c and cpu.h
    * Removes PPC stuff from libFLAC/Makefile.lite and build/*.mk
    * Removes as/gas/PPC-specific stuff from configure.ac and
    libFLAC/Makefile.am*
    * Removes libFLAC/ppc folder and remove "src/libFLAC/ppc*/Makefile"
    lines from configure.ac

    Patch-from : lvqcl <lvqcl.mail@gmail.com>

    • [DH] build/compile.mk
    • [DH] build/exe.mk
    • [DH] build/lib.mk
    • [DH] configure.ac
    • [DH] src/libFLAC/Makefile.am
    • [DH] src/libFLAC/Makefile.lite
    • [DH] src/libFLAC/cpu.c
    • [DH] src/libFLAC/include/private/cpu.h
    • [DH] src/libFLAC/include/private/lpc.h
    • [DH] src/libFLAC/ppc/Makefile.am
    • [DH] src/libFLAC/ppc/as/Makefile.am
    • [DH] src/libFLAC/ppc/as/lpc_asm.s
    • [DH] src/libFLAC/ppc/gas/Makefile.am
    • [DH] src/libFLAC/ppc/gas/lpc_asm.s
    • [DH] src/libFLAC/stream_decoder.c