Recherche avancée

Médias (0)

Mot : - Tags -/images

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (94)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Les sons

    15 mai 2013, par
  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (5986)

  • Error (ERR_STREAM_DESTROYED) : Cannot call write after a stream was destroyed

    3 avril 2021, par TTT Tobi Triple Talk

    I'm getting this error when I run my discord bot on my raspberry pi. It worked everytime when I run it on my windows machine. I installed FFmpeg with sudo apt-get install ffmpeg. I don't know if I need to install something else for ffmpeg on my raspberry pi
This is the error I'm getting

    


    events.js:291
      throw er; // Unhandled 'error' event
      ^

Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:399:19)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Socket.Writable.write (_stream_writable.js:318:11)
    at PassThrough.ondata (_stream_readable.js:718:22)
    at PassThrough.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at PassThrough.Readable.push (_stream_readable.js:213:10)
    at PassThrough.Transform.push (_stream_transform.js:152:32)
    at PassThrough.afterTransform (_stream_transform.js:96:10)
Emitted 'error' event on FFmpeg instance at:
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at FFmpeg.onerror (_stream_readable.js:754:7)
    at FFmpeg.emit (events.js:314:20)
    at Socket.processError (node_modules/prism-media/src/core/FFmpeg.js:64:40)
    at Socket.emit (events.js:314:20)
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at onwriteError (_stream_writable.js:418:5)
    at onwrite (_stream_writable.js:445:5)
    at doWrite (_stream_writable.js:399:11)
    at writeOrBuffer (_stream_writable.js:387:5) {
  code: 'ERR_STREAM_DESTROYED'
}


    


    Normally it should play an audio stream to a discord channel.
I don't think my code is wrong, because it's working on my other computer.
My code :

    


    let stream;
//Meme.url is just a youtube link, like https://www.youtube.com/watch?v=dQw4w9WgXcQ
stream = ytdl(meme.url, {
    filter: "audioonly",
    opusEncoded: true,
    encoderArgs: ['-af', "dynaudnorm=f=150"]
}).on("error", (err) => {
    console.log(err);
});
    try {
        song_queue.connection.play(stream, { type: "opus" })
        .on('finish', () => {
            
        });
    } catch (err) {
        console.log(err);
        message.channel.send("Error while the meme song");
    }


    


  • Catching ffmpeg errors in Tensorflow

    12 avril 2018, par lollercoaster

    Currently I make extensive use of tensorflow’s ffmpeg interface :

    from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
    from tensorflow.python.ops import io_ops
    from tensorflow.contrib import ffmpeg

    def load(mp3_path):
       with tf.name_scope("loading") as scope:
           audio_binary = tf.read_file(mp3_path)
           waveform = tf.reshape(ffmpeg.decode_audio(
               audio_binary, file_format='mp3',
               samples_per_second=44100, channel_count=1), [-1])
           return waveform

    This is wonderful, but sometimes (well, a lot) I get errors like this when looping through a bunch of files to create TFRecord files :

    [mp3 @ 0xdd4400] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0xf2e440] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0x202bf40] invalid new backstep -1
    [mp3 @ 0x15c5440] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0x1752460] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0x1f10160] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0x1a16dc0] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input
    [mp3 @ 0x9f2c80] Header missing
    Error while decoding stream #0:0: Invalid data found when processing input

    which shows up in stdout while running this Python script.

    I’d like to catch these somehow ! And prevent the rest of my loop from continuing if the data I’m reading is invalid.

    Currently, these errors just happen and the script happily keeps running, which is probably not the way it should work.

    I’m not making use of the Dataset API for this, so these direct session.run(waveform_op) calls should throw and Exception or something when parsing fails !

    Anyone know how I can do this ?

  • ffmpeg unbale to initialize threading in some cases

    16 octobre 2020, par Sudipta Roy

    I am posting this again since the earlier question I posted has been closed

    


    I have a JAVA service running in wildfly which is calling an external ffmpeg binary to convert .au files to .wav files. The actual command that is being executed is as follows :

    


    ffmpeg -y -i INPUT.au OUTPUT.wav


    


    It is running smoothly, except every once in a while it is creating an empty .wav file becasue of the following error :

    


    Error: ffmpeg version c6710aa Copyright (c) 2000-2017 the FFmpeg 
developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/tmp/ffmpeg-static/target --pkg-config-flags=- 
-static --extra-cflags=-I/tmp/ffmpeg-static/target/include --extra- 
ldflags=-L/tmp/ffmpeg-static/target/lib --extra-ldexeflags=-static -- 
bindir=/tmp/ffmpeg-static/bin --enable-pic --enable-ffplay --enable- 
ffserver --enable-fontconfig --enable-frei0r --enable-gpl --enable- 
version3 --enable-libass --enable-libfribidi --enable-libfdk-aac -- 
enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb -- 
enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus -- 
enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora - 
-enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis -- 
enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 -- 
enable-libxvid --enable-libzimg --enable-nonfree --enable-openssl
libavutil      55. 34.101 / 55. 34.101
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.101 / 57. 56.101
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

Input #0, ogg, from 'INPUT.au'
Duration: 00:00:34.08, start: 0.01500, bitrate: 15kb/s
Stream: #0.0: Audio: speex, 8000Hz, mono, s16, 15kb/s

[AVFilterGraph @ 0x43ec6e0] Error initializing threading.
[AVFilterGraph @ 0x43ec6e0] Error creating filter 'anull'


    


    If I try to manually convert the file from command line, it works. A brief internet search (this) shows that it might be due to the fact that ffmpeg is unable to create threads for internal use. Can anyone please elaborate ?

    


    The server where I am facing the problem have relatively high load. I have seen that wildfly is creating close to 1800 threads.

    


    Thanks

    


    P.s. I have managed to recreate the problem. Below is the code :

    


    SystemCommandExecutor.java

    


        import java.io.*;&#xA;    import java.util.List;&#xA;    public class SystemCommandExecutor {&#xA;        private List<string> commandInformation;&#xA;        private String adminPassword;&#xA;        private ThreadedStreamHandler inputStreamHandler;&#xA;        private ThreadedStreamHandler errorStreamHandler;&#xA;&#xA;        public SystemCommandExecutor(final List<string> commandInformation)&#xA;        {&#xA;        if (commandInformation==null) throw new NullPointerException("The commandInformation is required.");&#xA;        this.commandInformation = commandInformation;&#xA;        this.adminPassword = null;&#xA;        }&#xA;&#xA;    public int executeCommand()&#xA;            throws IOException, InterruptedException&#xA;    {&#xA;        int exitValue = -99;&#xA;&#xA;        try&#xA;        {&#xA;            ProcessBuilder pb = new ProcessBuilder(commandInformation);&#xA;            Process process = pb.start();&#xA;            OutputStream stdOutput = process.getOutputStream();&#xA;            InputStream inputStream = process.getInputStream();&#xA;            InputStream errorStream = process.getErrorStream();&#xA;            inputStreamHandler = new ThreadedStreamHandler(inputStream, stdOutput, adminPassword);&#xA;            errorStreamHandler = new ThreadedStreamHandler(errorStream);&#xA;            inputStreamHandler.start();&#xA;            errorStreamHandler.start();&#xA;            exitValue = process.waitFor();&#xA;            inputStreamHandler.interrupt();&#xA;            errorStreamHandler.interrupt();&#xA;            inputStreamHandler.join();&#xA;            errorStreamHandler.join();&#xA;        }&#xA;        catch (IOException e)&#xA;        {&#xA;            throw e;&#xA;        }&#xA;        catch (InterruptedException e)&#xA;        {&#xA;            throw e;&#xA;        }&#xA;        finally&#xA;        {&#xA;            return exitValue;&#xA;        }&#xA;    }&#xA;&#xA;    public StringBuilder getStandardOutputFromCommand()&#xA;    {&#xA;        return inputStreamHandler.getOutputBuffer();&#xA;    }&#xA;&#xA;    public StringBuilder getStandardErrorFromCommand()&#xA;    {&#xA;        return errorStreamHandler.getOutputBuffer();&#xA;    }&#xA;}&#xA;</string></string>

    &#xA;

    ThreadedStreamHandler.java

    &#xA;

    import java.io.*;&#xA;&#xA;class ThreadedStreamHandler extends Thread&#xA;{&#xA;    InputStream inputStream;&#xA;    String adminPassword;&#xA;    OutputStream outputStream;&#xA;    PrintWriter printWriter;&#xA;    StringBuilder outputBuffer = new StringBuilder();&#xA;    private boolean sudoIsRequested = false;&#xA;&#xA;    &#xA;    ThreadedStreamHandler(InputStream inputStream)&#xA;    {&#xA;        this.inputStream = inputStream;&#xA;    }&#xA;&#xA;    &#xA;    ThreadedStreamHandler(InputStream inputStream, OutputStream outputStream, String adminPassword)&#xA;    {&#xA;        this.inputStream = inputStream;&#xA;        this.outputStream = outputStream;&#xA;        this.printWriter = new PrintWriter(outputStream);&#xA;        this.adminPassword = adminPassword;&#xA;        this.sudoIsRequested = true;&#xA;    }&#xA;&#xA;    public void run()&#xA;    {&#xA;        &#xA;        if (sudoIsRequested)&#xA;        {&#xA;            printWriter.println(adminPassword);&#xA;            printWriter.flush();&#xA;        }&#xA;&#xA;        BufferedReader bufferedReader = null;&#xA;        try&#xA;        {&#xA;            bufferedReader = new BufferedReader(new InputStreamReader(inputStream));&#xA;            String line = null;&#xA;            while ((line = bufferedReader.readLine()) != null)&#xA;            {&#xA;                outputBuffer.append(line &#x2B; "\n");&#xA;            }&#xA;        }&#xA;        catch (IOException ioe)&#xA;        {&#xA;            ioe.printStackTrace();&#xA;        }&#xA;        catch (Throwable t)&#xA;        {&#xA;            t.printStackTrace();&#xA;        }&#xA;        finally&#xA;        {&#xA;            try&#xA;            {&#xA;                bufferedReader.close();&#xA;            }&#xA;            catch (IOException e)&#xA;            {&#xA;                // ignore this one&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    private void doSleep(long millis)&#xA;    {&#xA;        try&#xA;        {&#xA;            Thread.sleep(millis);&#xA;        }&#xA;        catch (InterruptedException e)&#xA;        {&#xA;            // ignore&#xA;        }&#xA;    }&#xA;&#xA;    public StringBuilder getOutputBuffer()&#xA;    {&#xA;        return outputBuffer;&#xA;    }&#xA;&#xA;}&#xA;

    &#xA;

    FfmpegRunnable.java

    &#xA;

    import java.io.IOException;&#xA;import java.util.List;&#xA;&#xA;public class FfmpegRunnable implements Runnable {&#xA;    private List<string> command;&#xA;    SystemCommandExecutor executor;&#xA;&#xA;    public FfmpegRunnable(List<string> command) {&#xA;        this.command = command;&#xA;        this.executor = new SystemCommandExecutor(command);&#xA;    }&#xA;&#xA;    @Override&#xA;    public void run() {&#xA;        try {&#xA;            int id = (int) Thread.currentThread().getId();&#xA;            int result = executor.executeCommand();&#xA;            if(result != 0) {&#xA;                StringBuilder err = executor.getStandardErrorFromCommand();&#xA;                System.out.println("[" &#x2B; id &#x2B; "]" &#x2B; "[ERROR] " &#x2B; err);&#xA;            } else {&#xA;                System.out.println("[" &#x2B; id &#x2B; "]" &#x2B; "[SUCCESS]");&#xA;            }&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;        } catch (InterruptedException e) {&#xA;            e.printStackTrace();&#xA;        }&#xA;    }&#xA;}&#xA;</string></string>

    &#xA;

    FfmpegMain.java

    &#xA;

    import java.util.ArrayList;&#xA;import java.util.List;&#xA;import java.util.concurrent.Executor;&#xA;import java.util.concurrent.Executors;&#xA;import java.util.concurrent.ThreadPoolExecutor;&#xA;public class FfmpegMain {&#xA;    public static void main(String[] args) {&#xA;        //boolean threading = false;&#xA;        System.out.println(args[0]);&#xA;        int nrThread = Integer.parseInt(args[0]);&#xA;        boolean threading = Boolean.parseBoolean(args[1]);&#xA;        System.out.println("nrThread : " &#x2B; nrThread &#x2B; ", threading : " &#x2B; threading);&#xA;        if(threading) {&#xA;            System.out.println("ffmpeg threading enabled");&#xA;        } else {&#xA;            System.out.println("ffmpeg threading not enabled");&#xA;        }&#xA;        ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(nrThread);&#xA;        for(int i=0; i cmd = new ArrayList<string>();&#xA;            String dest = "/tmp/OUTPUT/output_" &#x2B; (Math.random()*1000) &#x2B; ".wav";&#xA;            String cmdStr = "/tmp/FFMPEG/ffmpeg" &#x2B; (threading ? " -threads 1 " : " ")&#xA;                    &#x2B; "-y -i /tmp/input.au " &#x2B; dest;&#xA;            cmd.add("/bin/sh");&#xA;            cmd.add("-c");&#xA;            cmd.add(cmdStr);&#xA;&#xA;            executor.submit(new FfmpegRunnable(cmd));&#xA;        }&#xA;        executor.shutdown();&#xA;    }&#xA;}&#xA;</string>

    &#xA;

    I have created a jar with the class files and run the jar from two seperate terminal with the following command

    &#xA;

    java -jar JAR.jar 40 true&#xA;

    &#xA;

    Here 40 is the number of threads, simulating varous users accessing the system. Every once in a while I get above mentioned error.

    &#xA;