
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (35)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (5773)
-
Android ffmpeg Command not executing
22 juin 2020, par MoTahirI am using this FFMPEG library,


first I am playing the video inside my videoView to make sure that the video path is correct


videoView.setVideoURI(Uri.parse(getExternalFilesDir(null)?.absolutePath + "videoToBeEdit"))



then I am calling the code written below to crop the video then put it inside the videoView again just to see the result


val ff = FFmpeg.getInstance(this@EditVideoActivity)
if (ff.isSupported){

 val inFile = File(getExternalFilesDir(null)?.absolutePath ,"videoToBeEdit")
 val outFile = File(getExternalFilesDir(null)?.absolutePath , "result")

 val command = arrayOf("ffmpeg","-i", inFile.absolutePath , "-filter:v", "crop=100:100:0:0", outFile.absolutePath)

 ff.execute(command, object : ExecuteBinaryResponseHandler() {
 override fun onSuccess(message: String?) {
 super.onSuccess(message)
 videoView.setVideoURI(Uri.parse(getExternalFilesDir(null)?.absolutePath + "videoToBeEdit"))
 }

 override fun onProgress(message: String?) {
 super.onProgress(message)
 }

 override fun onFailure(message: String?) {
 super.onFailure(message)
 Log.e("error", "failed")
 }

 override fun onStart() {
 super.onStart()
 Log.e("start", "started the process")
 }

 override fun onFinish() {
 super.onFinish()
 Log.e("finish", "done")
 }
 })
}



but my code above goes from start to error then finish, it doesn't show any error messages and that's making it really hard to know what's actually wrong :( I tried to write my command in different ways following those tutorials tutorial1 tutorial2 link
please help, thank you in advance...


-
Add support for playing Audible AAXC (.aaxc) files [PATCH v4]
1er janvier 2000, par Vesselin BontchevAdd support for playing Audible AAXC (.aaxc) files [PATCH v4]
The AAXC container format is the same as the (already supported) Audible
AAX format but it uses a different encryption scheme.Note : audible_key and audible_iv values are variable (per file) and are
externally fed.It is possible to extend https://github.com/mkb79/Audible to derive the
audible_key and audible_key values.Relevant code :
def decrypt_voucher(deviceSerialNumber, customerId, deviceType, asin, voucher) :
buf = (deviceType + deviceSerialNumber + customerId + asin).encode("ascii")
digest = hashlib.sha256(buf).digest()
key = digest[0:16]
iv = digest[16 :]# decrypt "voucher" using AES in CBC mode with no padding
cipher = AES.new(key, AES.MODE_CBC, iv)
plaintext = cipher.decrypt(voucher).rstrip(b"\x00") # improve this !
return json.loads(plaintext)The decrypted "voucher" has the required audible_key and audible_iv
values.Update (Nov-2020) : This patch has now been tested by multiple folks -
details at the following URL :https://github.com/mkb79/Audible/issues/3
Signed-off-by : Vesselin Bontchev <vesselin.bontchev@yandex.com>
-
Write EPIPE after upgrade NodeJS
28 juillet, par RougherI am using this code for detecting audio replay gain. It was working well with NodeJs 16, but after upgrading to NodeJs 22, it started crashing a few times in an hour with this error :


write EPIPE
 at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:87:19) {
 errno: -32,
 code: 'EPIPE',
 syscall: 'write'
}



My original code was


static getReplayGainVolume(audioData: Buffer) {
 // Calculate the mean volume of the audio file at the given filePath
 var ffmpeg = spawn('ffmpeg', [
 '-i', '-',
 '-af', 'replaygain',
 '-f', 'null', '/dev/null',
 '-hide_banner', '-nostats'
 ]);

 var output = '';

 ffmpeg.stdin.write(audioData);
 ffmpeg.stdin.end();

 return new Promise((resolve,reject)=>{
 ffmpeg.on('error', function (err: any) {
 reject(err);
 });
 
 ffmpeg.on('close', function (_code: any) {
 // [Parsed_replaygain_0 @ 0000000002a2b5c0] track_gain = +6.53 dB
 if (!output.includes("track_gain")) {
 reject(output);

 return;
 }

 const gainWithDb = output.split("track_gain = ")[1];
 if (!gainWithDb) {
 reject(output);

 return;
 }

 const gain = gainWithDb.split(" dB")[0];
 if (!gain) {
 reject(output);

 return;
 }

 resolve(parseFloat(gain));
 });
 
 ffmpeg.stderr.on('data', function (data: any) {
 // ffmpeg sends all output to stderr. It is not a bug, it is a feature :)
 var tData = data.toString('utf8');
 output += tData;
 });
 });
 }



Then after search in forums and Google, I improved (I hope I improved it with cleanups)


