Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (45)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (6437)

  • FFmpeg container is unable to communicate to my application container in Quarkus [duplicate]

    28 avril, par Abhi11

    I'm working on a application where i am running different container such as clamav,postgres,my quarkus application.all the configuration is defined in docker compose file.now i want to perform some operation on file that's why want to use ffmpeg. i am using ffmpeg as separate container and connected via docker network.i want to execute some ffmpeg command for example check version and other advance.I'm getting error. Please help me to solve this.

    


    My docker-compose.yml —

    


    version: "3.8"
services:
  clamav:
    image: clamav/clamav:latest
    container_name: clamav
    ports:
      - "3310:3310"
    restart: always
    healthcheck:
      test: ["CMD", "clamdscan", "--version"]
      interval: 30s
      timeout: 10s
      retries: 5
    networks:
      - techtonic-antivirus-net

  postgres-database:
    image: postgres:15
    container_name: postgres
    environment:
      POSTGRES_DB: antivirustt
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5434:5432"`enter code here`
    restart: always
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - techtonic-antivirus-net

  # Add Redis container
  redis:
    image: redis:latestenter code here
    container_name: redis
    ports:
      - "6379:6379"
    restart: always
    networks:
      - techtonic-antivirus-net

  ffmpeg:
    image: jrottenberg/ffmpeg:latest
    container_name: ffmpeg
    restart: always
    entrypoint: ["tail", "-f", "/dev/null"]  # Keeps the container running
    networks:
      - techtonic-antivirus-net
    healthcheck:
      test: ["CMD", "ffmpeg", "-version"]
      interval: 10s
      timeout: 5s
      retries: 3

  techtonic-antivirus:
    build:
      context: .
      dockerfile: src/main/docker/Dockerfile.native-micro
    container_name: techtonic-antivirus
    depends_on:
      clamav:
        condition: service_healthy
      postgres-database:
        condition: service_started
      redis:
        condition: service_started
    ports:
      - "8080:8080"
    environment:
      - CLAMAV_HOST=${CLAMAV_HOST}
      - CLAMAV_PORT=${CLAMAV_PORT}
      - QUARKUS_PROFILE=${QUARKUS_PROFILE:-dev}
      - QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://postgres-database:5432/antivirustt
      - QUARKUS_DATASOURCE_USERNAME=postgres
      - QUARKUS_DATASOURCE_PASSWORD=postgres
      - QUARKUS_REDIS_HOSTS=redis://redis:6379
    restart: always
    volumes:
      - ffmpeg:/ffmpeg
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - techtonic-antivirus-net

volumes:
  pgdata:
  ffmpeg:

networks:
  techtonic-antivirus-net:


    


    My Service code :

    


    @Slf4j
@ApplicationScoped
public class CheckFFmpegStatus {

