Recherche avancée

Médias (91)

Autres articles (73)

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

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (9872)

  • How do you run a ffmpeg command in Java, in MacOS, using a ProcessBuilder

    5 août 2020, par nottAbott

    I am writing a program in Java that uses ffmpeg to "snip" a video into several pieces and the stitch them back together again. I have everything working relatively smoothly in Windows, but I cannot get ffmpeg to work in Mac, or in Linux for that matter. I'm focusing on mac right now though. I thought that it might be a permissions problem, but when I run it with sudo I get an error that says (after typing in the password :

    


    sudo: ffmpeg: command not found


    


    when I run it without sudo I get :

    


    java.io.IOException: Cannot run program "ffmpeg": error=2, No such file or directory


    


    I think that it might be because the ffmpeg package, on the Mac machine, was downloaded with homebrew, and ffmpeg is stored in /usr/local/Cellar/ffmpeg instead of the default folder, wherever it may be. That may not be the problem though, because I deleted ffmpeg and re-downloaded it with homebrew. It may have been in its defaulter folder in my first tests as well. It would be great to figure this out. Most of my family uses Mac (not me) and I really want to share my work with them. That is why I chose to code this in Java. Oh, and I did try using the directory to the binary in the command. Here's the code :

    


        //snips out all the clips from the main video
    public void snip() throws IOException, InterruptedException {
        
        for(int i = 0; i < snippets.size(); i++) {
            //ffmpeg -i 20sec.mp4 -ss 0:0:1 -to 0:0:5 -c copy foobar.mp4
            String newFile = "foobar" + String.valueOf(i) + ".mp4";
            
            //THIS WORKS
            if(OS.isWindows()) {
                ProcessBuilder processBuilder = new ProcessBuilder("ffmpeg", "-i", videoName, "-ss",
                        snippets.get(i).getStartTime(), "-to", snippets.get(i).getEndTime(), newFile);
                            
                Process process = processBuilder.inheritIO().start();
                process.waitFor();
                System.out.println("Win Snip " + i + "\n");
            }
            
            else if (OS.isMac()) {
                //FFMPEG LOCATION: /usr/local/Cellar/ffmpeg
                //THE ERROR: sudo: ffmpeg: command not found
                //ERROR W/OUT SUDO: java.io.IOException: Cannot run program "ffmpeg": error=2, No such file or directory
                ProcessBuilder processBuilder = new ProcessBuilder("sudo", "-S", "ffmpeg", "-f", videoName, "-ss",
                        snippets.get(i).getStartTime(), "-to", snippets.get(i).getEndTime(), newFile);
                
                Process process = processBuilder.inheritIO().start();
                process.waitFor();
                System.out.println("Mac Snip " + i + "\n");
            }
            
            else if (OS.isUnix()) {
                System.out.println("Your operating system is not supported");
                //TODO
                //need to figure out if deb/red hat/whatever are different
            }
            
            else if (OS.isSolaris()) {
                System.out.println("Your operating system is not supported yet");
                //TODO probably won't do
            }
            
            else {
                 System.out.println("Your operating system is not supported");
            }
            //add to the list of files to be concat later
            filesToStitch.add(newFile);
            filesToDelete.add(newFile);
            
        }
        //System.out.println(stitchFiles);
    }


    


  • Why is ffmpeg's hstack so much slower than overlay and pad ?

    27 janvier 2021, par cgenco

    I'm using ffmpeg to stitch together two videos of people chatting into a video with each of them side-by-side, like this :

    


    left.mp4 + right.mp4 = out.mp4

    


    Here's the command I'm currently using to get this done, which runs at 2.5x on my 13" M1 MacBook Pro :

    


    ffmpeg -y -i left.mp4 -i right.mp4 -filter_complex "
  [0:v] crop=w=in_w/2 [croppedLeft];
  [1:v][1:v] overlay=x=overlay_w/4 [shiftedRight];
  [shiftedRight][croppedLeft] overlay [vout];
  [0:a][1:a] amix [aout]
" -map "[vout]" -map "[aout]" -ac 2 out.mp4


    


    This command crops the left video to half of its original width (cropping so the video is centered), then shifts the right video a quarter of its width to the right, then overlays the left video on the left half of the output merged with the shifted right video.

    


    One day on my weekly fun-time read-through the FFmpeg filters documentation I stumbled on a filter named hstack, which is described as being "faster than using overlay and pad filter to create same output."

    


    My ex wife can affirm that there are few higher priorities in my life than going faster, so I altered my ffmpeg script to use hstack instead of two overlays :

    


    ffmpeg -y -i left.mp4 -i right.mp4 -filter_complex "
  [0:v] crop=w=in_w/2 [croppedLeft];
  [1:v] crop=w=in_w/2 [croppedRight];
  [croppedLeft][croppedRight] vstack [vout];
  [0:a][1:a] amix [aout]
" -map "[vout]" -map "[aout]" -ac 2 out.mp4


    


    ...but that command runs painfully slowly, like 0.1x. It takes multiple minutes to render a single second.

    


    So uhhh what's going on here ? Why is hstack taking so long when it's supposed to be faster ?

    


    I've tried this on both the M1 native build from OSXExperts (version N-99816-g3da35b7) and the standard ffmpeg from brew and hstack is just as slow on each.

    


  • A Docker Ubuntu image with ARM Mali G610 GPU support [closed]

    7 novembre 2023, par Тимур Тимаев

    I have a docker-compose project which automates creation of GFX-video files used in TV production. The program takes an order from a user, takes screenshots of various web-pages on the internet, composes these screenshots into a html-based animation and renders this animation in a video file. User gets broadcast ready .MP4 file.

    


    I currently export animation from html by extracting every single frame as a PNG sequence and then stitch them together using FFMPEG. However there's a much faster way to do this - record the html animation as it is playing in a browser.

    


    The issue is that the animation is choppy due to the lack of GPU support in a Docker container. I'm using Seleniarm/Chrome and it's not hardware accelerated.

    


    I'm trying to run this project on a OrangePI 5 Plus SBC which features Rockchip RK3588 SoC with ARM Mali G610 GPU. I have found a Ubuntu image by Joshua Riek which implements GPU acceleration the best in my opinion. It's very smooth. Joshua adds SoC GPU drivers to the Ubuntu image thus adding the gpu support.

    


    I want to build a Docker image from this repo to be able to spin it up, install Chrome, Selenium to the container, play the html animation and record it via x11grab device of FFMPEG.

    


    My problem is that I have little knowledge about building containers myself. Let alone tinkering with container drivers and etc. I'm not even sure if it's possible at all.

    


    Can anybody help me or point me in the right direction ?

    


    I have found some links, but I have absolutely no clue for where to start from.
I've looked into Seleniarm but some discussions mentioned that it uses XVFB which can not be hardware accelerated by definition.