Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (52)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (8703)

  • Invalid data found when processing input on ffmpeg m4s to mp4 transfer

    1er mars 2020, par keith scott

    The result of the power shell window

    I saw a post on here about converting m4s to mp4 and I have followed the steps of concatenating all the files into another m4s file that I called all.m4s and when I use the command ffmpeg -i allm4s.m4s -c copy video.mp4. I made the combined m4s file by coding an exe to add all the m4s files that have the word video in them to the m4s file. Here is the source code written in c# if you compile the code then that is the code I have used to make the m4s

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.IO;

    namespace files
    {
       class Program
       {
           static void Main(string[] args)
           {
               string dir = Directory.GetCurrentDirectory();
               string[] info = Directory.GetFiles(dir);
               Console.WriteLine(dir + "\\allm4s.m4s");
               Console.ReadKey();
               foreach (string name in info)
               {
                   if (Path.GetFileName(name).Contains(".m4s") && Path.GetFileName(name).Contains("video"))
                   {
                       using (Stream srcStream = File.OpenRead(name))
                       {
                           using (Stream destStream = File.OpenWrite(dir+"\\allm4s.m4s"))
                           {
                               srcStream.CopyTo(destStream);
                               Console.WriteLine(destStream+name);
                           }
                       }
                   }
               }
               Console.ReadKey();
           }
       }
    }

    I think if there is to be an issue it is to do with this allm4s.m4s file as the file size is about 1.5mb even though each segment m4s is about 750kb each and there are quite a lot.If anyone has a way of adding concatenating lots of files together through a program/application that would be useful.

  • ffmpeg unbale to initialize threading [closed]

    16 octobre 2020, par Sudipta Roy

    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;

  • Merge multiple mp4 (h264 + aac) videos into one frame without re-encoding

    1er décembre 2017, par shubhadeep banerjee

    I have four mp4 files with same length (1 minute each) , say 1.mp4, 2.mp4, 3.mp4 and 4.mp4. I want to merge these four videos into a single frame and create a mosaic of four videos ; 1.mp4 at the top-left, 2.mp4 at the top-right, 3.mp4 at the bottom-left and 4.mp4 at the bottom-right.

    I have tried the same using ffmpeg filter_complex.

    ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i 4.mp4 -filter_complex "
    nullsrc=size=640x480 [base] ; [0:v] setpts=PTS-STARTPTS,
    scale=320x240 [upperleft] ; [1:v] setpts=PTS-STARTPTS, scale=320x240
    [upperright] ; [2:v] setpts=PTS-STARTPTS, scale=320x240 [lowerleft] ;
    [3:v] setpts=PTS-STARTPTS, scale=320x240 [lowerright] ;
    [base][upperleft] overlay=shortest=1 [tmp1] ; [tmp1][upperright]
    overlay=shortest=1:x=320 [tmp2] ; [tmp2][lowerleft]
    overlay=shortest=1:y=240 [tmp3] ; [tmp3][lowerright]
    overlay=shortest=1:x=320:y=240 " output.mp4

    But the problem is, ffmpeg re-encodes the video. The input videos already have h.264 + aac encoding, and the output video will have the same encoding. I would be running this code on a very low-power embedded Linux board which have only one core CPU. The board is taking almost 6x times of the file length to produce the output (i.e. 6 minutes in my case), and also consuming 100% of the CPU.

    Is there any other way to do this, without re-encoding ? I run the whole thing on Debian, so I can use any package you suggest.