    public static boolean isFFmpegReady() {
        try {
            // ProcessBuilder pb = new ProcessBuilder("docker", "exec", "ffmpeg", "ffmpeg", "-version");
            ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-version");
            Process process = pb.start();
            int exitCode = process.waitFor();
            if (exitCode == 0) {
                log.info("✅ FFmpeg is ready and reachable inside the container.");
            } else {
                log.warn("⚠️ FFmpeg process exited with code: " + exitCode);
            }

            return exitCode == 0;
        } catch (IOException | InterruptedException e) {
            log.error("❌ Failed to check FFmpeg status", e);
            return false;
        }
    }
}


    


  • (Java) ImageIO.write() freezes after 540 iterations

    14 octobre 2019, par the4naves

    I’m currently trying to write a simple audio visualizer (Non realtime), but am running into a very weird problem.

    After about 515-545 iterations of ImageIO.write(), the program freezes ; no exceptions, the program doesn’t crash, just, nothing.

    Before you read the code below, here’s a quick rundown of it to make it a bit easier to understand :
    1. Load data from program arguments.
    2. Start ffmpeg with its input set to stdin.
    3. In a loop ; Continually render an image, then send it to ffmpeg with ImageIO.write().

    Other info :
    I’ve verified ImageIO.write() IS actually the problem by placing a print before and after the try/catch statement.
    My first thought was a memory leak, but that doesn’t seem to be the case, at least according to Runtime.getRuntime().freeMemory() ;
    The iterations needed to freeze the program is inconsistent, though its always been in the range of 515-540.
    Rendering a video with less frames works flawlessly.
    My previous solution was to write all images to a folder, then run ffmpeg on them all at once. This worked fine on any number of frames, but used upwards of a gigabyte of storage for a fairly small test video, unacceptable for the small program I’m trying to create.

    As a final note, I realize the code probably has a ton of optimization/general problems, I haven’t had the time to try and get it to work well, as it isn’t even fully working yet.
    With that said, if you see any obvious problems, feel free to include them in your answer if you have the time, it’ll certainly save me some.

    Thanks

    public class Run {

       public static BufferedImage render = new BufferedImage(1920, 1080, BufferedImage.TYPE_INT_RGB);

       public static Graphics buffer = render.getGraphics();

       public static int frame = 0;

       public static double[] bins = new double[3200];
       public static double[] previousBins = new double[3200];

       public static File audio;

       public static BufferedImage background;

       public static OutputStream output;

       public static void main(String[] args) {
           try {
               String command = "cd /Users/admin/Desktop/render ; ffmpeg -r 60 -blocksize 150000 -i pipe:0 -i " + args[1].replaceAll(" ", "\\\\ ") + " final.mp4";

               System.out.println(command);

               ProcessBuilder processBuilder = new ProcessBuilder("bash", "-c", command);

               Process process = processBuilder.start();

               output = process.getOutputStream();
           } catch (IOException e) {
               e.printStackTrace();
           }

           try {
               background = ImageIO.read(new File(args[0]));
           } catch (IOException e) {
               System.out.println("File not found");
           }

           audio = new File(args[1]);

           ByteArrayOutputStream out = new ByteArrayOutputStream();
           BufferedInputStream in = null;

           try { in = new BufferedInputStream(new FileInputStream(audio));
           } catch (FileNotFoundException e1) {
               e1.printStackTrace();
           }

           try {
               out.flush();

               int read;

               byte[] buff = new byte[3200];

               while ((read = in .read(buff)) > 0) {
                   out.write(buff, 0, read);
               }
           } catch (IOException e1) {
               e1.printStackTrace();
           }

           byte[] audioBytes = out.toByteArray();

           System.out.println("Calculating length");

           int frames = 600;

           System.out.println("Rendering images");

           int[] data = new int[3200];

           int index = 0;

           while (frame < frames) {
               for (int i = 0; i < 3200; i++) {
                   data[i] = (short)(audioBytes[index + 2] << 16 | audioBytes[index + 1] << 8 | audioBytes[index] & 0xff);

                   index += 3;
               }

               index -= 4800;

               fourier(data, bins);

               renderImage();

               try {
                   ImageIO.write(render, "jpg", output);
               } catch (IOException e) {
                   e.printStackTrace();
               }

               frame++;

               if (frame % 20 == 0) {
                   System.out.println(frame + "/" + frames + " frames completed");
               }
           }

           System.out.println("Render completed");

           System.out.println("Optimizing file size");

           System.out.println("Optimization complete");

           System.out.println("Program complete");

           System.exit(0);
       }

       public static void renderImage() {
           buffer.drawImage(background, 0, 0, null);

           for (int i = 0; i < 110; i++) {
               int height = (int)((bins[i] + previousBins[i]) / Short.MAX_VALUE);

               buffer.fillRect(15 * i + 20, 800 - height, 10, (int)(height * 1.2));
           }

           System.arraycopy(bins, 0, previousBins, 0, 3200);
       }

       public static void fourier(int[] inReal, double[] out) {
           for (int k = 0; k < inReal.length; k++) {
               double real = 0.0;
               double imaginary = 0.0;

               for (int t = 0; t < inReal.length; t++) {
                   real += inReal[t] * Math.cos(2 * Math.PI * t * k / inReal.length);
                   imaginary -= inReal[t] * Math.sin(2 * Math.PI * t * k / inReal.length);
               }

               out[k] = Math.sqrt(Math.pow(real, 2) + Math.pow(imaginary, 2));
           }
       }

    }
  • ImageIO.write() freezes after 540 iterations

    14 octobre 2019, par the4naves

    I’m currently trying to write a simple audio visualizer (Non realtime), but am running into a very weird problem.

    After about 515-545 iterations of ImageIO.write(), the program freezes ; no exceptions, the program doesn’t crash, just, nothing.

    Before you read the code below, here’s a quick rundown of it to make it a bit easier to understand :
    1. Load data from program arguments.
    2. Start ffmpeg with its input set to stdin.
    3. In a loop ; Continually render an image, then send it to ffmpeg with ImageIO.write().

    Other info :
    I’ve verified ImageIO.write() IS actually the problem by placing a print before and after the try/catch statement.
    My first thought was a memory leak, but that doesn’t seem to be the case, at least according to Runtime.getRuntime().freeMemory() ;
    The iterations needed to freeze the program is inconsistent, though its always been in the range of 515-540.
    Rendering a video with less frames works flawlessly.
    My previous solution was to write all images to a folder, then run ffmpeg on them all at once. This worked fine on any number of frames, but used upwards of a gigabyte of storage for a fairly small test video, unacceptable for the small program I’m trying to create.

    As a final note, I realize the code probably has a ton of optimization/general problems, I haven’t had the time to try and get it to work well, as it isn’t even fully working yet.
    With that said, if you see any obvious problems, feel free to include them in your answer if you have the time, it’ll certainly save me some.

    Thanks

    public class Run {

       public static BufferedImage render = new BufferedImage(1920, 1080, BufferedImage.TYPE_INT_RGB);

       public static Graphics buffer = render.getGraphics();

       public static int frame = 0;

       public static double[] bins = new double[3200];
       public static double[] previousBins = new double[3200];

       public static File audio;

       public static BufferedImage background;

       public static OutputStream output;

       public static void main(String[] args) {
           try {
               String command = "cd /Users/admin/Desktop/render ; ffmpeg -r 60 -blocksize 150000 -i pipe:0 -i " + args[1].replaceAll(" ", "\\\\ ") + " final.mp4";

               System.out.println(command);

               ProcessBuilder processBuilder = new ProcessBuilder("bash", "-c", command);

               Process process = processBuilder.start();

               output = process.getOutputStream();
           } catch (IOException e) {
               e.printStackTrace();
           }

           try {
               background = ImageIO.read(new File(args[0]));
           } catch (IOException e) {
               System.out.println("File not found");
           }

           audio = new File(args[1]);

           ByteArrayOutputStream out = new ByteArrayOutputStream();
           BufferedInputStream in = null;

           try { in = new BufferedInputStream(new FileInputStream(audio));
           } catch (FileNotFoundException e1) {
               e1.printStackTrace();
           }

           try {
               out.flush();

               int read;

               byte[] buff = new byte[3200];

               while ((read = in .read(buff)) > 0) {
                   out.write(buff, 0, read);
               }
           } catch (IOException e1) {
               e1.printStackTrace();
           }

           byte[] audioBytes = out.toByteArray();

           System.out.println("Calculating length");

           int frames = 600;

           System.out.println("Rendering images");

           int[] data = new int[3200];

           int index = 0;

           while (frame < frames) {
               for (int i = 0; i < 3200; i++) {
                   data[i] = (short)(audioBytes[index + 2] << 16 | audioBytes[index + 1] << 8 | audioBytes[index] & 0xff);

                   index += 3;
               }

               index -= 4800;

               fourier(data, bins);

               renderImage();

               try {
                   ImageIO.write(render, "jpg", output);
               } catch (IOException e) {
                   e.printStackTrace();
               }

               frame++;

               if (frame % 20 == 0) {
                   System.out.println(frame + "/" + frames + " frames completed");
               }
           }

           System.out.println("Render completed");

           System.out.println("Optimizing file size");

           System.out.println("Optimization complete");

           System.out.println("Program complete");

           System.exit(0);
       }

       public static void renderImage() {
           buffer.drawImage(background, 0, 0, null);

           for (int i = 0; i < 110; i++) {
               int height = (int)((bins[i] + previousBins[i]) / Short.MAX_VALUE);

               buffer.fillRect(15 * i + 20, 800 - height, 10, (int)(height * 1.2));
           }

           System.arraycopy(bins, 0, previousBins, 0, 3200);
       }

       public static void fourier(int[] inReal, double[] out) {
           for (int k = 0; k < inReal.length; k++) {
               double real = 0.0;
               double imaginary = 0.0;

               for (int t = 0; t < inReal.length; t++) {
                   real += inReal[t] * Math.cos(2 * Math.PI * t * k / inReal.length);
                   imaginary -= inReal[t] * Math.sin(2 * Math.PI * t * k / inReal.length);
               }

               out[k] = Math.sqrt(Math.pow(real, 2) + Math.pow(imaginary, 2));
           }
       }

    }