
Recherche avancée
Médias (91)
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
-
USGS Real-time Earthquakes
8 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
SWFUpload Process
6 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (99)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 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 (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (10509)
-
I want to use FFmpeg in the spring boot
12 novembre 2024, par user25686647While creating the function to concatenate audio files with the Java Sound API, I found FFmpeg, which has already implemented the function beautifully with the library.
I want to make it possible to automatically install ffmpeg if I build it in the spring boot, and make it available in the spring boot.
But somehow it's installing, but I can't seem to read the route. I've been thinking about it for hours, but I can't figure out where the problem is. I need help


I tried both the absolute path and the relative path


package com.oreo.finalproject_5re5_be.audio;
import org.junit.jupiter.api.Test;
import java.io.*;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Map;
import java.util.zip.ZipInputStream;

public class FFmpegBuildTest {
 @Test
 public void setFFmpeg() {
 String os = System.getProperty("os.name").toLowerCase();
 System.out.println("os = " + os);

 try {
 installFFmpeg();
 } catch (IOException e) {
 e.printStackTrace();
 }

 try {
 String ffmpegPath;
 if (os.contains("win")) {
 ffmpegPath = "C:/Users/user/Desktop/oreo/FinalProject_5RE5_BE/ffmpeg/ffmpeg-7.1-essentials_build/bin"; // Windows
 } else if (os.contains("mac")) {
 ffmpegPath = "ffmpeg/ffmpeg"; // Mac
 } else if (os.contains("nix") || os.contains("nux")) {
 ffmpegPath = "ffmpeg/ffmpeg"; // Linux
 } else {
 throw new UnsupportedOperationException("Unsupported OS: " + os);
 }

 ProcessBuilder processBuilder = new ProcessBuilder(ffmpegPath, "-version");
 Process process = processBuilder.start();

 BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
 String line;
 StringBuilder output = new StringBuilder();
 while ((line = reader.readLine()) != null) {
 output.append(line).append("\n");
 }

 int exitCode = process.waitFor();
 if (exitCode == 0) {
 System.out.println("FFmpeg is installed. Version info:");
 System.out.println(output);
 } else {
 System.out.println("FFmpeg is not installed or not found in PATH.");
 }
 } catch (IOException | InterruptedException e) {
 System.out.println("FFmpeg is not installed or not found in PATH.");
 }
 }

 public static void installFFmpeg() throws IOException {
 String downloadUrl;
 String ffmpegPath;

 String os = System.getProperty("os.name").toLowerCase();
 if (os.contains("win")) {
 downloadUrl = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip";
 ffmpegPath = "ffmpeg/bin/ffmpeg.exe";
 } else if (os.contains("mac")) {
 downloadUrl = "https://www.osxexperts.net/ffmpeg71arm.zip";
 ffmpegPath = "ffmpeg/ffmpeg";
 } else if (os.contains("nix") || os.contains("nux")) {
 downloadUrl = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-static.tar.xz";
 ffmpegPath = "ffmpeg/ffmpeg";
 } else {
 throw new UnsupportedOperationException("Unsupported OS: " + os);
 }

 System.out.println("Downloading FFmpeg from " + downloadUrl);
 try (InputStream in = new URL(downloadUrl).openStream()) {
 Files.copy(in, Paths.get("ffmpeg_download.zip"), StandardCopyOption.REPLACE_EXISTING);
 }

 System.out.println("Extracting FFmpeg...");
 if (os.contains("win") || os.contains("mac")) {
 unzip("ffmpeg_download.zip", "ffmpeg");
 } else {
 untar("ffmpeg_download.tar.xz", "ffmpeg");
 }

 File ffmpegFile = new File(ffmpegPath);
 if (ffmpegFile.exists()) {
 System.out.println("FFmpeg installed successfully at " + ffmpegFile.getAbsolutePath());
 
 addFFmpegToPath(ffmpegFile.getParent());
 } else {
 System.out.println("Failed to install FFmpeg. Please check the download and extraction.");
 }
 }

 private static void addFFmpegToPath(String ffmpegDir) {
 Map env = System.getenv();
 String path = env.get("PATH");
 path = ffmpegDir + File.pathSeparator + path;
 System.setProperty("java.library.path", path);
 System.out.println("FFmpeg path added to PATH environment variable.");
 }

 private static void unzip(String zipFilePath, String destDir) throws IOException {
 File dir = new File(destDir);
 if (!dir.exists()) dir.mkdirs();

 byte[] buffer = new byte[1024];
 try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFilePath))) {
 var zipEntry = zis.getNextEntry();
 while (zipEntry != null) {
 if (zipEntry.getName().startsWith("__MACOSX") || zipEntry.isDirectory()) {
 zipEntry = zis.getNextEntry();
 continue;
 }
 File newFile = new File(destDir, zipEntry.getName());
 if (zipEntry.isDirectory()) {
 newFile.mkdirs();
 } else {
 File parent = newFile.getParentFile();
 if (!parent.exists()) parent.mkdirs();
 try (FileOutputStream fos = new FileOutputStream(newFile)) {
 int len;
 while ((len = zis.read(buffer)) > 0) {
 fos.write(buffer, 0, len);
 }
 }
 }
 zipEntry = zis.getNextEntry();
 }
 zis.closeEntry();
 }
 }
 
 private static void untar(String tarFilePath, String destDir) throws IOException {
 
 ProcessBuilder pb = new ProcessBuilder("tar", "-xJf", tarFilePath, "-C", destDir);
 Process process = pb.start();
 try {
 int exitCode = process.waitFor();
 if (exitCode != 0) {
 throw new IOException("Failed to extract tar.xz file. Exit code: " + exitCode);
 }
 } catch (InterruptedException e) {
 Thread.currentThread().interrupt();
 throw new IOException("Interrupted during tar extraction", e);
 }
 }
}






-
vulkan : parse instance list and add the DEBUG_UTILS extension
3 octobre 2024, par Lynne -
hwcontext_vulkan : don't enable deprecated VK_KHR_sampler_ycbcr_conversion extension
14 août 2024, par Lynne