Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (77)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (6965)

  • how to prevent ffmpeg closure when press Ctrl+Alt+Del keys ? (When using gdigrab) [on hold]

    16 novembre 2015, par Mitra M

    This is a simple command for capture screen by the ffmpeg and gdigrab option :

    ffmpeg -f gdigrab -framerate 25 -i desktop -an o.avi

    It works, But the ffmpeg will be closed if I press Ctrl+Alt+Del keys during capture.(to run task manager)

    How can I solve this problem ?

    Note : I know that we can run the task manager by using Ctrl+Shift+Esc keys or taskmgr.exe in the cmd, But I need to press Ctrl+Alt+Del keys during capture.

    OS = Windows 8.1

    FFmpeg = Zeraone build

  • Issue in recording video

    16 novembre 2015, par human123

    I am trying to record video in 480*480 resolution like in vine using javacv. As a starting point I used the sample provided in https://github.com/bytedeco/javacv/blob/master/samples/RecordActivity.java Video is getting recorded (but not in the desired resolution) and saved.

    But the issue is that 480*480 resolution is not supported natively in android. So some pre processing needs to be done to get the video in desired resolution.

    So once I was able to record video using code sample provided by javacv, next challenge was on how to pre process the video. On research it was found that efficient cropping is possible when final image width required is same as recorded image width. Such a solution was provided in the SO question,Recording video on Android using JavaCV (Updated 2014 02 17). I changed onPreviewFrame method as suggested in that answer.

       @Override
       public void onPreviewFrame(byte[] data, Camera camera) {
           if (audioRecord == null || audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
               startTime = System.currentTimeMillis();
               return;
           }
           if (RECORD_LENGTH > 0) {
               int i = imagesIndex++ % images.length;
               yuvImage = images[i];
               timestamps[i] = 1000 * (System.currentTimeMillis() - startTime);
           }
           /* get video data */
           imageWidth = 640;
           imageHeight = 480    
           int finalImageHeight = 360;
           if (yuvImage != null && recording) {
               ByteBuffer bb = (ByteBuffer)yuvImage.image[0].position(0); // resets the buffer
               final int startY = imageWidth*(imageHeight-finalImageHeight)/2;
               final int lenY = imageWidth*finalImageHeight;
               bb.put(data, startY, lenY);
               final int startVU = imageWidth*imageHeight + imageWidth*(imageHeight-finalImageHeight)/4;
               final int lenVU = imageWidth* finalImageHeight/2;
               bb.put(data, startVU, lenVU);
               try {
                   long t = 1000 * (System.currentTimeMillis() - startTime);
                   if (t > recorder.getTimestamp()) {
                       recorder.setTimestamp(t);
                   }
                   recorder.record(yuvImage);
               } catch (FFmpegFrameRecorder.Exception e) {
                   Log.e(LOG_TAG, "problem with recorder():", e);
               }
           }


       }
    }

    Please also note that this solution was provided for an older version of javacv. The resulting video had a yellowish overlay covering 2/3rd part. Also there was empty section on left side as the video was not cropped correctly.

    So my question is what is the most appropriate solution for cropping videos using latest version of javacv ?

    Code after making change as suggested by Alex Cohn

       @Override
       public void onPreviewFrame(byte[] data, Camera camera) {
           if (audioRecord == null || audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
               startTime = System.currentTimeMillis();
               return;
           }
           if (RECORD_LENGTH > 0) {
               int i = imagesIndex++ % images.length;
               yuvImage = images[i];
               timestamps[i] = 1000 * (System.currentTimeMillis() - startTime);
           }
           /* get video data */
           imageWidth = 640;
           imageHeight = 480;      
           destWidth = 480;

           if (yuvImage != null && recording) {
               ByteBuffer bb = (ByteBuffer)yuvImage.image[0].position(0); // resets the buffer
               int start = 2*((imageWidth-destWidth)/4); // this must be even
               for (int row=0; row2; row++) {
                   bb.put(data, start, destWidth);
                   start += imageWidth;
               }
               try {
                   long t = 1000 * (System.currentTimeMillis() - startTime);
                   if (t > recorder.getTimestamp()) {
                       recorder.setTimestamp(t);
                   }
                   recorder.record(yuvImage);
               } catch (FFmpegFrameRecorder.Exception e) {
                   Log.e(LOG_TAG, "problem with recorder():", e);
               }
           }


       }

    Screen shot from video generated with this code (destWidth 480) is

    video resolution 480*480

    Next I tried capturing a video with destWidth speciified as 639. The result is

    639*480

    When destWidth is 639 video is repeating contents twice. When it is 480, contents are repeated 5 times and the green overlay and distortion is more.

    Also When the destWidth = imageWidth, video is captured properly. ie, for 640*480 there is no repetition of video contents and no green overlay.

    Converting frame to IplImage

    When this question was asked first, I missed to mention that the record method in FFmpegFrameRecorder is now accepting object of type Frame whereas earlier it was IplImage object. So I tried to apply Alex Cohn’s solution by converting Frame to IplImage.

    //---------------------------------------
    // initialize ffmpeg_recorder
    //---------------------------------------
    private void initRecorder() {

       Log.w(LOG_TAG,"init recorder");

       imageWidth = 640;
       imageHeight = 480;

       if (RECORD_LENGTH > 0) {
           imagesIndex = 0;
           images = new Frame[RECORD_LENGTH * frameRate];
           timestamps = new long[images.length];
           for (int i = 0; i < images.length; i++) {
               images[i] = new Frame(imageWidth, imageHeight, Frame.DEPTH_UBYTE, 2);
               timestamps[i] = -1;
           }
       } else if (yuvImage == null) {
           yuvImage = new Frame(imageWidth, imageHeight, Frame.DEPTH_UBYTE, 2);
           Log.i(LOG_TAG, "create yuvImage");
           OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
           yuvIplimage = converter.convert(yuvImage);

       }

       Log.i(LOG_TAG, "ffmpeg_url: " + ffmpeg_link);
       recorder = new FFmpegFrameRecorder(ffmpeg_link, imageWidth, imageHeight, 1);
       recorder.setFormat("flv");
       recorder.setSampleRate(sampleAudioRateInHz);
       // Set in the surface changed method
       recorder.setFrameRate(frameRate);

       Log.i(LOG_TAG, "recorder initialize success");

       audioRecordRunnable = new AudioRecordRunnable();
       audioThread = new Thread(audioRecordRunnable);
       runAudioThread = true;
    }



    @Override
       public void onPreviewFrame(byte[] data, Camera camera) {
           if (audioRecord == null || audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
               startTime = System.currentTimeMillis();
               return;
           }
           if (RECORD_LENGTH > 0) {
               int i = imagesIndex++ % images.length;
               yuvImage = images[i];
               timestamps[i] = 1000 * (System.currentTimeMillis() - startTime);
           }
           /* get video data */
           int destWidth = 640;

           if (yuvIplimage != null && recording) {
               ByteBuffer bb = yuvIplimage.getByteBuffer(); // resets the buffer
               int start = 2*((imageWidth-destWidth)/4); // this must be even
               for (int row=0; row2; row++) {
                   bb.put(data, start, destWidth);
                   start += imageWidth;
               }
               try {
                   long t = 1000 * (System.currentTimeMillis() - startTime);
                   if (t > recorder.getTimestamp()) {
                       recorder.setTimestamp(t);
                   }
                   recorder.record(yuvImage);
               } catch (FFmpegFrameRecorder.Exception e) {
                   Log.e(LOG_TAG, "problem with recorder():", e);
               }
           }


       }

    But the videos generated with this method contained only green frames.

  • Compress video without using ffmpeg in android

    13 octobre 2015, par Mojtaba Asg

    I looking for any SDK-LEVEL(without using ffmpeg) approach for compress video programmatically in android.
    I can’t use ffmpeg cause its size overhead.Is there any lightweight solution for that ?

    I want reduce size of video before uploaded to server (i can’t modify server upload limit) so if you have any idea other than compressing video please share it.

    note : my min-sdk version is 14