Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (56)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (8945)

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

  • licheepi zero V3S ffmpeg photo error, kernel uboot is OK

    24 juillet 2023, par xiaocijun

    I use firmware built by someone else and can take photos using fswebcam. Then I changed the root file system to I built Debian with ffmpeg.

    &#xA;

    I used this command to test my camera

    &#xA;

    ffmpeg-f v4l2-video_size 800x600 -i /dev/video0-frames 1 out.jpg

    &#xA;

    But the command line prompts an error

    &#xA;

    [video4linux2,v4l2 @ 0x5231e0] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device&#xA;[video4linux2,v4l2 @ 0x5231e0] Time per frame unknown&#xA;[  655.763013] ffmpeg: page allocation failure: order:8, mode:0xcc0(GFP_KERNEL), nodemask=(null)&#xA;[  655.771678] CPU: 0 PID: 236 Comm: ffmpeg Not tainted 5.2.0-licheepi-zero #1&#xA;[  655.778630] Hardware name: Allwinner sun8i Family&#xA;[  655.783363] [<c010ed14>] (unwind_backtrace) from [<c010b72c>] (show_stack&#x2B;0x10/0x14)&#xA;[  655.791107] [<c010b72c>] (show_stack) from [<c0699330>] (dump_stack&#x2B;0x84/0x98)&#xA;[  655.798330] [<c0699330>] (dump_stack) from [<c01fbf30>] (warn_alloc&#x2B;0xcc/0x170)&#xA;[  655.805638] [<c01fbf30>] (warn_alloc) from [<c01fcb40>] (__alloc_pages_nodemask&#x2B;0xacc/0xcf4)&#xA;[  655.814070] [<c01fcb40>] (__alloc_pages_nodemask) from [<c0114350>] (__dma_alloc_buffer.constprop.4&#x2B;0x34/0x17c)&#xA;[  655.824147] [<c0114350>] (__dma_alloc_buffer.constprop.4) from [<c01144bc>] (__alloc_remap_buffer&#x2B;0x24/0x98)&#xA;[  655.833962] [<c01144bc>] (__alloc_remap_buffer) from [<c0114558>] (remap_allocator_alloc&#x2B;0x28/0x30)&#xA;[  655.842996] [<c0114558>] (remap_allocator_alloc) from [<c01146fc>] (__dma_alloc&#x2B;0x16c/0x2c8)&#xA;[  655.851424] [<c01146fc>] (__dma_alloc) from [<c01148d4>] (arm_dma_alloc&#x2B;0x40/0x48)&#xA;[  655.858988] [<c01148d4>] (arm_dma_alloc) from [<c017c928>] (dma_alloc_attrs&#x2B;0x100/0x110)&#xA;[  655.867080] [<c017c928>] (dma_alloc_attrs) from [<c0512da0>] (vb2_dc_alloc&#x2B;0x60/0x104)&#xA;[  655.874994] [<c0512da0>] (vb2_dc_alloc) from [<c050ccac>] (__vb2_queue_alloc&#x2B;0x184/0x444)&#xA;[  655.883165] [<c050ccac>] (__vb2_queue_alloc) from [<c050d4bc>] (vb2_core_reqbufs&#x2B;0x2c4/0x440)&#xA;[  655.891681] [<c050d4bc>] (vb2_core_reqbufs) from [<c0510d34>] (vb2_ioctl_reqbufs&#x2B;0xa0/0xc8)&#xA;[  655.900029] [<c0510d34>] (vb2_ioctl_reqbufs) from [<c04ecd20>] (__video_do_ioctl&#x2B;0x288/0x454)&#xA;[  655.908549] [<c04ecd20>] (__video_do_ioctl) from [<c04ed280>] (video_usercopy&#x2B;0x23c/0x504)&#xA;[  655.916808] [<c04ed280>] (video_usercopy) from [<c02287a8>] (do_vfs_ioctl&#x2B;0xac/0x8cc)&#xA;[  655.924631] [<c02287a8>] (do_vfs_ioctl) from [<c0228ffc>] (ksys_ioctl&#x2B;0x34/0x58)&#xA;[  655.932021] [<c0228ffc>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall&#x2B;0x0/0x54)&#xA;[  655.939665] Exception stack(0xc3173fa8 to 0xc3173ff0)&#xA;[  655.944713] 3fa0:                   005231e0 00000000 00000003 c0145608 beab41f8 b5857af1&#xA;[  655.952882] 3fc0: 005231e0 00000000 beab4290 00000036 ffffffe7 00000000 005238c0 beab41f8&#xA;[  655.961047] 3fe0: 00000001 beab41b4 b6f167b7 b5857af8&#xA;[  655.966218] Mem-Info:&#xA;[  655.968511] active_anon:3427 inactive_anon:154 isolated_anon:1&#xA;[  655.968511]  active_file:3577 inactive_file:2858 isolated_file:1&#xA;[  655.968511]  unevictable:4 dirty:7 writeback:0 unstable:0&#xA;[  655.968511]  slab_reclaimable:630 slab_unreclaimable:1467&#xA;[  655.968511]  mapped:5008 shmem:429 pagetables:140 bounce:0&#xA;[  655.968511]  free:1421 free_pcp:17 free_cma:0&#xA;[  656.000905] Node 0 active_anon:13708kB inactive_anon:616kB active_file:14308kB inactive_file:11432kB unevictable:16kB isolated(anon):4kB isolated(file):4kB mapped:20032kB dirty:28kB writeback:0kB shmem:1716kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no&#xA;[  656.024016] Normal free:5684kB min:936kB low:1168kB high:1400kB active_anon:13708kB inactive_anon:616kB active_file:14308kB inactive_file:11432kB unevictable:16kB writepending:28kB present:65536kB managed:56092kB mlocked:16kB kernel_stack:392kB pagetables:560kB bounce:0kB free_pcp:68kB local_pcp:68kB free_cma:0kB&#xA;[  656.051697] lowmem_reserve[]: 0 0 0&#xA;[  656.055185] Normal: 173*4kB (ME) 87*8kB (UME) 51*16kB (ME) 25*32kB (ME) 12*64kB (ME) 7*128kB (M) 2*256kB (M) 1*512kB (M) 0*1024kB 0*2048kB 0*4096kB = 5692kB&#xA;[  656.069205] 6865 total pagecache pages&#xA;[  656.072949] 0 pages in swap cache&#xA;[  656.076271] Swap cache stats: add 0, delete 0, find 0/0&#xA;[  656.081486] Free swap  = 0kB&#xA;[  656.084360] Total swap = 0kB&#xA;[  656.087252] 16384 pages RAM&#xA;[  656.090040] 0 pages HighMem/MovableOnly&#xA;[  656.093868] 2361 pages reserved&#xA;[  656.097039] sun6i-csi 1cb4000.csi: dma_alloc_coherent of size 720896 failed&#xA;[video4linux2,v4l2 @ 0x5231e0] ioctl(VIDIOC_REQBUFS): Cannot allocate memory&#xA;/dev/video0: Cannot allocate memory&#xA;</c0101000></c0228ffc></c0228ffc></c02287a8></c02287a8></c04ed280></c04ed280></c04ecd20></c04ecd20></c0510d34></c0510d34></c050d4bc></c050d4bc></c050ccac></c050ccac></c0512da0></c0512da0></c017c928></c017c928></c01148d4></c01148d4></c01146fc></c01146fc></c0114558></c0114558></c01144bc></c01144bc></c0114350></c0114350></c01fcb40></c01fcb40></c01fbf30></c01fbf30></c0699330></c0699330></c010b72c></c010b72c></c010ed14>

    &#xA;

  • Vagrant provision fails to execute the next script without an obvious reason why

    14 juin 2016, par JakeTheSnake

    I’ve created/co-opted several bash scripts to provision my guest Ubuntu 14.04 OS ; the one giving me trouble right now is installing ffmpeg. When the script finishes, vagrant simply does nothing save for sending SSH keep-alives.

    Host OS : Windows 7 x64

    The last output before the infinitely repeating keep-alives is :

    INSTALL libavutil/sha.h
    INSTALL libavutil/sha512.h
    INSTALL libavutil/stereo3d.h
    INSTALL libavutil/threadmessage.h
    INSTALL libavutil/time.h
    INSTALL libavutil/timecode.h
    INSTALL libavutil/timestamp.h
    INSTALL libavutil/tree.h
    INSTALL libavutil/twofish.h
    INSTALL libavutil/version.h
    INSTALL libavutil/xtea.h
    INSTALL libavutil/tea.h
    INSTALL libavutil/lzo.h
    INSTALL libavutil/avconfig.h
    INSTALL libavutil/ffversion.h

    DEBUG ssh: stdout: INSTALL      libavutil/libavutil.pc

    DEBUG ssh: stdout: Done

    DEBUG ssh: Sending SSH keep-alive...
    DEBUG ssh: Sending SSH keep-alive...
    DEBUG ssh: Sending SSH keep-alive...

    Here are the relevant scripts :

    Vagrantfile

    # -*- mode: ruby -*-
    # vi: set ft=ruby :

    # All Vagrant configuration is done below. The "2" in Vagrant.configure
    # configures the configuration version (we support older styles for
    # backwards compatibility). Please don't change it unless you know what
    # you're doing.
    Vagrant.configure(2) do |config|
     # The most common configuration options are documented and commented below.
     # For a complete reference, please see the online documentation at
     # https://docs.vagrantup.com.

     # Every Vagrant development environment requires a box. You can search for
     # boxes at https://atlas.hashicorp.com/search.
     config.vm.box = 'ubuntu/trusty64'
     config.vm.hostname = 'dev'

     config.ssh.forward_agent = true
     config.ssh.pty = true

     # Create a private network, which allows host-only access to the machine
     # using a specific IP.
     config.vm.network :private_network, type: :dhcp, auto_config: false

     # Create a public network, which generally matched to bridged network.
     # Bridged networks make the machine appear as another physical device on
     # your network.
     config.vm.network :public_network,
                       ip: '192.168.11.14',
                       bridge: 'Realtek PCIe GBE Family Controller'

     # Share an additional folder to the guest VM. The first argument is
     # the path on the host to the actual folder. The second argument is
     # the path on the guest to mount the folder. And the optional third
     # argument is a set of non-required options.
     #
     # Do not share root directory of vagrant
     # config.vm.synced_folder '.', '/vagrant', disabled: true
     # Share ruby repository directories
     config.vm.synced_folder '.',
                             '/home/vagrant/apps',
                             nfs: true,
                             mount_options: [
                               'nfsvers=3',
                               'vers=3',
                               'actimeo=1',
                               'rsize=8192',
                               'wsize=8192',
                               'timeo=14',
                               :nolock,
                               :udp,
                               :intr,
                               :user,
                               :auto,
                               :exec,
                               :rw
                             ]

     # Provider-specific configuration so you can fine-tune various
     # backing providers for Vagrant. These expose provider-specific options.
     # Example for VirtualBox:
     #
     config.vm.provider :virtualbox do |vb|
       # Display the VirtualBox GUI when booting the machine
       vb.gui = true

       # Use VBoxManage to customize the VM.
       vb.name = 'Ubuntu'
       vb.cpus = 4
       vb.memory = 2048
       vb.customize ['modifyvm', :id, '--vram', 64]
       vb.customize ['modifyvm', :id, '--audio', :dsound]
       vb.customize ['modifyvm', :id, '--audiocontroller', :ac97]
       vb.customize ['modifyvm', :id, '--clipboard', :bidirectional]
     end

     # Provisioning
     config.vm.provision :shell, path: './provisioning/user/install-apps.sh',
                                 privileged: false, name: 'Applications'
     config.vm.provision :shell, path: './provisioning/user/install-rvm.sh',
                                 args: 'stable', privileged: false, name: 'RVM'
     config.vm.provision :shell, path: './provisioning/user/install-ruby.sh',
                                 args: '2.3.1', privileged: false, name: 'Ruby'
     config.vm.provision :shell, path: './provisioning/user/install-ruby-gems.sh',
                                 privileged: false, name: 'Ruby Gems'
     config.vm.provision :shell, path: './provisioning/root/install-nginx.sh',
                                 args: '1.9.9', name: 'Nginx'

     config.vm.provision :chef_solo do |chef|
       # chef.version = '12.10.40'

       # Paths to your cookbooks (on the host)
       chef.cookbooks_path = ['cookbooks']
       # Add chef recipes
       chef.add_recipe 'apt'
       chef.add_recipe 'git' # Is required for NPM
       chef.add_recipe 'sqlite'
       chef.add_recipe 'mysql'
       chef.add_recipe 'nodejs'
       chef.add_recipe 'memcached'
       chef.add_recipe 'imagemagick'
       chef.add_recipe 'optipng'
       chef.add_recipe 'sublime-text'
       chef.add_recipe 'tomcat'
     end
    end

    install-apps.sh

    #!/usr/bin/env bash

    echo Turning off console beeps...
    grep '^set bell-style none' /etc/inputrc || echo 'set bell-style none' >> /etc/inputrc

    echo Installing languages
    sudo apt-get -y update
    sudo locale-gen en_US en_US.UTF-8
    sudo dpkg-reconfigure locales

    echo Installing essential apps
    sudo apt-get -y install build-essential curl yasm

    echo Installing desktop apps
    sudo apt-get -y install ubuntu-desktop

    hash ffmpeg 2>/dev/null || {
     # Build ffmpeg
     echo Installing ffmpeg

     sudo apt-get -y install autoconf automake libass-dev libfreetype6-dev \
       libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
       libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev libx264-dev libmp3lame-dev libopus-dev

     mkdir ~/ffmpeg_sources
     cd ~/ffmpeg_sources
     wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
     tar xjvf ffmpeg-snapshot.tar.bz2
     cd ffmpeg
     PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
       --prefix="$HOME/ffmpeg_build" \
       --pkg-config-flags="--static" \
       --extra-cflags="-I$HOME/ffmpeg_build/include" \
       --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
       --bindir="$HOME/bin" \
       --enable-gpl \
       --enable-libass \
       --enable-libfreetype \
       --enable-libmp3lame \
       --enable-libopus \
       --enable-libtheora \
       --enable-libvorbis \
       --enable-libx264 \
       --enable-nonfree

     PATH="$HOME/bin:$PATH" make
     make install
     make distclean
     hash -r

     source ~/.profile
    }

    echo Done
    exit 0

    install-rvm.sh

    #!/usr/bin/env bash

    echo Installing RVM gpg key
    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 --trust-model always

    echo Installing RVM
    \curl -sSL https://get.rvm.io | bash -s $1

    exit 0

    I won’t include the other scripts for the sake of brevity. When logging into vagrant with the gui nothing seems out of the ordinary, and ffmpeg is available...but nothing else is provisioned. No RVM, no Nginx, nothing.