Recherche avancée

Médias (9)

Mot : - Tags -/soundtrack

Autres articles (69)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (11763)

  • ffmpeg hangs when run in a multi-threaded environment

    3 février 2018, par Zaid Amir

    I have a service that needs to transcode large amount of videos with different formats. The service spawns five threads, one for a single video and each thread runs ffmpeg with the following command :

    ffmpeg -i %%FILEPATH%% -vf scale=X:Y -ab 128k -c:a aac -movflags faststart -strict -2 -ar 22050 -r 24 -c:v libx264 -crf 25 -y %%OUTPUT.MP4%%

    where X and Y are the desired dimensions based on the orientation of the original file basically its either 640:trunc(ow*a/2)*2 for landscape or trunc(oh*a/2)*2:640 for portrait.

    This is my ffmpeg info :

    ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
     built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
     libavutil      54.  7.100 / 54.  7.100
     libavcodec     56.  1.100 / 56.  1.100
     libavformat    56.  4.101 / 56.  4.101
     libavdevice    56.  0.100 / 56.  0.100
     libavfilter     5.  1.100 /  5.  1.100
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  0.100 /  3.  0.100
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  0.100 / 53.  0.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

    The service is written in Java and running on Ubuntu Server 14.04 and the machine is an 64-bit octa-core server.

    This is the code block that executes ffmpeg :

    try
    {
       ProcessBuilder procBuilder = null;


       String sArgs = String.format("ffmpeg -i %s -vf scale=%s:%s -ab 128k -c:a aac -movflags faststart -strict -2 -ar 22050 -r 24 -c:v libx264 -crf 25 -y %s",
                   originalPath,
                   outWidth,
                   outHeight,
                   targetPath
           );

       }

       String[] arrArgs = sArgs.split("\\s+");
       procBuilder = new ProcessBuilder(Arrays.asList(arrArgs));
       procBuilder.redirectErrorStream(true);
      procBuilder.redirectOutput();


       Process process = procBuilder.start();

       try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())))
       {
           String line = null;
           while ((line = reader.readLine()) != null)
           {
               System.out.println(line);
           }
           errorCode = process.waitFor();
       }
    }
    catch(Throwable ex)
    {
    }

    I am currently spawning five threads, and each thread runs a single instance of ffmpeg targeting a single video file. This works fine most of the time, but every once in a while threads start to hang. I noticed from top that ffmpeg hangs indefinitely on some files with one of the threads using 100% of the core CPU and no progress is made. It happened with different file types as I noticed this on mkv, avi, wmv and mp4 files.

    I am not sure what is causing ffmpeg to hang, it does not happen right at the beginning of the transcoding process, ffmpeg starts converting the file fine but somewhere in the middle it gets stuck.

    Now this is not a problem with the files as when I try the same command on the same file manually it runs fine. And it only seems to happen when there are multiple instances of ffmpeg running at the same time as I now changed my service to only run a single thread and it has been running for almost a month with no issues.

    Is there an option that I need to use to allow multiple instances of ffmpeg to run at the same time ? Is it something in the command line that I currently use that causes this ?

  • ffmpeg crashes when extracting PNG's from video [Solved]

    7 février 2018, par Sam Bogoff

    I am attempting to extract PNG’s from a video (.avi) using ffmpeg. My code is :

       ffmpeg -i vidx.avi -f image2 imgx_%d.png

    Normally that would work fine, but just now it has been causing ffmpeg to crash, a box appears telling me ’ffmpeg.exe has stopped working .. etc...’, however changing from png’s to jpeg’s and the problem goes away.

    The format of the video doesn’t seem to matter, an mp4 and mpg also have the same issue as the avi.

    This has only just happened (in the past day) on a Windows 10(x64)PC so, could it be related to a MS/Windows Update.. is that possible ? Does anyone know what else could cause this ?

    Edit : Solved it.. It was because ImageMagick had been installed and Windows deferred to that version (3.4) rather than my nightly-build version from Zeranoe, so to remedy the problem I placed the ’ImageMagick’ in my PATH list within the Environmental Variables lower down than the entry for C :\Program Files\ffmpg\bin, and now the problem has gone.

  • FFMPEG Throws Unexpected Exception

    12 février 2018, par MBJH

    I have this code which works fine until the finally statement is called :

    File cd=new File(path.substring(0, path.lastIndexOf("\\")));
           String cmdLine="C:/Program Files/ffmpeg/bin/ffmpeg -i " + path.substring(path.lastIndexOf("\\")+1) + " " + path.substring(path.lastIndexOf("\\")+1, path.lastIndexOf(".")) + "c.mp4";
           Process ffmpeg=Runtime.getRuntime().exec(cmdLine, null, cd);
               try {
                   ffmpeg.getInputStream();
                   ffmpeg.waitFor();
               } catch(InterruptedException ex) {
                   ffmpeg.getErrorStream();
                   ex.printStackTrace();
               } finally {
                   ffmpeg.getOutputStream();
                   Update_Delete ud=new Update_Delete(details[0], details[1], details[2]);
                   ud.compressed(Integer.parseInt(path.substring(path.lastIndexOf("\\")+5, path.lastIndexOf("\\")+6)));  
               }    

    Then it throws this IllegalStateException and I have no idea why.

    Warning:   StandardWrapperValve[addVideo]: Servlet.service() for servlet addVideo threw exception
    java.lang.IllegalStateException: This web container has not yet been started
       at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1674)
       at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
       at helpers.video.compressFile(video.java:42)
       at SQL.Create.insertIntoVideos(Create.java:94)
       at servlets.addVideo.doPost(addVideo.java:39)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
       at org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:305)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
       at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
       at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
       at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
       at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
       at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
       at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
       at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
       at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
       at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
       at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
       at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
       at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
       at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
       at java.lang.Thread.run(Thread.java:745)

    Please tell me why this happened and/or how to fix it. Thanks in advance.