Recherche avancée

Médias (91)

Autres articles (42)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • 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 (6990)

  • How to watermark on video in android using ffmpeglibrary programmatically

    2 mai 2016, par Sakibmohammad Syed

    I want to watermark one video file using ffmpeg library. I have one png, one mp4 file in my Videokit folder and I want to watermark png image to video file and below is my code but I don’t know why I am unable to watermark on it. I have no more idea about implementation of ffmpeg library so please help me to solve such issue.
    Here is my MainActivity.

       public class MainActivity extends AppCompatActivity {
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);

           String workFolder = "/sdcard/Videokit/";

           GeneralUtils.deleteFileUtil(workFolder + "/vk.log");

           PowerManager powerManager = (PowerManager) this.getSystemService(Activity.POWER_SERVICE);
           PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
           wakeLock.acquire();
           String commandStr = "ffmpeg -i /sdcard/Videokit/test.mp4 -i /sdcard/Videokit/test.png -filter_complex transpose=1,overlay=10:10 -y /sdcard/out.mp4";

           LoadJNI vk = new LoadJNI();
           try {
               vk.run(GeneralUtils.utilConvertToComplex(commandStr), workFolder, MainActivity.this);
               GeneralUtils.copyFileToFolder(commandStr, workFolder);
           } catch (CommandValidationException e) {
               Log.e("Prefs.TAG", "vk run exeption.", e);
           }
       }
    }

    Here is my Manifest.xml

           <?xml version="1.0" encoding="utf-8"?>
    <manifest package="com.example.android.compressexample">

       
       
       
       
       

       <application>
           <activity>
               
                   <action></action>

                   <category></category>
               
           </activity>
       </application>
    </manifest>
  • java.lang.NoClassDefFoundError Android Studio Unity

    28 avril 2016, par Nestoraj

    I’m having some troubles when I try to generate a library that contains another one in Android Studio. First of all I am using Android Studio 2.0 and Unity 5.3.4f1. What I want to do is integrate FFMpeg in Unity so I decided to create my own library that use FFMpeg library as an intermediary. The FFMpeg library is here.

    To start I created a new empty project in Android Studio and inside of it, created a new module, which will be my library, using New->Module->Android Library and named it "ffmpegcodec". After that I opened build.gradle file inside the new module folder and paste :

    compile 'com.writingminds:FFmpegAndroid:0.3.2'

    inside dependencies brackets, and click Sync (It did not show any error).

    After that create a new Java Class inside src/main/java/package-name/ and named it FFMpegCodec. Inside this paste this code :

    public class FFMpegCodec {
    private static FFmpeg ffmpeg;
    private static Context context;
    private static FFMpegCodec INSTANCE = null;

    public FFMpegCodec(){
       INSTANCE = this;
    }

    public static FFMpegCodec instance(){
       if(INSTANCE == null){
           INSTANCE = new FFMpegCodec();
       }
       return INSTANCE;
    }

    public void setContext(Context ctx){
       this.context = ctx;
    }

    public void loadFFMpegBinary() {
       try {
           if (ffmpeg == null) {

               ffmpeg = FFmpeg.getInstance(context);
           }
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
               @Override
               public void onFailure() {
                   Log.e("FFMPEG", "ffmpeg : NOT correct Loaded");
               }

               @Override
               public void onSuccess() {
                   Log.e("FFMPEG", "ffmpeg : correct Loaded");
               }
           });
       } catch (FFmpegNotSupportedException e) {

       } catch (Exception e) {

       }
    }

    public void execFFmpegCommand(final String[] command) {
       try {
           ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
               @Override
               public void onFailure(String s) {
                   Log.e("FFMPEG", "FAILED with output : " + s);
               }

               @Override
               public void onSuccess(String s) {
                   Log.e("FFMPEG", "SUCCESS with output : " + s);
               }

               @Override
               public void onProgress(String s) {
                   Log.e("FFMPEG", "Started command : ffmpeg " + command);
                   Log.e("FFMPEG", "progress : " + s);
               }

               @Override
               public void onStart() {
                   Log.e("FFMPEG", "Started command : ffmpeg " + command);

               }

               @Override
               public void onFinish() {
                   Log.e("FFMPEG", "Finished command : ffmpeg " + command);

               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           // do nothing for now
       }
    }

    It basically generates an instance of FFmpeg and makes calls of ffmpeg commands.

    Once I have my lib done I decided to test it in my project so I include my lib in my app graddle using :

    compile project(':ffmpegcodec')

    After that I just paste this code to my MainActivity :

    public class MainActivity extends AppCompatActivity {

    FFMpegCodec ffmpeg;

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

       Button execCommandButton = (Button) findViewById(R.id.execCommandButton);

       ffmpeg = FFMpegCodec.instance();


       execCommandButton.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               Toast.makeText(getApplicationContext(), "This is a Toast!!", Toast.LENGTH_SHORT).show();
               ffmpeg.setContext(MainActivity.this);
               ffmpeg.loadFFMpegBinary();
               String []cmd = new String[1];
               cmd[0] = "-version";
               ffmpeg.execFFmpegCommand(cmd);
           }
       });

    }

    After that, I run my project and when I press the button it returns that everythings its ok, showing ffmpeg version.
    Once I have check that my lib works I decide to move it to Unity so copy the ffmpegcodec-realese.arr file inside ffmpegcodec/build/outputs/aar folder and paste it into my Unity project. Then I wrote an C# script to use my lib that contains this :

       using System;
       using System.Runtime.InteropServices;
       using UnityEngine;
       using System.Collections;
       using System.Diagnostics;

       public class ScreenRecorder {

       private AndroidJavaObject unityActivity = null;
       private AndroidJavaObject captureObject = null;

           // Use this for initialization
           public ScreenRecorder () {
               try{

                   using (AndroidJavaClass unityPlayerActivityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
                       unityActivity = unityPlayerActivityClass.GetStatic<androidjavaobject>("currentActivity");
                   }

                   AndroidJavaClass captureClass = new AndroidJavaClass ("com.promineostudios.ffmpegcodec.FFMpegCodec");
                   if (captureClass != null) {
                       captureObject = captureClass.CallStatic<androidjavaobject>("instance");
                       captureObject.Call("setContext", unityActivity);
                       captureObject.Call("loadFFMpegBinary");
                   }
               }catch(Exception ex){
                   UnityEngine.Debug.Log(ex);
               }
           }

       }
    </androidjavaobject></androidjavaobject>

    The problems comes here. When I create a class instance using :

    AndroidJavaClass captureClass = new AndroidJavaClass ("com.promineostudios.ffmpegcodec.FFMpegCodec");

    It creates an instance correctly, and also when I create an object using :

    captureObject = captureClass.CallStatic<androidjavaobject>("instance");
    </androidjavaobject>

    But when I try to get access to FFMpeg library methods like in "setContext" it fails and returns this :

    UnityEngine.AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/github/hiteshsondhi88/libffmpeg/FFmpeg;
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/github/hiteshsondhi88/libffmpeg/FFmpeg;
     at com.promineostudios.ffmpegcodec.FFMpegCodec.loadFFMpegBinary(FFMpegAndroidCodec.java:39)
     at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
     at com.unity3d.player.UnityPlayer.a(Unknown Source)
     at com.unity3d.player.UnityPlayer$b.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.hiteshsondhi88.libffmpeg.FFmpeg" on path: DexPathList[[zip file "/data/app/com.promineostudios.ffmpegmodule-1/base.apk"],nativeLibraryDirectories=[/data/app/com.promineostudios.ffmpegmodule-1/lib/arm, /vendor/lib, /system/lib]]
     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
     at com.promineostudios.ffmpegcodec.FFMpegCodec.loadFFMpegBinary(FFMpegAndroidCodec.java:39) 
     at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 
     at com.unity3d.player.UnityPlayer.a(Unknown Source) 
     at com.unity3d.player.UnityPlayer$b.run(Unknown Source)

    I think that the problem is in when I export my lib into Unity but I do not know what is going wrong. If anybody could help me I will be really appreciated.

    Thanks and excuse me for my English.

  • Android watermark : Fatal signal 4 (SIGILL), code 2, fault addr 0xe2166842 in tid 13693 (atermarkvideo_2

    27 avril 2016, par Sakibmohammad Syed

    I am using ffmpeg library for watermark on video and below is my code but when I run program the it show error like Fatal signal 4 (SIGILL), code 2, fault addr 0xe2166842
    here is my code.

       public class MainActivity extends Activity {
       private String strAudioFolderPath;
       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);

           strAudioFolderPath = "/sdcard/Download";
           String s = "ffmpeg -i /sdcard/Download/testing.mp4 -i /sdcard/test.png -filter_complex 'overlay=10:main_h-overlay_h-10' /sdcard/Download/out.mp4";

           GeneralUtils.deleteFileUtil(strAudioFolderPath + "vk.log");

           PowerManager powerManager = (PowerManager) this.getSystemService(Activity.POWER_SERVICE);
           PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
           wakeLock.acquire();
           LoadJNI vk = new LoadJNI();
           try {
               try {
                   vk.run(GeneralUtils.utilConvertToComplex(s), strAudioFolderPath, MainActivity.this);
                   Log.e("Checking water marker", ">>>>>>>>>>>>>>>");

               } catch (Throwable e) {
               } finally {
                   if (wakeLock.isHeld())
                       wakeLock.release();
                   else {
                   }
               }
           } catch (Exception e)
           {
               e.printStackTrace();
           }
       }

    Actually I want to add watermark on video file using ffmpeg library but it show error as I mention above so I am unable to watermak on video. I have also seach a lot to solve this issue but I did not find any proper solution of this problem.