Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (80)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (7144)

  • Android Studio FFMPEG "Protocol not found"

    26 novembre 2022, par Whitestripe7773

    I am trying to run ffmpeg with android studio, but when I try the following code it shows this error message :

    


    E/mobile-ffmpeg : content ://media/external/video/media/68 : Protocol not found
E/mobile-ffmpeg : Did you mean file:content ://media/external/video/media/68 ?

    


    This is my code :

    


    inputVideo = "content://media/external/video/media/68"
videoTitle = "abc"
public void method(String inputVideo, String videoTitle) {
        String cmdLine = "-i " + inputVideo + " -vcodec libx265 -crf 28 file:" + videoTitle;
        FFmpeg.execute(cmdLine);
    }


    


    I think that the 'content :' in inputVideo leads to the error but I don't know how I could fix it.
Already tried out the following :

    


      

    • Add 'file :' in front of inputVideo and videoTitle
    • 


    • Removing 'content ://' from the string leads to not finding the file
    • 


    


  • java.lang.NoClassDefFoundError Android Studio Unity

    26 juin 2017, 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.

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