Recherche avancée

Médias (91)

Autres articles (43)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • 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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (9162)

  • Unable to convert video to mp4 formate

    11 avril 2017, par Usman Saeed

    I have to convert video (any format) to mp4 format
    I am using this android library WritingMinds

    Here is my code

     ffmpeg = FFmpeg.getInstance(UploadVideoService.this);
               loadFFMpegBinary();

               String newVideoPath = Utils.makeAndGetFolderName(Constants.PHOTEX_VIDEO);
               File file = new File(newVideoPath + File.separator +
                       System.currentTimeMillis() + ".mp4");
               if (file.exists()) {
                   file.delete();
               }

               File fileOrignal = new File(videoFilePath);
               if (fileOrignal.exists()) {
                   try {
                       InputStream is =new FileInputStream(videoFilePath);
                       int size = is.available();
                       byte[] buffer = new byte[size];
                       is.read(buffer);
                       is.close();
                       FileOutputStream fos = new FileOutputStream(file);
                       fos.write(buffer);
                       fos.close();


                       String command = "-i " + fileOrignal.getAbsolutePath()
                               + " -c:v libx264 -c:a aac -movflags faststart " + file.getAbsolutePath();

                       execFFmpegBinary(new String[]{command});
                   } catch (Exception e) {
                       Log.d(TAG, "Exception ");
                       e.printStackTrace();
                   }

       private void loadFFMpegBinary() {
       try {
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
               @Override
               public void onFailure() {
                   // TODO: 11-Apr-17 Notification and toast
               }

               @Override
               public void onSuccess() {
                   super.onSuccess();




               }
           });
       } catch (FFmpegNotSupportedException e) {
           e.printStackTrace();
       }
    }

       private void execFFmpegBinary(final String[] command) {
       try {
           ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
               @Override
               public void onFailure(String s) {
                   Log.d(TAG, "onFailure " + s);
               }

               @Override
               public void onSuccess(String s) {
                   Log.d(TAG, "onSuccess " + s);
               }

               @Override
               public void onProgress(String s) {
                   Log.d(TAG, "onProgress " + s);
               }


               @Override
               public void onStart() {
                   Log.d(TAG, "onStart ");
               }

               @Override
               public void onFinish() {
                   Log.d(TAG, "onFinish ");

               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           e.printStackTrace();
           // do nothing for now
           Log.d(TAG, "FFmpegCommandAlreadyRunningException ");
       }
    }

    its give these error

                                                                                   libavutil      55. 17.103 / 55. 17.103
                                                                                   libavcodec     57. 24.102 / 57. 24.102
                                                                                   libavformat    57. 25.100 / 57. 25.100
                                                                                   libavdevice    57.  0.101 / 57.  0.101
                                                                                   libavfilter     6. 31.100 /  6. 31.100
                                                                                   libswscale      4.  0.100 /  4.  0.100
                                                                                   libswresample   2.  0.101 /  2.  0.101
                                                                                   libpostproc    54.  0.100 / 54.  0.100
                                                                                 Unrecognized option 'i /storage/emulated/0/Movies/mvd.avi -c:v libx264 -c:a aac -movflags faststart /storage/emulated/0/Photex/photexVideo/1491909522363.mp4'.
                                                                                 **Error splitting the argument list: Option not found**

    04-11 16:18:43.158 11529-11529/com.photex.urdu.textonphotos D/UploadVideoService : onFinish

    I am unable to understand how to solve this !

  • How to create a custom processor for audio files in Ruby on Rails(5) with Paperclip

    17 juillet 2017, par Thomas Roest

    So I’m trying to convert mp3 files into .flac with Paperclip custom processors and ffmpeg. The following code runs the ffmpeg command and creates a temporary flac file. However, it is not saved ? Currently only the original file is saved. What am I missing here ?

    class AudioFile < ApplicationRecord
     has_attached_file :raw_audio, processors: [:custom], styles: { original: {}}

    the custom processor

    module Paperclip
    class Custom < Processor

     def initialize(file, options = {}, attachment = nil)
       super
       @file = file
       @basename = File.basename(@file.path)
       @format = options[:format] || 'flac'
       @params = options[:params] || '-y -i'
     end

     def make
       source = @file
       output = Tempfile.new([@basename, ".#{@format}"])
       begin
         parameters = [@params, ':source',':dest'].join(' ')
         Paperclip.run('ffmpeg', parameters, :source => File.expand_path(source.path), :dest => File.expand_path(output.path), :sample_rate => @sample_rate, :bit_rate => @bit_rate)
       end
      output
     end

    end
    end
  • Javacv : Mat data becomes null after using methods

    5 avril 2017, par rarrouba

    I’m working on an android application for object detection and counting. For the image processing I am using JavaCV (Java wrapper for OpenCV and FFmpeg). After importing the library, I’m able to successfully use the FFmpegFrameGrabber to get the frames of a video.

    My problem : After I convert the Frame to a Mat object and perform some operation on that Mat object the data becomes null.

    Code :

    MainActivity

       public class MainActivity extends AppCompatActivity {



       OpenCVFrameConverter.ToMat converterToMat = new OpenCVFrameConverter.ToMat();


       private CountModule countModule;
       FFmpegFrameGrabber retriever;

       ArrayList frames;
       boolean frameloaded = false;

       File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES);
       File video = new File(folder, "test.mp4");

       AndroidFrameConverter converterToBitmap = new AndroidFrameConverter();



       private static WebStreamer webStreamer;

       static {
           System.loadLibrary("native-lib");
       }

       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);


           final Button button = (Button) findViewById(R.id.btnLdFrames);
           final ImageView img = (ImageView) findViewById(R.id.imageView);


           button.setOnClickListener(new View.OnClickListener() {
               public void onClick(View v) {
                   ((TextView) button).setText("Loading");
                   new Thread(new Runnable() {
                       public void run() {

                           try {
                               button.setClickable(false);
                               button.setAlpha((float) 0.3);
                               LoadFrames();
                               button.setAlpha((float) 1);

                           } catch (FrameGrabber.Exception e) {
                               e.printStackTrace();
                           }
                       }
                   }).start();

               }
           });
       }
       private void LoadFrames() throws FrameGrabber.Exception {
           if (!frameloaded){



               frameloaded = true;

               retriever = new FFmpegFrameGrabber(video);
               frames = new ArrayList<>();
               Log.d("Frame",": Start of loop");

               retriever.start();
               final ImageView img = (ImageView) findViewById(R.id.imageView);
               for (int i=0;i<50;i++){//155430
                   retriever.setFrameNumber(i*100);
                   Frame temp = new Frame();
                   temp = retriever.grab();

                   frames.add(converterToMat.convert(temp));

                   Log.d("Frame",": " + i*100);



               }
               retriever.stop();

               countModule = new CountModule(frames);
               Log.d("Frame","CountModule instantiated");

           }
       }
    }

    Constructor of Countmodule

    public CountModule(ArrayList<mat> frames){

       fgGBG = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());
       gbg = createBackgroundSubtractorMOG2();
       Mat maTemp = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());

       median = new Mat(frames.get(0).rows(),frames.get(0).cols(),frames.get(0).type());
       frames.get(0).copyTo(median);
       ;
       median = getMedian(frames);
       kernel2 = Mat.ones(11,11,CV_8U).asMat();
       kernel = Mat.ones(3,1,CV_8U).asMat();
       gbg.apply(median,fgGBG,0.001);

    }
    </mat>

    Variables (images) :

    After convert from Frame to Mat. Data has values.

    Data=null when using the method frame.copyTo(median). Data of Mat also null when using method Mat.ones()


    As you can see everytime I use a OpenCV specific method, the returned Mat is not what is expected.