Recherche avancée

Médias (91)

Autres articles (23)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Liste des distributions compatibles

    26 avril 2011, par

    Le tableau ci-dessous correspond à la liste des distributions Linux compatible avec le script d’installation automatique de MediaSPIP. Nom de la distributionNom de la versionNuméro de version Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    Si vous souhaitez nous aider à améliorer cette liste, vous pouvez nous fournir un accès à une machine dont la distribution n’est pas citée ci-dessus ou nous envoyer le (...)

Sur d’autres sites (3149)

  • I use the bramp/ffmpeg-cli-wrapper of java. How to terminate the execution in the thread ?

    8 mars, par Hao Tan

    I want to use ffmpeg to achieve streaming function

    


    First I created a thread pool

    


     private final Map taskThreads = new ConcurrentHashMap<>();
Thread taskThread = new Thread(() -> {
            try {
                private void startTask(Device task) {
        Thread taskThread = new Thread(() -> {

            FFmpegBuilder builder = new FFmpegBuilder()
                    .setInput(source) 
                    .overrideOutputFiles(true)
                    .addOutput(destination) 
                    .setFormat("flv")
                    .addExtraArgs("-c", "copy") 
                    .done();

            FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
            executor.createJob(builder).run();
        });
        taskThreads.put(task.getId(), taskThread);
        taskThread.start();
    }


    


    stop code

    


    public void stopTask(Integer taskId) {
        Thread taskThread = taskThreads.get(taskId);
        if (taskThread != null) {
            taskThread.interrupt(); 
            taskThreads.remove(taskId);
            
            DeviceDto task = deviceService.findById(taskId);
            if (task != null) {
                task.setIsOnline(0);
                Device device = new Device();
                BeanUtils.copyProperties(task,device);
                deviceService.update(device);
            }
        }
    }


    


    I call stopTask and cannot terminate the ffmpeg thread

    


    It should be executor.createJob(builder).run(); blocked

    


    How to solve

    


  • Problems with timeout when there is no video source with RTP format in java openCV

    15 février 2019, par Javier Dalmau Fajardo

    I have problems with the timeout when there is no video source with RTP format.

    If I execute the code and there is no video, the program stays waiting in the grabber.Start () function all the time.

    FFmpegFrameGrabber grabber;
    try{
       Frame img;        
       grabber = new FFmpegFrameGrabber("rtp://" + ip + ":1234");
       grabber.setOption("stimeout", String.valueOf(5*1000000));
       grabber.Start ();
       img = grabber.grab();
       Java2DFrameConverter converter = new Java2DFrameConverter();
    BufferedImage bufferedImag;
    bufferedImag = converter.convert(img);
       grabber.stop();
    }catch (FrameGrabber.Exception ex) {
       throw new IOException("Could not open video file ", ex);
    }

    As I said before, when the video exists, everything works perfectly, but when there is no video source, the program stays in the grabber.start () and I can not get out of there.

    I would like that when 5 seconds pass, it generates an exception and leaves the grabber.satart () function. I use grabber.setOption("stimeout", String.valueOf(5*1000000)) ; to controlate it but don’t work in RTP.

    I have checked the operation with RTSP video source and the code works perfectly, that is, after 5 seconds it generates an exception ... but I need to control the RTP video source.

    Someone could help me, thanks.

  • How to insert images and text in video with ffmpeg - java

    4 février 2017, par MaF
    String[] code = new String[]{"ffmpeg", "-i","D:/ffmpeg/20170201_164127.mp4",

               "-i","D:/ffmpeg/cc.png", "-filter_complex",

               "[0:v][1:v]overlay=main_w-overlay_w-5:main_h-overlay_h-5",
               "drawtext=fontfile=/ffmpeg/Arial.ttf:text='TESTING'fontcolor=white@1.0:fontsize=70:x=10:y=H-th-10:box=1:boxcolor=black@0.5:boxborderw=5:x=10:y=H-th-10",

               "[out]","-map", "[out]", "-map", "2:0",
               "-acodec","mp3", "D:/ffmpeg/test7.mp4"};



               Process processDuration = new ProcessBuilder(code).redirectErrorStream(true).start();

               StringBuilder strBuild = new StringBuilder();

               try (BufferedReader processOutputReader = new BufferedReader(new InputStreamReader(processDuration.getInputStream(), Charset.defaultCharset()));) {

                   String line;

                   while ((line = processOutputReader.readLine()) != null) {

                       strBuild.append(line + System.lineSeparator());

                   }

                   processDuration.waitFor();

               }

               String outputJson = strBuild.toString().trim();

               System.out.println(outputJson);

               }

    When i use only images the code is correctly. But when I use all the code this happens :

    [NULL @ 00000000006abe60] Unable to find a suitable output format for
    ’drawtext=fontfile=/ffmpeg/Arial.ttf:text=’TESTING’fontcolor=white@1.0:fontsize=70:x=10:y=H-th-10:box=1:boxcolor=black@0.5:boxborderw=5:x=10:y=H-th-10’
    drawtext=fontfile=/ffmpeg/Arial.ttf:text=’TESTING’fontcolor=white@1.0:fontsize=70:x=10:y=H-th-10:box=1:boxcolor=black@0.5:boxborderw=5:x=10:y=H-th-10 :
    Invalid argument