Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (99)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

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

Sur d’autres sites (10134)

  • Stream mp3 url using FFmpegmediaplayer library

    26 janvier 2018, par ali

    i’m trying to migrate from MediaPlayer to FFmpegmediaplayer for streaming radio my code below works fine with MediaPlayer but when i change it to FFmpegmediaplayer doesn’t work at all i tried to change URL from mp3 to ogg and still doesn’t work .

      FFmpegMediaPlayer mediaPlayer;
       boolean prepared = false;
       boolean started = false;
       PlayerTask playerTask;

    protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
           mediaPlayer = new FFmpegMediaPlayer();
           playerTask = new PlayerTask();
           playerTask.execute("URL_STREAM");
       /**/

    }

    @SuppressLint("StaticFieldLeak")
       public class PlayerTask extends AsyncTask {
           ProgressBar loadingRL = findViewById(R.id.progressBar);

           @Override
           protected void onPreExecute() {
               super.onPreExecute();
               mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
               loadingRL.setVisibility(View.VISIBLE);
               beforradio.start();
           }

           @Override
           protected Boolean doInBackground(String... strings) {
               try {
                   mediaPlayer.setDataSource(strings[0]);
                   mediaPlayer.prepare();
                   prepared = true;
               } catch (IOException e) {
                   e.printStackTrace();
               } catch (IllegalArgumentException e) {
                   e.printStackTrace();
               } catch (IllegalStateException e) {
                   e.printStackTrace();
               }
               mediaPlayer.setOnPreparedListener(new FFmpegMediaPlayer.OnPreparedListener() {
                   @Override
                   public void onPrepared(FFmpegMediaPlayer mp) {
      mediaPlayer.start();
                   }
               });
               return prepared;
           }

           @Override
           protected void onPostExecute(Boolean aBoolean) {
               super.onPostExecute(aBoolean);
               loadingRL.setVisibility(View.GONE);
           }

       }
  • FFmpeg audio video merge issue in Android

    20 octobre 2017, par djac

    Below code is to merge audio and video file in Android. Both input files are in raw folder in app and both will be stored to
    sd card in Oncreate funtion and will be merged.

    Here the issue is the code is executing, but the video input file is written into audio input folder and the output merge file result.mp4 is faulty.
    Could you please help to find out the issue in code/ command ?

    public class Mrge  extends AppCompatActivity {


       Uri vuri=null;
       public String vabsolutePath=null,  aabsolutePath=null, dabsolutePath=null;


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

           OutputStream out;

           try {
               ByteArrayOutputStream stream = new ByteArrayOutputStream();
               InputStream ins = getResources().openRawResource(
                       getResources().getIdentifier("angry",
                               "raw", getPackageName()));


               byte[] buf = new byte[1024];
               int n;
               while (-1 != (n = ins.read(buf)))
                   stream.write(buf, 0, n);

               byte[] bytes = stream.toByteArray();

               String root = Environment.getExternalStorageDirectory().getAbsolutePath() + "/";
               File createDir = new File(root + "master" + File.separator);

               createDir.mkdir();


               File file = new File(root + "master" + File.separator + "master.mp4");


               file.createNewFile();
               out = new FileOutputStream(file);
               out.write(bytes);
               out.close();



               vabsolutePath = file.getAbsolutePath();

               //-------------------------------------------------------------------

               ins = getResources().openRawResource(
                       getResources().getIdentifier("audio",
                               "raw", getPackageName()));

               while (-1 != (n = ins.read(buf)))
                   stream.write(buf, 0, n);

               bytes = stream.toByteArray();


               root = Environment.getExternalStorageDirectory().getAbsolutePath() + "/";
               createDir = new File(root + "audio" + File.separator);
               createDir.mkdir();


               file = new File(root + "audio" + File.separator + "audio.aac");

               file.createNewFile();
               out = new FileOutputStream(file);
               out.write(bytes);
               out.close();

               aabsolutePath = file.getAbsolutePath();

               root = Environment.getExternalStorageDirectory().getAbsolutePath() + "/";
               createDir = new File(root + "result" + File.separator);
               createDir.mkdir();


               file = new File(root + "result" + File.separator + "result.mp4");

               file.createNewFile();

               dabsolutePath = file.getAbsolutePath();


               //------------------------------------------------------------------------






           } catch (IOException e) {
               e.printStackTrace();
           }
           String ccommand[] = {"-y", "-i",vabsolutePath,"-i",aabsolutePath, "-c:v", "copy", "-c:a", "aac","-shortest", dabsolutePath};

           loadFFMpegBinary();
           execFFmpegBinary(ccommand);

       }






           FFmpeg ffmpeg;
           private void loadFFMpegBinary() {
               try {
                   if (ffmpeg == null) {

                       ffmpeg = FFmpeg.getInstance(this);
                   }
                   ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
                       @Override
                       public void onFailure() {
                           //showUnsupportedExceptionDialog();
                       }

                       @Override
                       public void onSuccess() {

                       }
                   });
               } catch (FFmpegNotSupportedException e) {
                   //showUnsupportedExceptionDialog();
               } catch (Exception e) {

               }
           }




       private void execFFmpegBinary(final String[] command) {
           try {
               ffmpeg.execute(command, new ExecuteBinaryResponseHandler()
               {
                   @Override
                   public void onFailure(String s) {

                   }

                   @Override
                   public void onSuccess(String s) {


                   }


               @Override
               public void onProgress(String s) {

               }

               @Override
               public void onStart() {

               }

               @Override
               public void onFinish() {


               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {

               String m="hi";

       }




    }










    }
  • How can I capture low resolution video on Android reliably across a range of devices ?

    8 décembre 2017, par MisterMat

    Hello Android video experts :)

    I am developing an Android application which allows the user to capture video and upload it to a remote server (it’s more involved than that but the rest of the app is not important). Because of the upload requirement, it is important that the video is of a reasonable size, so not super high resolution. Let’s say a max of 680x480 or 10Mb/minute. This is no problem on Apple devices.

    I have had what can only be described as a complete nightmare trying to capture video at a reasonably low bitrate reliably across a range of Android devices.

    As I understand it there are two ways of capturing video on Android :

    1) Using the Media Recorder/Camera API

    2) Using an Intent to open the cameras video capture application

    Option 1) gives the most flexibility and allows us to easily change the capture resolution. However the Android Camera API is NOT reliable across a range of devices, and I have very good information (including from someone who liaised with Google on this issue) that if you capture video using this API then it will crash on a good 50% of the devices out there. There is a reason that Zoom Camera FX uses an Intent for video capture. Zoom Camera (different app) seems to use Media Recorder, but has lots of bad reviews for video crashing or not working.

    Option 2) works well across a range of devices, as it uses the in built application on the device. The trouble is you have no control whatsoever on the resolution, there is a quality hint on the Intent but the camera app will normally ignore this. My Samsung Galaxy S3 records video by default at about 2Mb/s. This is way too high resolution. The built in application can of course change the resolution, but this relies on action by the user which is difficult to control.

    I understand that I could use a library such as ffmpeg to change the resolution of the video after capture. However this requires me to compile the library for Android, and also I have been informed that in order to legally use the decode/encode codecs on the device you have to pay license fees that amount to about $1 per copy of the app. Since this app will be free to use, this is not an option.

    So that’s where I’m at. I’ve searched long and high for answers, but I can’t figure out how to capture low resolution video reliably using Android.

    Any help very much appreciated !

    Matthew