
Recherche avancée
Autres articles (103)
-
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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 (...)
Sur d’autres sites (8383)
-
how to add effect to audio, sound like a phone call phone, inner monologue, or sounds like a man/woman ? [closed]
7 mars, par MathewI'm trying to apply different audio effects, such as making audio sound like a phone call. Below is my current approach. As you can see, I'm using multiple filters and simple algorithms to achieve this effect, but the output quality isn't ideal.


I've looked into FFmpeg filters and noticed mentions of LADSPA/LV2 plugins. Are these viable solutions ? Any other suggestions would be greatly appreciated.


public static void applySceneEffect(String inputPath, String outputPath, int sceneType) {
 LOGGER.info("apply scene effect {} to {}", sceneType, inputPath);

 try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(inputPath);
 FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputPath, grabber.getAudioChannels())) {

 grabber.setOption("vn", ""); 
 grabber.start();

 
 recorder.setAudioCodec(avcodec.AV_CODEC_ID_PCM_S16LE); 
 recorder.setSampleRate(grabber.getSampleRate());
 recorder.setAudioChannels(grabber.getAudioChannels());
 recorder.setAudioBitrate(grabber.getAudioBitrate());
 recorder.setFormat("wav"); 


 String audioFilter = String.join(",",
 "aresample=8000", 
 "highpass=f=300, lowpass=f=3400", 
 "acompressor=threshold=-15dB:ratio=4:attack=10:release=100", 
 "volume=1.5", 
 "aecho=0.9:0.4:10:0.6"
 );

 FFmpegFrameFilter f1 = new FFmpegFrameFilter(audioFilter, grabber.getAudioChannels());
 f1.setSampleRate(grabber.getSampleRate());
 f1.start();

 recorder.start();

 Random random = new Random();
 double noiseLevel = 0.02; 

 
 while (true) {
 var frame = grabber.grabFrame(true, false, true, true);
 if (frame == null) {
 break;
 }

 ShortBuffer audioBuffer = (ShortBuffer) frame.samples[0];
 short[] audioData = new short[audioBuffer.remaining()];
 audioBuffer.get(audioData);

 applyElectricNoise(audioData, grabber.getSampleRate());

 audioData = applyDistortion(audioData, 1.5, 30000);

 audioBuffer.rewind();
 audioBuffer.put(audioData);
 audioBuffer.flip();


 f1.push(frame); 
 Frame filteredFrame;
 while ((filteredFrame = f1.pull()) != null) {
 recorder.record(filteredFrame); 
 }
 }

 recorder.stop();
 recorder.release();
 grabber.stop();
 grabber.release();
 } catch (FrameGrabber.Exception | FrameRecorder.Exception | FFmpegFrameFilter.Exception e) {
 throw new RuntimeException(e);
 }
}


private static final double NOISE_LEVEL = 0.005; 
private static final int NOISE_FREQUENCY = 60; 

public static void applyElectricNoise(short[] audioData, int sampleRate) {
 Random random = new Random();

 
 for (int i = 0; i < audioData.length; i++) {
 double noise = Math.sin(2 * Math.PI * NOISE_FREQUENCY * i / sampleRate);

 double electricNoise = random.nextGaussian() * NOISE_LEVEL * Short.MAX_VALUE + noise;

 audioData[i] = (short) Math.max(Math.min(audioData[i] + electricNoise, Short.MAX_VALUE), Short.MIN_VALUE); 
 }
}

public static short[] applyTremolo(short[] audioData, int sampleRate, double frequency, double depth) {
 double phase = 0.0;
 double phaseIncrement = 2 * Math.PI * frequency / sampleRate;

 for (int i = 0; i < audioData.length; i++) {
 double modulator = 1.0 - depth + depth * Math.sin(phase); 
 audioData[i] = (short) (audioData[i] * modulator);

 phase += phaseIncrement;
 if (phase > 2 * Math.PI) {
 phase -= 2 * Math.PI;
 }
 }
 return audioData;
}

public static short[] applyDistortion(short[] audioData, double gain, double threshold) {
 for (int i = 0; i < audioData.length; i++) {
 double sample = audioData[i] * gain;

 if (sample > threshold) {
 sample = threshold;
 } else if (sample < -threshold) {
 sample = -threshold;
 }

 audioData[i] = (short) sample;
 }
 return audioData;
}



-
Cross compiling Rust app depending on ffmpeg fails
28 juin 2024, par user253530Trying to cross compile an application depending on ffmpeg-next from Linux to Windows. It works well on Linux but when using cross to compile for Windows I get this error


