Recherche avancée

Médias (0)

Mot : - Tags -/gis

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (59)

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

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

  • 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

Sur d’autres sites (10720)

  • android : How to Reverse and slow motion video ?

    18 février 2016, par Ravi VGHL

    I have try to make video in Reverse and slow motion and that for i have use to FFmpeg But i am not getting proper result from FFmpeg. now i am using this library that use to FFmpeg and gradle in compile to compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5' library. But there is one more problem when i execute any command that time i got error Working Directory: null Environment: null i have to declare permission in manifest file and code execute time also check file exist or not. kindly check my code and how to fix it ? please share your some helpful suggestions. Thanks in advance.

    MyCode

    if (videoFile.exists()) {
       String vidInput = videoFile.getAbsolutePath();
       String cmd = "-i " + vidInput + " -map_metadata:s:a 0:g " + vidoutpath;

       FFmpeg fFmpeg = FFmpeg.getInstance(getApplicationContext());
       fFmpeg.execute(cmd, new FFmpegExecuteResponseHandler() {

           @Override
           public void onSuccess(String message) {
               Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_SHORT).show();
           }

           @Override
           public void onProgress(String message) {
           }

           @Override
           public void onFailure(String message) {
               Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
           }

           @Override
           public void onStart() {
           }

           @Override
           public void onFinish() {
           }
       });
    }

    Above code in when i pass only -version command that time also get same problem.

    Manifest File in uses Permission

    LogCat Error

    Exception while trying to run: /data/data/com.videotest/files/ffmpeg -i /storage/emulated/0/frameCount.mp4 -map_metadata:s:a 0:g /storage/emulated/0/frameCountRev.mp4
    java.io.IOException: Error running exec(). Command: [/data/data/com.videotest/files/ffmpeg, -i, /storage/emulated/0/frameCount.mp4, -map_metadata:s:a, 0:g, /storage/emulated/0/frameCountRev.mp4] Working Directory: null Environment: null
       at java.lang.ProcessManager.exec(ProcessManager.java:211)
       at java.lang.Runtime.exec(Runtime.java:173)
       at java.lang.Runtime.exec(Runtime.java:246)
       at java.lang.Runtime.exec(Runtime.java:189)
       at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)
       at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
       at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
       at android.os.AsyncTask$2.call(AsyncTask.java:288)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)
       Caused by: java.io.IOException: No such file or directory at java.lang.ProcessManager.exec(Native Method)
       at java.lang.ProcessManager.exec(ProcessManager.java:209)
  • Android FFMpeg guardian project IOException : Permission Denied

    30 décembre 2016, par sector11

    I have cloned compiled ffmpeg binary from here https://github.com/guardianproject/android-ffmpeg and using in android project reference from here https://github.com/guardianproject/android-ffmpeg-java

    But i am not able to get -version command output as it is saying Caused by: java.io.IOException: Permission denied

    Error Logs as follow :

    Permission changed now
    12-30 02:30:20.083 3765-3765/in.ashish29agre.ffmpeg I/System.out: Permission changed now
    12-30 02:30:20.083 3765-3765/in.ashish29agre.ffmpeg I/System.out: Binary path: /data/data/in.ashish29agre.ffmpeg/app_bin/ffmpeg
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg I/TestActivity: Progress: -version
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: java.io.IOException: Error running exec(). Command: [-version] Working Directory: /data/data/in.ashish29agre.ffmpeg/app_bin Environment: [ANDROID_ROOT=/system, LOOP_MOUNTPOINT=/mnt/obb, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/sdcard, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar, ANDROID_PROPERTY_WORKSPACE=8,0, ANDROID_STORAGE=/storage]
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.ProcessManager.exec(ProcessManager.java:211)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at org.ffmpeg.android.FfmpegController.execProcess(FfmpegController.java:137)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:101)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:111)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at in.ashish29agre.ffmpeg.TestActivity.onResume(TestActivity.java:37)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.Activity.performResume(Activity.java:5310)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread.access$800(ActivityThread.java:135)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.os.Looper.loop(Looper.java:136)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5017)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.reflect.Method.invoke(Method.java:515)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at dalvik.system.NativeStart.main(Native Method)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err: Caused by: java.io.IOException: Permission denied
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.ProcessManager.exec(Native Method)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:     at java.lang.ProcessManager.exec(ProcessManager.java:209)
    12-30 02:30:20.093 3765-3765/in.ashish29agre.ffmpeg W/System.err:   ... 20 more

    My Activity code is as follows :

    @Override
       protected void onResume() {
           super.onResume();
           File fileTmp = getCacheDir();
           File fileAppRoot = new File(getApplicationInfo().dataDir);
           List<string> commands = new ArrayList&lt;>();
           commands.add("-version");
           try {
               FfmpegController ffmpegController = new FfmpegController(this, fileAppRoot);
               ffmpegController.installBinaries(this, true);
               System.out.println("Binary path: " + ffmpegController.getBinaryPath());

               ffmpegController.execFFMPEG(commands, new ShellUtils.ShellCallback() {
                   @Override
                   public void shellOut(String shellLine) {
                       logger.info("Progress: " + shellLine);

                   }

                   @Override
                   public void processComplete(int exitValue) {
                       logger.info("Process complete");
                   }
               });
           } catch (IOException e) {
               e.printStackTrace();
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
    </string>

    Just to make sure that i added permission of reading and writing external storage in manifest here is AndroidManifest.xml

    &lt;?xml version="1.0" encoding="utf-8"?>
    <manifest package="in.test.ffmpeg">

       
       

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

                   <category></category>
               
           </activity>
       </application>

    </manifest>
  • How to decrease the latency of the RTP streaming with ffmpeg in Android ?

    24 août 2018, par Douglas Lima Dantas

    I’m creating a App that do a RTP streaming. It uses a ParcelFileDescriptor pipe pair, where a MediaRecorder writes in the pipe while the ffmpeg receives the audio from the pipe and sends by RTP.

    In my desktop, using the same wifi router, I receive the RTP stream using ffplay, and it has a delay between 5s 10s.

    I tried capture audio using ffmpeg in Android, but itsn’t possible. I tried to use ffplay -fflags nobuffer, use MIC as source, change the encoder, etc.

    I need the lowest delay possible. How can I do it ?

    The code :

    public class MainActivity extends AppCompatActivity implements View.OnClickListener {
       MediaRecorder mediaRecorder;
       AudioRecord record;
       MediaPlayer mediaPlayer;
       ParcelFileDescriptor[] pipePair;
       ParcelFileDescriptor pipeRead;
       ParcelFileDescriptor pipeWrite;
       Process ffmpegProc;
       // Requesting permission to RECORD_AUDIO
       private boolean permissionsAccepted = false;
       private String [] permissions = {
               Manifest.permission.RECORD_AUDIO,
               Manifest.permission.INTERNET,
               Manifest.permission.ACCESS_NETWORK_STATE
       };
       private static final int REQUEST_PERMISSIONS = 200;

       @Override
       public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
           super.onRequestPermissionsResult(requestCode, permissions, grantResults);
           switch (requestCode){
               case REQUEST_PERMISSIONS:
                   permissionsAccepted  = grantResults[0] == PackageManager.PERMISSION_GRANTED;
                   break;
           }
           if (!permissionsAccepted ) finish();

       }

       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
           ActivityCompat.requestPermissions(this, permissions, REQUEST_PERMISSIONS);

           TextView hello = (TextView) findViewById(R.id.hello);
           hello.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View view) {
                   Toast.makeText(MainActivity.this, "Clicado",Toast.LENGTH_SHORT)
                           .show();
                   copiarFFMpeg();

               }
           });

       }

       private void executarFFMpeg(final String[] cmd, ParcelFileDescriptor read) {

           try {
               ffmpegProc = Runtime.getRuntime().exec(cmd);
           } catch (IOException e) {
               e.printStackTrace();
           }

           (new Thread(new Runnable() {
               @Override
               public void run() {
                   try {
                       InputStream inStream = ffmpegProc.getInputStream();
                       InputStreamReader sReader = new InputStreamReader(inStream);
                       BufferedReader bufferedReader = new BufferedReader(sReader);
                       String line;
                       while ((line = bufferedReader.readLine()) != null) {
                           Log.d("FFMPEG",line);
                       }
                   } catch (IOException e) {
                       e.printStackTrace();
                   }
               }
           })).start();

           (new Thread(new Runnable() {
               @Override
               public void run() {
                   byte[] buffer = new byte[8192];
                   int read = 0;

                   OutputStream ffmpegInput = ffmpegProc.getOutputStream();
                   FileInputStream reader = new FileInputStream(pipeRead.getFileDescriptor());

                   try {

                       while (true) {

                           if (reader.available()>0) {
                               read = reader.read(buffer);
                               ffmpegInput.write(buffer, 0, read);
                               ffmpegInput.flush();
                           } else {
                               Thread.sleep(10);
                           }

                       }

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

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

                       onDestroy();
                   }
               }
           })).start();

           Log.d("FFMPEG","Executado");
       }

       private boolean estaExecutando(Process ffmpegProc) {
           if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
               return ffmpegProc.isAlive();
           } else {
               try {
                   ffmpegProc.exitValue();
                   return false;
               } catch (Exception e) {
                   return true;
               }
           }
       }

       private void criarMediaRecorder() {
           if (pipeWrite != null) {
               try {
                   //ffplay.exe -protocol_whitelist rtp,file,udp ..\file.sdp
                   mediaRecorder = new MediaRecorder();
                   mediaRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION);
                   mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS);
                   mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
                   //mediaRecorder.setAudioChannels(2);
                   mediaRecorder.setOutputFile(pipeWrite.getFileDescriptor());
                   mediaRecorder.prepare();
                   mediaRecorder.start();
                   Log.d("MREC","MediaRecorder criado");
               } catch (Exception e) {
                   e.printStackTrace();
               }
           }
       }

       private void criarPipe() {
           try {
               pipePair =ParcelFileDescriptor.createPipe();
           } catch (IOException e) {
               Log.e("PIPE","Deu zica na criação do pipe");
               e.printStackTrace();
               finish();
           }
           pipeRead = new ParcelFileDescriptor(pipePair[0]);
           pipeWrite  = new ParcelFileDescriptor(pipePair[1]);
       }

       private void copiarFFMpeg() {
           FFmpeg ffmpeg = FFmpeg.getInstance(this);
           try {
               ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

                   @Override
                   public void onStart() {
                       Log.d("FFMPEG","Iniciar cópia");
                   }

                   @Override
                   public void onFailure() {
                       Log.e("FFMPEG","Cópia falhou");
                   }

                   @Override
                   public void onSuccess() {
                       Log.d("FFMPEG","Cópiado com sucesso");

                       criarPipe();
                       //mediaRecorder.start();
                       File ffmpegBin = new File(getFilesDir().getAbsolutePath()+"/ffmpeg");
                       String[] cmd = new String[] {
                               ffmpegBin.getAbsolutePath(),
                               "-re",
                               "-thread_queue_size","4",
                               "-i","pipe:",
                               //"-c:a","libx264",
                               //"-preset","veryfast",
                               //"-tune","zerolatency",
                               "-f",
                               "rtp",
                               "rtp://192.168.0.33:1234"
                       };

                       executarFFMpeg(cmd, pipeRead);

                       criarMediaRecorder();
                   }

                   @Override
                   public void onFinish() {
                   }
               });
           } catch (FFmpegNotSupportedException e) {
               // Handle if FFmpeg is not supported by device
               Log.e("FFMPEG", "Não sou suportado :/");
           }
       }

       @Override
       protected void onDestroy() {
           super.onDestroy();
       }

       @Override
       public void onClick(View view) {

       }
    }

    The command :

    ffplay rtp://192.168.0.33:1234

    ffplay -fflags nobuffer rtp://192.168.0.33:1234