Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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 (6382)

  • FFSERVER - streaming an ASF video as Webm output

    30 mai 2014, par Emmanuel Brunet

    I’m trying to stream an IP webcam ASF live stream to a ffserver to output a webm video format. The server starts successfully but the ffserver commands used to feed the ffserver fails and generates a core dump.

    Input stream

    $ ffprobe http://account:password@webcam/videostream.asf

    Input #0, asf, from 'http://admin:alpha1237@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 25 tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, 1 channels, s16p, 32 kb/s

    ffserver configuration

    my ffserver configuration is :

    Port 8091
    RTSPPort 554
    BindAddress 192.168.1.62
    MaxHTTPConnections 1000
    MaxClients 100
    MaxBandwidth 1000
    CustomLog -

    <feed>
           File /tmp/webcam.ffm
           FileMaxSize 500M
           ACL allow localhost
           ACL allow 192.168.0.0 192.168.255.255

    </feed>

    <stream>              # Output stream URL definition
      Feed webcam.ffm              # Feed from which to receive video
      Format webm

      # Audio settings
      AudioCodec vorbis
      AudioBitRate 64             # Audio bitrate

      # Video settings
      VideoCodec libvpx
      VideoSize 640x480           # Video resolution
      VideoFrameRate 25           # Video FPS
      AVOptionVideo flags +global_header  # Parameters passed to encoder
                                          # (same as ffmpeg command-line parameters)
      AVOptionVideo cpu-used 0
      AVOptionVideo qmin 10
      AVOptionVideo qmax 42
      AVOptionVideo quality good
      AVOptionAudio flags +global_header
      PreRoll 15
      StartSendOnKey
      # VideoBitRate 32            # Video bitrate
    </stream>

    <stream>
           Format status
           # Only allow local people to get the status
           ACL allow localhost
           ACL allow 192.168.0.0 192.168.255.255
    </stream>

    ffmpeg feed

    I run the following command that fails

    $ ffmpeg  -i http://account:password@webcam/videostream.asf http://192.168.1.62:8091/webcam.ffm
    http://192.168.1.62:8091/webcam.ffm
    Input #0, asf, from 'http://account:password@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 25 tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s16p, 32 kb/s
    [swscaler @ 0x36a80c0] deprecated pixel format used, make sure you did set range correctly
    Segmentation fault

    I tryed

    $ ffmpeg  -i http://account:password@webcam/videostream.asf -pix_fmt yuv420p  http://192.168.1.62:8091/webcam.ffm

    But it raises the same error.

    Thanks for your help

    Edit

    For an easy testing (I thought), I tried to publish the whole ASF stream as is, meaning connecting the ASF webcam output stream to the ffserver that outputs ASF format too.
    And thus with mirrored encoding so I changed the ffserver configuration to

    ...
    <stream>
       Feed webcam.ffm
       Format asf
       VideoFrameRate 25
       VideoSize 640X480
       VideoBitRate 256
       VideoBufferSize 1000
       VideoGopSize 30
       AudioBitRate 32
       StartSendOnKey
    </stream>
    ...

    And the output is now :

    Input #0, asf, from 'http://admin:alpha1237@webcam/videostream.asf':
     Duration: N/A, start: 0.000000, bitrate: 32 kb/s
       Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: adpcm_ima_wav ([17][0][0][0] / 0x0011), 8000 Hz, mono, s16p, 32 kb/s
    [swscaler @ 0x3d620c0] deprecated pixel format used, make sure you did set range correctly
    Output #0, ffm, to 'http://192.168.1.62:8091/webcam.ffm':
     Metadata:
       creation_time   : now
       encoder         : Lavf55.40.100
       Stream #0:0: Audio: wmav2, 22050 Hz, mono, fltp, 32 kb/s
       Metadata:
         encoder         : Lavc55.64.100 wmav2
       Stream #0:1: Video: msmpeg4v3 (msmpeg4), yuv420p, 640x480, q=2-31, 256 kb/s, 1k fps, 1000k tbn, 1k tbc
       Metadata:
    Stream mapping:
     Stream #0:1 -> #0:0 (adpcm_ima_wav -> wmav2)
     Stream #0:0 -> #0:1 (mjpeg -> msmpeg4)
    Press [q] to stop, [?] for help
    Segmentation fault

    I can’t even forward the stream.

  • How to convert mp4 file to wav with the same duration ?

    16 octobre 2020, par York

    I want to convert an long Mp4 file to WAV with the same duration.&#xA;I tried to use ffmpeg with the args "aresample=async=1000" but there is still a difference :

    &#xA;

      &#xA;
    • the duration of the origin long MP4 is 03:28:05.936
    • &#xA;

    • the duration of the converted WAV is 03:28:05.35
    • &#xA;

    &#xA;

    Is there any way can convert the MP4 file to WAV with the complete same duration ?

    &#xA;

    Thanks !

    &#xA;

  • 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

    &#xA;

    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 :

    &#xA;

    ffmpeg -y -i INPUT.au OUTPUT.wav&#xA;

    &#xA;

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

    &#xA;

    Error: ffmpeg version c6710aa Copyright (c) 2000-2017 the FFmpeg &#xA;developers&#xA;built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609&#xA;configuration: --prefix=/tmp/ffmpeg-static/target --pkg-config-flags=- &#xA;-static --extra-cflags=-I/tmp/ffmpeg-static/target/include --extra- &#xA;ldflags=-L/tmp/ffmpeg-static/target/lib --extra-ldexeflags=-static -- &#xA;bindir=/tmp/ffmpeg-static/bin --enable-pic --enable-ffplay --enable- &#xA;ffserver --enable-fontconfig --enable-frei0r --enable-gpl --enable- &#xA;version3 --enable-libass --enable-libfribidi --enable-libfdk-aac -- &#xA;enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb -- &#xA;enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus -- &#xA;enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora - &#xA;-enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis -- &#xA;enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 -- &#xA;enable-libxvid --enable-libzimg --enable-nonfree --enable-openssl&#xA;libavutil      55. 34.101 / 55. 34.101&#xA;libavcodec     57. 64.101 / 57. 64.101&#xA;libavformat    57. 56.101 / 57. 56.101&#xA;libavdevice    57.  1.100 / 57.  1.100&#xA;libavfilter     6. 65.100 /  6. 65.100&#xA;libswscale      4.  2.100 /  4.  2.100&#xA;libswresample   2.  3.100 /  2.  3.100&#xA;libpostproc    54.  1.100 / 54.  1.100&#xA;&#xA;Input #0, ogg, from &#x27;INPUT.au&#x27;&#xA;Duration: 00:00:34.08, start: 0.01500, bitrate: 15kb/s&#xA;Stream: #0.0: Audio: speex, 8000Hz, mono, s16, 15kb/s&#xA;&#xA;[AVFilterGraph @ 0x43ec6e0] Error initializing threading.&#xA;[AVFilterGraph @ 0x43ec6e0] Error creating filter &#x27;anull&#x27;&#xA;

    &#xA;

    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 ?

    &#xA;

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

    &#xA;

    Thanks

    &#xA;

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

    &#xA;

    SystemCommandExecutor.java

    &#xA;

        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;