Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (82)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8629)

  • Dreamcast Track Sizes

    1er mars 2015, par Multimedia Mike — Sega Dreamcast

    I’ve been playing around with Sega Dreamcast discs lately. Not playing the games on the DC discs, of course, just studying their structure. To review, the Sega Dreamcast game console used special optical discs named GD-ROMs, where the GD stands for “gigadisc”. They are capable of holding about 1 gigabyte of data.

    You know what’s weird about these discs ? Each one manages to actually store a gigabyte of data. Each disc has a CD portion and a GD portion. The CD portion occupies the first 45000 sectors and can be read in any standard CD drive. This area is divided between a brief data track and a brief (usually) audio track.

    The GD region starts at sector 45000. Sometimes, it’s just one humongous data track that consumes the entire GD region. More often, however, the data track is split between the first track and the last track in the region and there are 1 or more audio tracks in between. But the weird thing is, the GD region is always full. I made a study of it (click for a larger, interactive graph) :


    Dreamcast Track Sizes

    Some discs put special data or audio bonuses in the CD region for players to discover. But every disc manages to fill out the GD region. I checked up on a lot of those audio tracks that divide the GD data and they’re legitimate music tracks. So what’s the motivation ? Why would the data track be split in 2 pieces like that ?

    I eventually realized that I probably answered this question in this blog post from 4 years ago. The read speed from the outside of an optical disc is higher than the inside of the same disc. When I inspect the outer data tracks of some of these discs, sure enough, there seem to be timing-sensitive multimedia FMV files living on the outer stretches.

    One day, I’ll write a utility to take apart the split ISO-9660 filesystem offset from a weird sector.

  • Investigating Steam for Linux

    1er mars 2013, par Multimedia Mike — Game Hacking

    Valve recently released the final, public version of their Steam client for Linux, and the Linux world rejoiced. At least, it probably did. The announcement was 2 weeks ago on Valentine’s Day and I had other things on my mind, so I missed any fanfare. When framed in this manner, the announcement timing becomes suspect– it’s as though Linux enthusiasts would have plenty of time that day or something.


    Valve Steam logo

    Taming the Frontier
    Speculation about a Linux Steam client had been kicking around for nearly as long as Steam has existed. However, sometime last year, the rumors became more substantive.

    I naturally wondered how to port something like Steam to Linux. I have some experience with trying to make a necessarily binary-only program that runs on Linux. I’m fairly well-versed in the assorted technical challenges that one might face when attempting such a feat. Because of this, whenever I hear rumors that a company might be entertaining the notion of porting a major piece of proprietary software to Linux, my instinctive reflex is, “What ?! Why, you fools ?! Save yourselves !”

    At least, that’s how it used to be. The proposal of developing a proprietary binary for Linux has been rendered considerably less insane by a few developments, for example :

    1. The rise of Ubuntu Linux as a quasi de facto standard for desktop Linux computing
    2. The increasing homogeneity in personal desktop computing technology

    What I would like to know is how the Steam client runs on Linux. Does it rely on any libraries being present on the system ? Or does it bring its own ? The latter is a trick that proprietary programs can use– transport all of the shared libraries that the main program binary depends upon, install them someplace out of the way on the filesystem, probably in /opt, and then make the main program a shell script which sets a preload path to rely on the known quantity libraries instead of the copies already on the system.

    Downloading and Installing the Client
    For this exercise, I installed x86_64 desktop Ubuntu 12.04 Linux on a l33t gaming rig that was totally top of the line about 5 years ago, and that someone didn’t want anymore and handed down to me recently. So it should be ideal for this project.

    At first, I was blown away– the Linux client is in a .deb package that is less than 2 MB large. I unpacked the steam.deb file and found a bunch of support libraries — mostly X11 and standard C/C++ runtimes. Just as I suspected. Still, I can’t believe how small the thing is. However, my amazement quickly abated when I actually ran Steam and saw this :


    Steam Linux Client -- initial update

    So it turns out steam.db is just the installer program which immediately proceeds to download an additional 160+ MB of data. So there’s actually a lot more information to possibly sift through.

    Another component of the installation is to basically run a big ‘apt-get install’ command to make sure a bunch of required packages are installed :


    Steam Linux Client -- install system packages

    After all these installation steps, the client was ready to run. However, whenever I tried to do so, I got this dialog which would cause Steam to close when the dialog was dismissed.


    Steam Linux Client -- Upgrade NVIDIA drivers

    Not a huge deal ; later NVIDIA drivers are fairly straightforward to install on Ubuntu Linux. After a few minutes of downloading, installing and restarting X, Steam ran with minimal complaint (it still had some issue regarding the video drivers but didn’t seem to consider it a deal-breaker).

    Using Steam on Linux

    So here’s Steam running on Linux :


    Steam Linux Client -- main screen

    If you have experience with using Steam on Windows or Mac, you might observe that it looks exactly the same. I don’t have a very expansive library of games (I only started using Steam because purchasing a few computer components a few years ago entitled me to some free Steam downloads of some of the games on the list in the screenshot). I didn’t really expect any of the games to have Linux versions yet, but it turns out that the indie darling FTL : Faster Than Light has been ported to Linux. FTL was a much-heralded Kickstarter success story and sounded like something I wanted to support. I purchased this from Steam shortly after its release last year and was able to download the Linux version at no additional cost with a single click.

    It runs natively on Linux (note the Ubuntu desktop window decorations) :


    FTL game running on Linux through Steam

    You might notice from the main Steam client that, despite purchasing FTL about a 1/2 year ago and starting it up at least a 1/2 dozen times, I haven’t really invested a whole lot of time into it. I only managed to get about 2 minutes further this time :


    A few more minutes in FTL

    What can I say ? This game just bores me to tears. It’s frustrating because I know that this is one of the cool games that all real gamers are supposed to like, but I practically catch myself nodding off every time I try to run through the tutorial. It’s strange to think that I’ve invested far more time into games that offer considerably less stimulation. That’s probably because I had far more free time compared to gaming options during those times.

    But that’s neither here nor there. We’ll file this under “games that aren’t for me.” I’m glad that people like FTL and a little indie underdog has met with such success. And I’m pleased that Steam on Linux works. It’s native and the games are also native, which is all quite laudable (there was speculation that everything would just be running on top of a Wine layer).

    Deeper Analysis
    So I set out wondering how Steam was able to create a proprietary program that would satisfy a large enough cross-section of Linux users (i.e., on different platforms and distros). Answer : well, they didn’t, per the stated requirements. The installation is only tuned to work on Ubuntu 12.04. However, it works on both 32- and 64-bit platforms, the only 2 desktop CPU platforms that matter these days (unless ARM somehow makes inroads on the desktop). The Steam client is quite clearly an x86_32 binary– look at the terminal screenshot above and observe that it’s downloading all :i386 support libraries.

    The file /usr/bin/steam isn’t a binary but a launcher shell script (something you’ll also see if you investigate /usr/bin/firefox on a Linux system). Here’s an interesting tidbit :

    function detect_platform()
    
      # Maybe be smarter someday
      # Right now this is the only platform we have a bootstrap for, so hard-code it.
      echo ubuntu12_32
    
    

    I wager that it’s possible to get Steam running on other distributions, it probably just takes a little more effort (assuming that Steam doesn’t put too much effort into thwarting such attempts).

    As for the FTL game, it comes with binaries and libraries for both x86_32 and x86_64. So, good work to the dev team for creating and testing both versions. FTL also distributes versions of the libraries it expects to work with.

    I suspect that the Steam client overall is largely a WWW rendering engine underneath the covers. That would help explain how Valve is able to achieve such a consistent look and feel, not only across OS platforms, but also through a web browser. When I browse the Steam store through Google Chrome, it looks and feels exactly like the native desktop client. When I first thought of how someone could port Steam to Linux, I immediately wondered about how they would do the UI.

    A little Googling for “steam uses webkit” (just a hunch) confirms my hypothesis.

  • How to setup my complex filter with zoompan and xfade for ffmpeg using Fluent-FFmpeg .complexFilter method ?

    20 août 2024, par Rémy Groleau

    i'm using fluent-ffmpeg with nodejs. My problem is the setup of my complex filter.

    


    const filters = Array.from({ length: imageCount - 1 }).map((_, i) => {
        const rndInt = Math.floor(Math.random() * 1000) + 1

        return {
            zoompanFilter1: {
                filter: 'zoompan',
                options: {
                    z: 'min(zoom+0.001,1.3)',
                    d: `${imageDuration * 60}`, 
                    x: `iw/2-iw*(1/2-${rndInt}/100)*iw/zoom`, 
                    y: `ih/2-ih*(1/2-${rndInt}/100)*ih/zoom`, 
                    s: '1080x1920', // Output size
                    fps: '60'
                },
                inputs: `[${i}:v]`,
                outputs: `zoomed${i}`
            },
            zoompanFilter2: {
                filter: 'zoompan',
                options: {
                    z: 'min(zoom+0.001,1.3)', 
                    d: `${imageDuration * 60}`, 
                    x: 'iw/2-iw*(1/2-33/100)*iw/zoom',
                    y: 'ih/2-ih*(1/2-33/100)*ih/zoom',
                    s: '1080x1920', // Output size
                    fps: '60'
                },
                inputs: [`${i + 1}:v`],
                outputs: `zoomed${i + 1}`
            },
            xfadeFilter: {
                filter: 'xfade',
                options: {
                    transition: 'fade', // Crossfade transition effect
                    duration: '0.5', // Duration of crossfade in seconds
                    offset: `${imageDuration - 1}` // Offset to start the crossfade
                },
                inputs: [`zoomed${i + 1}`, `zoomed${i}`],
                outputs: `crossfaded${i}`
            },
        };
    });


    


    This is my complete code :

    


    async function createVideo() {
    // Escape file paths for Windows
    const videoPath = path.resolve(__dirname+ '/output.mp4').replace(/\\/g, '\\\\');
    const audioPath = path.resolve(__dirname+ '/output.mp3').replace(/\\/g, '\\\\');
    const backgroundMusicPath = path.resolve(__dirname+ '/background-music.mp3').replace(/\\/g, '\\\\');

    const command = ffmpeg();

    const imagesDir = path.join(__dirname, 'images');
    const images = fs.readdirSync(imagesDir)
        .filter(file => /.(jpg|jpeg|png)$/i.test(file)) // Filter image files
        .sort() // Sort filenames to ensure the correct order
        .map(file => path.join(imagesDir, file));

        images.map((image) => command.input(image))

    const imageCount = images.length;
    const audioDuration = await getAudioDurationInSeconds(audioPath);
    const imageDuration =  Math.round(audioDuration / imageCount)

    const filters = Array.from({ length: imageCount - 1 }).map((_, i) => {
        const rndInt = Math.floor(Math.random() * 1000) + 1

        return {
            zoompanFilter1: {
                filter: 'zoompan',
                options: {
                    z: 'min(zoom+0.001,1.3)', // Reset zoom to 1.0
                    d: `${imageDuration * 60}`, // Duration of the zoom effect
                    x: `iw/2-iw*(1/2-${rndInt}/100)*iw/zoom`, // Center x
                    y: `ih/2-ih*(1/2-${rndInt}/100)*ih/zoom`, // Center y
                    s: '1080x1920', // Output size
                    fps: '60'
                },
                inputs: `[${i}:v]`,
                outputs: `zoomed${i}`
            },
            zoompanFilter2: {
                filter: 'zoompan',
                options: {
                    z: 'min(zoom+0.001,1.3)', // Reset zoom to 1.0
                    d: `${imageDuration * 60}`, // Duration of the zoom effect
                    x: 'iw/2-iw*(1/2-33/100)*iw/zoom', // Center x
                    y: 'ih/2-ih*(1/2-33/100)*ih/zoom', // Center y
                    s: '1080x1920', // Output size
                    fps: '60'
                },
                inputs: [`${i + 1}:v`],
                outputs: `zoomed${i + 1}`
            },
            xfadeFilter: {
                filter: 'xfade',
                options: {
                    transition: 'fade', // Crossfade transition effect
                    duration: '0.5', // Duration of crossfade in seconds
                    offset: `${imageDuration - 1}` // Offset to start the crossfade
                },
                inputs: [`zoomed${i + 1}`, `zoomed${i}`],
                outputs: `crossfaded${i}`
            },
        };
    });

    command
    .input(audioPath)
    .input(backgroundMusicPath)
    .outputOptions([
        '-pix_fmt', 'yuv420p',
        '-c:v', 'libx264',
        '-c:a', 'aac',
        '-y',
        '-t', `${audioDuration}`,
        '-r', '60',
        '-s', '1080x1920',
        '-preset', 'ultrafast',
        '-map', '[final_video]',
        '-map', '[mixed_audio]',
    ])
    .complexFilter([
        // Apply zoompan filters and xfade transitions
        ...filters.flatMap(({ zoompanFilter1, zoompanFilter2, xfadeFilter }) => [
            zoompanFilter1,
            zoompanFilter2,
            xfadeFilter,
        ]),
        {
            filter: 'concat',
            options: {
                n: imageCount - 1, // Number of videos to concatenate
                v: 1, // Video streams
                a: 0 // No audio streams
            },
            inputs: filters.map((_, i) => `crossfaded${i}`),
            outputs: 'video_sequence'
        },
        {
            filter: 'curves',
            options: 'preset=increase_contrast',
            inputs: 'video_sequence',
            outputs: 'curves'
        },
        {
            filter: 'subtitles',
            options: `./subtitles.ass:fontsdir=./fonts/:force_style='FontName=Montserrat Black Italic,FontSize=17,MarginL=10,MarginV=25,Alignment=10,Spacing=0.2,Outline=0.1,Shadow=1.5'`,
            inputs: '[curves]',
            outputs: 'final_video'
        },
        {
            filter: 'volume',
            options: 0.3,  // Adjust the volume to 25% of the original
            inputs: `${imageCount + 1}:a`,
            outputs: 'background_music_adjusted'
        },
        // Apply the amix filter to mix the two audio inputs
        {
            filter: 'amix',
            options: {
                inputs: 2,
                duration: 'first',
                dropout_transition: 0,
                weights: '1 0.25',
                normalize: 0
            },
            inputs: [`${imageCount}:a`, 'background_music_adjusted'],
            outputs: 'mixed_audio'
        },
      ])
    .save(videoPath)
    .on('progress', function(progress) {
        console.log('Processing: ' + progress.percent + '% done');
      })
    .on('end', function(stdout, stderr) {
        // emptyFolder(imagesDir)
        console.log('Transcoding succeeded !');
      }) 
    .on('error', function(err) {
        console.error('Une erreur s\'est produite :', err.message);
    });
}


    


    My problem is i see the 1 image then the transition and i see the 2 image. After that i'm suppose to see the 3 image but i see the 2 image.

    


    I don't understand what i'm doing wrong...

    


    i tried switching the inputs: [zoomed$i + 1, zoomed$i] to inputs: [zoomed$i, zoomed$i+1] but it just showed the next image and not a loop of consecutive images.