Recherche avancée

Médias (0)

Mot : - Tags -/alertes

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

Autres articles (53)

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (10003)

  • FFmpeg Video Streaming on android app

    18 avril 2017, par Johnny Roger

    I’m trying to do a streaming of my laptop webcam to my android smartphone.
    So I set an ffserver in this way

    HTTPPort 1234
    RTSPPort 1235

    <feed>
           File /tmp/feed2.ffm
           FileMaxSize 2M
           ACL allow 127.0.0.1
    </feed>

    <stream>
       Feed feed2.ffm
       Format rtp
       Noaudio
       VideoCodec libx264
       AVOptionVideo flags +global_header
       AVOptionVideo me_range 16
       AVOptionVideo qdiff 4
       AVOptionVideo qmin 10
       AVOptionVideo qmax 51
       ACL allow 192.168.0.0 192.168.255.255
    </stream>

    and I used the following ffmpeg instruction

    ffmpeg -i /dev/video0 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed2.ffm

    in my android studio project i set in the manifest file

    That is my MainActivity.java

    package com.example.johnny.ffmpeg;

    import android.app.ProgressDialog;
    import android.content.Context;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.app.Activity;
    import android.support.v7.app.AppCompatActivity;
    import android.util.Log;
    import android.view.SurfaceView;
    import android.view.View;
    import android.net.Uri;
    import android.widget.Button;
    import android.widget.ImageButton;
    import android.widget.ImageView;
    import android.widget.MediaController;
    import android.widget.Toast;
    import android.widget.VideoView;


    public class MainActivity extends AppCompatActivity implements VideoView.OnClickListener
    {

       ProgressDialog mDialog;
       VideoView videoView;
       ImageView btnPlayPause;
       MediaController mediaController;

       String videoURL ="rtsp://192.168.1.100:1235/test1.sdp";


       @Override
       protected void onCreate(Bundle savedInstanceState)
       {
           super.onCreate(savedInstanceState);


           setContentView(R.layout.activity_main);

           videoView =(VideoView)findViewById(R.id.videoView);
           mediaController= new MediaController(this);
           mediaController.setAnchorView(videoView);
           btnPlayPause = (ImageButton)findViewById(R.id.btn_play_pause);
           btnPlayPause.setOnClickListener(this);

       }

       @Override
       public void onClick(View v) {
           mDialog = new ProgressDialog(MainActivity.this);
           mDialog.setMessage("Please wait...");
           mDialog.setCanceledOnTouchOutside(false);
           mDialog.show();

           Uri uri = Uri.parse(videoURL);
           videoView.setVideoURI(uri);

           try{
               if(!videoView.isPlaying()) {


                   videoView.setMediaController(mediaController);
                   videoView.requestFocus();

                   videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                       @Override
                       public void onCompletion(MediaPlayer mp) {
                           btnPlayPause.setImageResource(R.drawable.ic_aplay);
                       }
                   });
               }
               else
               {
                   videoView.pause();
                   btnPlayPause.setImageResource(R.drawable.ic_pause);
               }
           }
           catch(Exception ex)
           {

               Context context = getApplicationContext();
               String text = ex.toString();
               int duration = Toast.LENGTH_SHORT;

               Toast toast = Toast.makeText(context, text, duration);
               toast.show();
           }

           videoView.requestFocus();
           videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener(){
               @Override
               public void onPrepared(MediaPlayer mp){
                   mDialog.dismiss();
                   mp.setLooping(true);



                   videoView.start();
                   btnPlayPause.setImageResource(R.drawable.ic_pause);
               }
           });

           videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {

               @Override
               public boolean onError(MediaPlayer mp, int what, int extra) {
                   Log.d("video", "setOnErrorListener ");
                   return true;
               }
           });

       }
    }

    and that is the relative activity_main.xml file :

    <relativelayout>

        <videoview></videoview>

       

       <textview></textview>

       <textview></textview>

    </relativelayout>

    I tested the streaming on vlc and it work well (even if with dealy, it’s not in real time).
    The app instead give me the message "can’t play this video" and the following error :

    V/MediaPlayer: message received msg=100, ext1=1, ext2=-38
    E/MediaPlayer: Error (1,-38)
    D/VideoView: Error: 1,-38
    D/video: setOnErrorListener
    E/MediaPlayer: error (1, -38)
    V/MediaPlayer: callback application
    V/MediaPlayer: back from callback
    E/MediaPlayer: Error (1,-38)
    D/VideoView: Error: 1,-38
    D/video: setOnErrorListener

    E/ViewRootImpl: sendUserActionEvent() mView == null

    I saw that the problem could be the format of the video, but i tried also with an mp4 file

    ffmpeg -i test.mp4 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed2.ffm

    and the result was the same. How Can I fix it and let my app work well ?

  • ffmpeg command not working with white space of directory path in Android

    13 avril 2017, par Sakib Syed

    I am working with FFMPEG library in which I want to rotate video using this library which works fine if I am file path has no any white space. But in my case I have white space of video directory (you can see full path in String commandStr onPreExecute() method of asynctask) path then it is not working at all. I have also seen same question like this and some more but not get any idea how to resolved it properly. Below is my code of MainActivity.class

       public class MainActivity extends AppCompatActivity implements View.OnClickListener{

       String workFolder = null;
       String demoVideoFolder = null;
       String vkLogPath = null;
       private boolean commandValidationFailedFlag = false;

       private Button btnRun;


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

           GeneralUtils.checkForPermissionsMAndAbove(MainActivity.this, true);


           setIds();
           setListner();


           demoVideoFolder = Environment.getExternalStorageDirectory().getAbsolutePath() + "/videokit/";

           Log.i(Prefs.TAG, getString(R.string.app_name) + " version: " + GeneralUtils.getVersionName(getApplicationContext()) );
           workFolder = getApplicationContext().getFilesDir().getAbsolutePath() + "/";
           vkLogPath = workFolder + "vk.log";

           GeneralUtils.copyLicenseFromAssetsToSDIfNeeded(this, workFolder);
           GeneralUtils.copyDemoVideoFromAssetsToSDIfNeeded(this, demoVideoFolder);


           int rc = GeneralUtils.isLicenseValid(getApplicationContext(), workFolder);
           Log.i(Prefs.TAG, "License check RC: " + rc);
       }

       private void setListner() {
           btnRun.setOnClickListener(this);
       }

       private void setIds() {
           try {
               btnRun =  (Button)findViewById(R.id.btnRun);
           } catch (Exception e) {
               e.printStackTrace();
           }
       }

       @Override
       public void onClick(View view) {
           switch (view.getId()){
               case R.id.btnRun:

                   Log.i(Prefs.TAG, "run clicked.");
                   if (GeneralUtils.checkIfFileExistAndNotEmpty(workFolder)) {
                       new TranscdingBackground(MainActivity.this).execute();
                   }
                   else {
                       Toast.makeText(getApplicationContext(), workFolder + " not found", Toast.LENGTH_LONG).show();
                   }
                   break;
           }
       }

       public class TranscdingBackground extends AsyncTask
       {

           ProgressDialog progressDialog;
           Activity _act;
           String commandStr;

           public TranscdingBackground (Activity act) {
               _act = act;
           }



           @Override
           protected void onPreExecute() {

    //            commandStr = "ffmpeg -y -i /storage/emulated/0/WhatsApp/Media/in.mp4 -vf rotate=270*(PI/180) /sdcard/videokit/out.mp4";
               commandStr = "ffmpeg -y -i /storage/emulated/0/WhatsApp/Media/WhatsApp Video/in.mp4 -vf rotate=270*(PI/180) /sdcard/videokit/out.mp4";


               progressDialog = new ProgressDialog(_act);
               progressDialog.setMessage("FFmpeg4Android Transcoding in progress...");
               progressDialog.show();

           }

           protected Integer doInBackground(String... paths) {
               Log.i(Prefs.TAG, "doInBackground started...");

               // delete previous log
               boolean isDeleted = GeneralUtils.deleteFileUtil(workFolder + "/vk.log");
               Log.i(Prefs.TAG, "vk deleted: " + isDeleted);

               PowerManager powerManager = (PowerManager)_act.getSystemService(Activity.POWER_SERVICE);
               PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK");
               Log.d(Prefs.TAG, "Acquire wake lock");
               wakeLock.acquire();



               LoadJNI vk = new LoadJNI();
               try {

                   vk.run(GeneralUtils.utilConvertToComplex(commandStr), workFolder, getApplicationContext());

                   // copying vk.log (internal native log) to the videokit folder
                   GeneralUtils.copyFileToFolder(vkLogPath, demoVideoFolder);

               } catch (CommandValidationException e) {
                   Log.e(Prefs.TAG, "vk run exeption.", e);
                   commandValidationFailedFlag = true;

               } catch (Throwable e) {
                   Log.e(Prefs.TAG, "vk run exeption.", e);
               }
               finally {
                   if (wakeLock.isHeld())
                       wakeLock.release();
                   else{
                       Log.i(Prefs.TAG, "Wake lock is already released, doing nothing");
                   }
               }
               Log.i(Prefs.TAG, "doInBackground finished");
               return Integer.valueOf(0);
           }

           protected void onProgressUpdate(Integer... progress) {
           }

           @Override
           protected void onCancelled() {
               Log.i(Prefs.TAG, "onCancelled");
               //progressDialog.dismiss();
               super.onCancelled();
           }


           @Override
           protected void onPostExecute(Integer result) {
               Log.i(Prefs.TAG, "onPostExecute");
               progressDialog.dismiss();
               super.onPostExecute(result);

               // finished Toast
               String rc = null;
               if (commandValidationFailedFlag) {
                   rc = "Command Vaidation Failed";
               }
               else {
                   rc = GeneralUtils.getReturnCodeFromLog(vkLogPath);
               }
               final String status = rc;
               MainActivity.this.runOnUiThread(new Runnable() {
                   public void run() {
                       Toast.makeText(MainActivity.this, status, Toast.LENGTH_LONG).show();
                       if (status.equals("Transcoding Status: Failed")) {
                           Toast.makeText(MainActivity.this, "Check: " + vkLogPath + " for more information.", Toast.LENGTH_LONG).show();
                       }
                   }
               });
           }
       }

    }

    Here onPreExecute() method I have given video file path.

  • ffmpegmediaMetadataRetriever cannot be used for m3u8 format ?

    19 juillet 2017, par Nandz

    I want to get the frames from the video URL which is of m3u8 format. I couldn’t retrieve the frame at the specified time. When i tried with mp4 format, it worked. ( Am using android videoview)

    Here is my code.

    public class VideoViewAdapterClass extends RecyclerView.Adapter {

           private List<videomodelactivity> videoListModel;
           private Context context;
           public Bitmap bitmap;
          String videoPath = "https://xxxxxx.xxxxxx.xxxxx/HLS/xxxxxxxx/fruit_milkshake-master-playlist.m3u8";

           public VideoViewAdapterClass(List<videomodelactivity> videoList, Context context) {
               this.context = context;

               videoListModel = videoList;

           }

           @Override
           public VideoViewAdapterClass.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

               View itemLayoutView = LayoutInflater.from(parent.getContext()).inflate(
                       R.layout.customized_layout, null);

               ViewHolder viewHolder = new ViewHolder(itemLayoutView);
               return viewHolder;

           }

           @Override
           public void onBindViewHolder(final VideoViewAdapterClass.ViewHolder holder, int position) {


              final VideoModelActivity videoModel = videoListModel.get(position);
               holder.movieName.setText(videoModel.getMovieName());

               MediaMetadataRetriever mediaMetadataRetriever = null;

               try {
                   mediaMetadataRetriever = new MediaMetadataRetriever();
                   if (Build.VERSION.SDK_INT >= 14)

                       mediaMetadataRetriever.setDataSource(videoPath, new HashMap());
                   bitmap = mediaMetadataRetriever.getFrameAtTime(2000000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);


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

               } finally {
                   if (mediaMetadataRetriever != null)
                       mediaMetadataRetriever.release();
               }

               holder.vidImg.setImageBitmap(bitmap);

                       holder.vidImg.setOnClickListener(new View.OnClickListener() {
                   @Override
                   public void onClick(View view) {

                       Intent intent = new Intent (context, VideoViewActivity.class);
                       intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                       context.startActivity(intent);

                   }
               });


           }

           @Override
           public int getItemCount() {
               return videoListModel.size();
           }

           public class ViewHolder extends RecyclerView.ViewHolder {

               ImageView vidImg;
               TextView movieName;
               public ViewHolder(View itemView) {
                   super(itemView);

                   vidImg = (ImageView) itemView.findViewById(R.id.imageVid);
                   movieName = (TextView) itemView.findViewById(R.id.movieName);
               }
           }
       }
    </videomodelactivity></videomodelactivity>