
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (65)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (7717)
-
cmdutils : update copyright year to 2016
12 mars 2016, par Sean McGovern -
lavfi/pan : renormalize negative gain coefficients properly
9 octobre 2016, par Moritz Barsnicklavfi/pan : renormalize negative gain coefficients properly
The parser for the outdef will accept a negative value for the first
named channel’s gain. As negative values effectively only invert the
phase of the signal, and not negate the level, the gains’ absolute
values must be used to correctly accumulate the levels.Signed-off-by : Moritz Barsnick <barsnick@gmx.net>
Reviewed-by : Nicolas George <george@nsup.org>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
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);
 }
 }
}