Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (62)

  • List of compatible distributions

    26 avril 2011, par

    The 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, par

    La 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 2013

    Puis-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 world

    What 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 Marsden

    I 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 :

    &#xA;

    app.post("/upload-and-convert", async function(req, res) {&#xA;&#xA;   var filepath;&#xA;   var path;&#xA;&#xA;    try {&#xA;&#xA;        const upload = util.promisify(uploadVideo());&#xA;&#xA;        await upload(req, res);&#xA;&#xA;        console.log(req.file);&#xA;        console.log("Success");&#xA;        filepath = req.file.filename;&#xA;        console.log(filepath);&#xA;        path = &#x27;./public/uploads/&#x27; &#x2B; filepath;&#xA;        console.log(path);&#xA;&#xA;    } catch (e) {&#xA;       let response_json = {&#xA;                success: false,&#xA;        };&#xA;        res.setHeader("content-type", "application/json");&#xA;        res.send(response_json);&#xA;    }&#xA;&#xA;    if(path != undefined)&#xA;    {&#xA;&#xA;        console.log("Path not undefined, going to start FFMPEG");&#xA;        ffmpeg(path)&#xA;        .format(&#x27;mp4&#x27;)&#xA;        .size(&#x27;720x720&#x27;).autopad()&#xA;        .on(&#x27;end&#x27;, function() {&#xA;            console.log(&#x27;file has been converted successfully&#x27;);&#xA;        })&#xA;        .on(&#x27;error&#x27;, function(err) {&#xA;            console.log(&#x27;an error happened: &#x27; &#x2B; err.message);&#xA;            let response_json = {&#xA;                success: false,&#xA;            };&#xA;            res.setHeader("content-type", "application/json");&#xA;            res.send(response_json);&#xA;        })&#xA;        .save(&#x27;./public/uploads/video.mp4&#x27;)&#xA;        .on(&#x27;end&#x27;, function() {&#xA;            console.log(&#x27;file has been saved successfully&#x27;);&#xA;            let response_json = {&#xA;                success: true,&#xA;                fileURL: &#x27;https://websiteurl/uploads/video.mp4&#x27;&#xA;            };&#xA;            res.setHeader("content-type", "application/json");&#xA;            res.send(response_json);&#xA;        })&#xA;&#xA;    } else&#xA;    {&#xA;        let response_json = {&#xA;            success: false,&#xA;        };&#xA;        res.setHeader("content-type", "application/json");&#xA;        res.send(response_json);&#xA;    }&#xA;});&#xA;

    &#xA;

    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 :

    &#xA;

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

    &#xA;

    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.

    &#xA;

    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.

    &#xA;

    If anyone could help that would be great.

    &#xA;

  • Cant find file or directory

    25 juillet 2019, par Mister from Belarus

    Suprocess 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.