Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (46)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (9981)

  • 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
  • Flumotion Wins Streaming Media Europe Awards for WebM Streaming

    20 octobre 2010, par noreply@blogger.com (John Luther)

    Congratulations to our friends at Flumotion ! They picked up two Reader’s Choice Awards at the Streaming Media Europe 2010 conference in London. The company took prizes for Best Live Webcast of 2010 (for their streaming of GUADEC 2010 in WebM), and Best Webcast Platform. In addition, the Flumotion WebM Live Streaming solution was nominated for Best Streaming Innovation of 2010.

    You can read more about the awards at the Streaming Media web site.

  • Flumotion Wins Streaming Media Europe Awards for WebM Streaming

    20 octobre 2010, par noreply@blogger.com (John Luther)

    Congratulations to our friends at Flumotion ! They picked up two Reader’s Choice Awards at the Streaming Media Europe 2010 conference in London. The company took prizes for Best Live Webcast of 2010 (for their streaming of GUADEC 2010 in WebM), and Best Webcast Platform. In addition, the Flumotion WebM Live Streaming solution was nominated for Best Streaming Innovation of 2010.

    You can read more about the awards in the Streaming Media announcement.