error: failed to run custom build command for `ffmpeg-sys-next v7.0.0`

Caused by:
process didn't exit successfully: `/target/debug/build/ffmpeg-sys-next-a15fd7744c0ae4bc/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-pc-windows-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_pc_windows_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

--- stderr
thread 'main' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/ffmpeg-sys-next-7.0.0/build.rs:740:14:
called `Result::unwrap()` on an `Err` value:
pkg-config exited with status code 1
> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libavutil

The system library `libavutil` required by crate `ffmpeg-sys-next` was not found.
The file `libavutil.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
The PKG_CONFIG_PATH environment variable is not set.```

Appreciate the help.



-
Keep trying a command until it returns "True" and then execute another
6 janvier 2023, par Tyrone HirtI'm trying to make a script to check the processor usage for a specific process every 10 seconds, and when the usage is
less than 2%
I want another 2 commands to be executed.

The purpose is to know when the program has finished processing the requests, in order to release the execution of the other commands.


I created this script to check the processor usage by this application :


SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery

%ProcessorUsage%



And these are the commands I want to be executed when the processor usage of the
RenderQuery
application isless than 2%
:

for /f "delims=" %%X in ('dir /s/b/ad Proxy') do for /f "delims=" %%Y in ('dir /s/b/a-d "%%X"') do move "%%Y" ".\03. Proxy"

for /f "delims=" %%i in ('dir /s/b/ad Proxy') do rd "%%i"



I tried to create a script that way here :


SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery
:Loop
IF %ProcessorUsage% LSS 2 (
(for /f "delims=" %%X in ('dir /s/b/ad Proxy') do for /f "delims=" %%Y in ('dir /s/b/a-d "%%X"') do move "%%Y" ".\03. Proxy") && (for /f "delims=" %%i in ('dir /s/b/ad Proxy') do rd "%%i")
) ELSE (
sleep 10 && goto Loop
)



I also tried this way here :


SET ProcessorUsage = wmic path Win32_PerfFormattedData_PerfProc_Process get Name,PercentProcessorTime | findstr /i /c:RenderQuery

:Loop
for %ProcessorUsage% LSS 2 do (
(for /f "delims=" %%X in ('dir /s/b/ad Proxy') do for /f "delims=" %%Y in ('dir /s/b/a-d "%%X"') do move "%%Y" ".\03. Proxy") && (for /f "delims=" %%i in ('dir /s/b/ad Proxy') do rd "%%i") || (sleep 10 && goto Loop)
)



With these scripts I tried to create the window that only blinks and closes right away...


What's the best way to do this ?


EDIT


Explaining in more detail : I work with video production, so I constantly need to render Proxy files, which are video files with low quality to be used during my video editing and replaced at the end of editing, this makes the much smoother video editing.


Having said that, I have a folder model, inside this folder model there is a folder where I always download the video files from the camera and in that folder there is always a
.bat
file that opens all the video files in the software that generates proxy files of the camera's video files.

This
.bat
file has this exact code :

start "" "C:\Users\User\Downloads\FFmpeg_Batch_AV_Converter_Portable_2.8.4_x64\FFBatch.exe" -f "%~dp0\"



When this software opens, it automatically renders the proxy files and their output is always in a child folder of the original files folder, and the name of the folder is Proxy.


The issue is that I don't want them to be in several separate Proxy folders, so I created another
.bat
file that is in the parent folder of all video files, this script contains exactly these lines :

for /f "delims=" %%X in ('dir /s/b/ad Proxy') do for /f "delims=" %%Y in ('dir /s/b/a-d "%%X"') do move "%%Y" ".\03. Proxy"

for /f "delims=" %%i in ('dir /s/b/ad Proxy') do rd "%%i"



That is, it only searches recursively for files that are inside folders named Proxy, then it moves these files to the folder 03. Proxy that is inside the parent folder.


The second line looks for all proxy folders (which are now empty) and deletes them.


The point is : I currently run the second script manually, as soon as the render finishes, and I would like it to run automatically.


Given this, I thought of adding a line in the first script, which opens the video files in the rendering program, this line would call the second script in the background, and the second script would be analyzing the CPU usage of this application every 10 seconds, and when the usage is less than 2% (in theory there is nothing else rendering, since it has a low CPU usage) it executes the lines that move the files and remove the folders.


I think there's a good change for this to work, because this software renders 4 videos at a time, and this means that there is no time between stopping rendering a video and starting another... the CPU usage is always very high until all the videos are finished, so I think this would be the best signal to release the other commands.