Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (61)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • 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

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (6366)

  • 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;

  • How to paint in Qt using hardware acceleration ?

    19 octobre 2020, par FennecFix

    I need to do some quite intensive drawing processes in my appliation - I'm recording a camera and a desktop. I'm using ffmpeg to capture and encode/decode my videos. Those processes are quite fast and they working in a separate thread, but when it comes to render - perfomance drops drastically. I'm using QLabel to display captured frames via setPixmap() method and I see that Qt not using any GPU power even if a matrix operation, such as scaling an image to fit the window is clearly implied. Is there any way to paint images in Qt using hardware acceleration ? Or is there another ways to speed up painting process ?

    &#xA;

  • How do I configure ffmpeg & openh264 so that the video file can be opened in Windows Media Player 12

    10 mars 2017, par Sacha Guyer

    I have successfully created h264/mp4 movie files with ffmpeg and the x264 library.

    Now I would like to change the h264 library from x264 to openH264. I could replace the x264 library with openH264, recompile ffmpeg and produce movie files, without changing my sources that produce the movie. The resulting movie opens fine in Quicktime on Mac, but on Windows, Windows Media Player 12 cannot play it.

    The documentation about Windows Media Player support for h264 is unclear. File types supported by Windows Media Player states in the table that Windows Media Player 12 supports mp4, but the text below says :

    Windows Media Player does not support the playback of the .mp4 file format.

    From what I have observed, Windows Media Player 12 IS capable of playing h264/mp4 files, but only when created with x264.

    Does anyone know how I need to adjust the configuration of the codec/context so that the movie plays in Windows Media Player ? Does Windows Media Player only support certain h264 profiles ?

    I noticed the warning :

    [libopenh264 @ 0x...] [OpenH264] this = 0x..., Warning:bEnableFrameSkip = 0,bitrate can’t be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame

    With the configuration :

    av_dict_set(&amp;options, "allow_skip_frames", "1", 0);

    I could get rid of this warning, but the movie still does not play. Are there other options that need to be set so that the movie plays in Windows Media Player ?

    Thank you for your help

    ffprobe output of the file that does play fine in Windows Media Player :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_x264.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : retina
       encoder         : Lavf57.56.100
       comment         : Creation Date: 2017-03-10 07:47:39.601
     Duration: 00:00:04.17, start: 0.000000, bitrate: 17497 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
         yuv420p, 852x754, 17495 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
       Metadata:
         handler_name    : VideoHandler

    ffprobe output of the file that does not play in Windows Media Player :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_openh264.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : retina
       encoder         : Lavf57.56.100
       comment         : Creation Date: 2017-03-10 07:49:27.024
     Duration: 00:00:04.17, start: 0.000000, bitrate: 17781 kb/s
       Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661),
         yuv420p, 852x754, 17779 kb/s, 24 fps, 24 tbr, 24k tbn, 48k tbc (default)
       Metadata:
         handler_name    : VideoHandler