
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (62)
-
List of compatible distributions
26 avril 2011, parThe 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 (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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
Sur d’autres sites (7886)
-
Could you please guide me on how to play a single sample of an audio file in C# using FFmpeg ?
11 juillet 2023, par hello worldWhat is the recommended approach for playing a single sample of an audio file in C# using FFmpeg ? I would like to incorporate FFmpeg into my C# application to play a specific sample from an audio file. Could someone provide an example or guide me on how to achieve this ? Any help would be appreciated.


using System;
using System.Diagnostics;

public class AudioPlayer
{
 private string ffmpegPath;

 public AudioPlayer(string ffmpegPath)
 {
 this.ffmpegPath = ffmpegPath;
 }

 public void PlayAudioSample(string audioFilePath, TimeSpan samplePosition)
 {
 // Prepare FFmpeg process
 Process ffmpegProcess = new Process();
 ffmpegProcess.StartInfo.FileName = ffmpegPath;
 ffmpegProcess.StartInfo.Arguments = $"-ss {samplePosition} -i \"{audioFilePath}\" -t 1 -acodec pcm_s16le -f wav -";
 ffmpegProcess.StartInfo.RedirectStandardOutput = true;
 ffmpegProcess.StartInfo.RedirectStandardError = true;
 ffmpegProcess.StartInfo.UseShellExecute = false;
 ffmpegProcess.StartInfo.CreateNoWindow = true;

 // Start FFmpeg process
 ffmpegProcess.Start();

 // Play audio sample
 using (var audioOutput = new NAudio.Wave.WaveOutEvent())
 {
 using (var audioStream = new NAudio.Wave.RawSourceWaveStream(ffmpegProcess.StandardOutput.BaseStream, new NAudio.Wave.WaveFormat(44100, 16, 2)))
 {
 audioOutput.Init(audioStream);
 audioOutput.Play();
 while (audioOutput.PlaybackState == NAudio.Wave.PlaybackState.Playing)
 {
 System.Threading.Thread.Sleep(100);
 }
 }
 }

 // Wait for FFmpeg process to exit
 ffmpegProcess.WaitForExit();
 }
}



-
fluent-ffmpeg sometimes crashes entire amazon ec2 instance
24 octobre 2020, par Mick MarsdenI have a nodejs application where I'm using fluent-ffmpeg to convert captured video files via the html
<input file="file" />
tag to mp4 format. I'm also using ffmpeg-static to provide static binaries for fluent-ffmpeg's file path. But in order for the conversion to happen, I upload the captured video file via multer, and when that completes, multer passes the video url to fluent-ffmpeg. The code looks like this :

app.post("/upload-and-convert", async function(req, res) {

 var filepath;
 var path;

 try {

 const upload = util.promisify(uploadVideo());

 await upload(req, res);

 console.log(req.file);
 console.log("Success");
 filepath = req.file.filename;
 console.log(filepath);
 path = './public/uploads/' + filepath;
 console.log(path);

 } catch (e) {
 let response_json = {
 success: false,
 };
 res.setHeader("content-type", "application/json");
 res.send(response_json);
 }

 if(path != undefined)
 {

 console.log("Path not undefined, going to start FFMPEG");
 ffmpeg(path)
 .format('mp4')
 .size('720x720').autopad()
 .on('end', function() {
 console.log('file has been converted successfully');
 })
 .on('error', function(err) {
 console.log('an error happened: ' + err.message);
 let response_json = {
 success: false,
 };
 res.setHeader("content-type", "application/json");
 res.send(response_json);
 })
 .save('./public/uploads/video.mp4')
 .on('end', function() {
 console.log('file has been saved successfully');
 let response_json = {
 success: true,
 fileURL: 'https://websiteurl/uploads/video.mp4'
 };
 res.setHeader("content-type", "application/json");
 res.send(response_json);
 })

 } else
 {
 let response_json = {
 success: false,
 };
 res.setHeader("content-type", "application/json");
 res.send(response_json);
 }
});



Most times, the code runs fine and returns the fileURL as intended. Sometimes however, it completely crashes the amazon ec2 instance, and requires the instance be rebooted before it works again. I've checked the logs, and the server-error logs output no issues. The server-out logs when it crashes outputs the final console log before ffmpeg starts :


console.log("Path not undefined, going to start FFMPEG");



The moment it reaches the
ffmpeg(path)
, it goes down. It doesn't log any error, even though I have included error handling on the operation.

This has stumped me for days. I cannot figure out the commonality to explain why sometimes it crashes, and sometimes it does not. Note that this even happened before I started using the ffmpeg-static package. My node version is 12.19.0, and ffmpeg-static currently installs ffmpeg at version 4.3.1 if I recall correctly.


If anyone could help that would be great.


-
Cant find file or directory
25 juillet 2019, par Mister from BelarusSuprocess cant find file or directory from python script
I`ve tried to convert mp3 to wav with subprocess and it works with cmd, when i write ffmpeg -i file.mp3 file.wav, but indetical code on python cant find my files. ffmpeg version N-94387-g923d5c489f.
subprocess.call([’ffmpeg’, ’-i’, ’file.mp3’,
’file.wav’], cwd=r’C :/Users/Lenovo/Desktop’)Users/Lenovo/PycharmProjects/coloon/main.py
Traceback (most recent call last) :
File "C :/Users/Lenovo/PycharmProjects/coloon/main.py", line 4, in
’file.wav’], cwd=r’C :/Users/Lenovo/Desktop’)
File "C :\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p :
File "C :\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in init
restore_signals, start_new_session)
File "C :\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError : [WinError 2] Не удается найти указанный файлI`ve also tried to use this
subprocess.call(['ffmpeg', '-i', r'D:/file.mp3',
r'D:/file.wav'])but result is the same.