static getReplayGainVolume(audioData: Buffer): Promise<number> {
 return new Promise((resolve, reject) => {
 const FFMPEG_PATH = 'ffmpeg'; // Adjust this if ffmpeg is not in system PATH
 const FFMPEG_TIMEOUT_MS = 30 * 1000; // 30 seconds timeout for FFmpeg execution

 let ffmpeg: ChildProcessWithoutNullStreams;
 let output = ''; // Accumulate all stderr output

 // Timeout for the FFmpeg process itself
 const ffmpegTimeout = setTimeout(() => {
 log.error(`[FFmpeg] FFmpeg process timed out after ${FFMPEG_TIMEOUT_MS / 1000} seconds. Killing process.`);
 if (ffmpeg && !ffmpeg.killed) {
 ffmpeg.kill('SIGKILL'); // Force kill
 reject(new Error(`FFmpeg process timed out and was killed.`));
 }
 }, FFMPEG_TIMEOUT_MS);

 // --- Define cleanup function to be called on process exit/error ---
 const cleanup = (shouldReject = false, error?: Error | string) => {
 clearTimeout(ffmpegTimeout); // Ensure timeout is cleared

 // Remove all listeners to prevent leaks
 // This is CRITICAL for long-running bots that spawn many child processes
 ffmpeg.stdin.removeAllListeners();
 ffmpeg.stdout.removeAllListeners();
 ffmpeg.stderr.removeAllListeners();
 ffmpeg.removeAllListeners(); // Remove process listeners

 if (ffmpeg && !ffmpeg.killed) { // Ensure ffmpeg process is killed if still alive
 ffmpeg.kill(); // Graceful kill (SIGTERM), then wait for exit. If not, then SIGKILL.
 }

 if (shouldReject) {
 reject(error instanceof Error ? error : new Error(String(error)));
 }
 };

 try {
 ffmpeg = spawn(FFMPEG_PATH, [
 '-i', 'pipe:0', // Read input from stdin (pipe:0)
 '-af', 'replaygain',
 '-f', 'null', '/dev/null', // Write output to null device (discard audio output)
 '-hide_banner', '-nostats' // Suppress ffmpeg's initial info and progress stats
 ], { stdio: ['pipe', 'pipe', 'pipe'] }); // Explicitly pipe stdin, stdout, stderr

 // --- CRITICAL: Event Handlers for ffmpeg process ---

 // 1. Handle errors during spawning or execution (e.g., ffmpeg not found)
 ffmpeg.on('error', (err: any) => {
 log.error(`[FFmpeg] Failed to spawn or execute FFmpeg process:`, err);
 cleanup(true, new Error(`FFmpeg process error: ${err.message}`));
 });

 // 2. Accumulate stderr output (where replaygain results and ffmpeg errors are printed)
 ffmpeg.stderr.on('data', (data: Buffer) => {
 output += data.toString('utf8');
 });

 // 3. Handle process exit (success or failure)
 ffmpeg.on('close', (code: number) => { // 'close' indicates process has exited
 log.debug(`[FFmpeg] FFmpeg process exited with code: ${code}.`);
 if (code !== 0) { // Non-zero exit code means failure
 log.error(`[FFmpeg] FFmpeg process exited with non-zero code ${code}. Output:\n${output}`);
 cleanup(true, new Error(`FFmpeg process failed with exit code ${code}. Output: ${output}`));
 return;
 }

 // If successful exit (code 0), parse the output
 if (!output.includes("track_gain")) {
 log.error(`[FFmpeg] 'track_gain' not found in FFmpeg output (exit code 0). Output:\n${output}`);
 cleanup(true, new Error(`'track_gain' not found in FFmpeg output. Output: ${output}`));
 return;
 }

 try {
 // Regex to parse track_gain (e.g., "+6.53 dB" or "-12.00 dB")
 const gainMatch = output.match(/track_gain\s*=\s*([+-]?\d+\.?\d*)\s*dB/);
 if (gainMatch && gainMatch[1]) {
 const gain = parseFloat(gainMatch[1]);
 log.debug(`[FFmpeg] Replay gain volume: ${gain} dB.`);
 cleanup(); // Clean up on success
 resolve(gain);
 } else {
 log.error(`[FFmpeg] Failed to parse gain from FFmpeg output. Output:\n${output}`);
 cleanup(true, new Error(`Failed to parse gain from FFmpeg output. Output: ${output}`));
 }
 } catch (parseError: any) {
 log.error(`[FFmpeg] Error parsing FFmpeg replay gain output:`, parseError);
 cleanup(true, new Error(`Error parsing FFmpeg output: ${parseError.message}. Output: ${output}`));
 }
 });

 // 4. Write audio data to ffmpeg's stdin
 // This is the only write operation that could throw EPIPE in this function.
 try {
 ffmpeg.stdin.write(audioData);
 ffmpeg.stdin.end(); // Close stdin to signal end of input
 } catch (stdinError: any) {
 log.error(`[FFmpeg] Error writing audioData to FFmpeg stdin:`, stdinError);
 // This error means ffmpeg's stdin pipe closed unexpectedly.
 // This is the direct equivalent of an EPIPE (Broken Pipe) at the child process level.
 cleanup(true, new Error(`Failed to pipe audio data to FFmpeg stdin: ${stdinError.message}`));
 }

 } catch (spawnError: any) { // Catch errors from the spawn call itself (e.g., FFMPEG_PATH is invalid)
 log.error(`[FFmpeg] Error spawning FFmpeg:`, spawnError);
 cleanup(true, new Error(`Failed to spawn FFmpeg process: ${spawnError.message}`));
 }
 });
 }
</number>


But unfortunately I still get the same error. Has anyone encountered this problem ? How can I solve it ?


I use ffmpeg version 4.2.7-0ubuntu0.1


Thanks.