Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (14)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (2507)

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

  • FFMPEG no audio get recorded from RTSP stream

    22 mars 2016, par Haris

    I am trying to record rtsp stream on HLS format. I need to record both audio and video. Using below command the video and audio get recorded for some stream like a test rtsp stream from Internet rtsp ://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov. Where as for my IP camera it doesn’t work, means the video get recorded but no audio on output file.

    ./ffmpeg -i rtsp://10.0.8.152:554/media/live/1/1 -acodec copy -vcodec copy -hls_list_size 65535 -hls_time 2 "./live.m3u8"

    Here is the command line output for my IP camera while start recording with above command.

    ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration: --enable-gpl --enable-libx264 --enable-libfreetype --enable-filter=drawtext --prefix=../build_Mar-20-2016
     libavutil      55. 17.103 / 55. 17.103
     libavcodec     57. 24.102 / 57. 24.102
     libavformat    57. 25.100 / 57. 25.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 31.100 /  6. 31.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Guessed Channel Layout for  Input Stream #0.1 : mono
    Input #0, rtsp, from 'rtsp://10.0.8.152:554/media/live/1/1':
     Metadata:
       title           : NVT
       comment         : From NVT
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: h264 (Baseline), yuvj420p(pc), 1280x720, 15 fps, 15 tbr, 90k tbn, 30 tbc
       Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
    Output #0, hls, to './live.m3u8':
     Metadata:
       title           : NVT
       comment         : From NVT
       encoder         : Lavf57.25.100
       Stream #0:0: Video: h264, yuvj420p, 1280x720, q=2-31, 15 fps, 15 tbr, 90k tbn, 15 tbc
       Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35985, current: 6000; changing to 35986. This may result in incorrect timestamps in the output file.
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35986, current: 11998; changing to 35987. This may result in incorrect timestamps in the output file.
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35987, current: 14998; changing to 35988. This may result in incorrect timestamps in the output file.
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35988, current: 23991; changing to 35989. This may result in incorrect timestamps in the output file.
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35989, current: 29990; changing to 35990. This may result in incorrect timestamps in the output file.
    [hls @ 0x33de8c0] Non-monotonous DTS in output stream 0:0; previous: 35990, current: 35987; changing to 35991. This may result in incorrect timestamps in the output file.
    frame=  114 fps= 20 q=-1.0 Lsize=N/A time=00:00:07.59 bitrate=N/A speed=1.32x    
    video:924kB audio:60kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Exiting normally, received signal 2.
  • ffmpeg concat avi files loosing the audio

    14 juin 2016, par Nir Diamant

    Hey i have 2 AVI files that i want to concatenate them to one output.

    the files path is written in text file (mylist.txt) :

    file1.avi - contain video only.
    file2.avi - contain video and audio.

    i execute the next command :

    ffmpeg -f concat -i C:\ffmpeg\mylist.txt -c copy C:\ffmpeg\output.avi

    mylist.txt=

    file ’C :\motionbee\ffmpeg\bin\file1.avi’

    file ’C :\motionbee\ffmpeg\bin\file2.avi’

    the output file is concatenate of the 2 files. but the sound from file2.avi is not there.

    so how can i contact them without delete the sound ???

    console log :

    C:\motionbee\ffmpeg\bin>ffmpeg -f concat -i C:\motionbee\ffmpeg\bin\mylist.txt -
    c copy C:\motionbee\ffmpeg\bin\output.avi
    ffmpeg version N-78949-g6f5048f Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.3.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
    enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
    ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
    ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
    ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable
    -libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --ena
    ble-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx
    264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable
    -lzma --enable-decklink --enable-zlib
     libavutil      55. 19.100 / 55. 19.100
     libavcodec     57. 27.101 / 57. 27.101
     libavformat    57. 28.100 / 57. 28.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 39.100 /  6. 39.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, concat, from 'C:\motionbee\ffmpeg\bin\mylist.txt':
     Duration: N/A, start: 0.000000, bitrate: 523 kb/s
       Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 720
    x480 [SAR 32:27 DAR 16:9], 523 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
    File 'C:\motionbee\ffmpeg\bin\output.avi' already exists. Overwrite ? [y/N] y
    Output #0, avi, to 'C:\motionbee\ffmpeg\bin\output.avi':
     Metadata:
       ISFT            : Lavf57.28.100
       Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x480 [SAR 32:27 D
    AR 16:9], q=2-31, 523 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [concat @ 0000000000452620] New audio stream 0:1 at pos:10038 and DTS:100.104s
    frame= 6000 fps=0.0 q=-1.0 Lsize=   13020kB time=00:03:20.23 bitrate= 532.7kbits
    /s speed=1.39e+003x
    video:12870kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing
    overhead: 1.159987%

    thanks.