Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (63)

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

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

Sur d’autres sites (11102)

  • Evolution #4120 : Ajouter l’info de numéro de nouvelle version directement dans le bouton "Mettre ...

    29 mars 2018, par b b

    Super, c’est voulu d’avoir utilisé -> au lieu d’un simple tiret comme séparateur ?

  • Anomalie #4109 (Fermé) : Calcul des visites d’un referer la veille en partie faux ?

    8 mars 2018, par b b

    Super, on ferme :)

  • fatal singal 11 error on FFMPEG streaming for RTSP

    2 mars 2018, par Anuran Barman

    I have added rtsp streaming with FFMPEG in my app.What I am trying to do is add two fragments (each will load different rtsp streaming) into single activity.
    While the first fragment in first LinearLayout is working fine second one is giving error as mentioned in the question. What can be the possible reason for this ? I am loading the library in static block , can that be the reason ?

    My code for single fragment which is added twice in two different linear.
    layouts.

    @SuppressWarnings("JniMissingFunction")
    public class StreamingActivity extends Fragment implements SurfaceHolder.Callback {

       private static boolean loadedLibraries;


       static {
           try {

               System.loadLibrary("avutil");
               System.loadLibrary("avcodec");
               System.loadLibrary("avformat");
               System.loadLibrary("swscale");
               System.loadLibrary("avfilter");
               System.loadLibrary("ffmpeg-jni");
               loadedLibraries = true;
           } catch (Throwable e) {

               e.printStackTrace();
           }
       }


       private SurfaceView surfaceView;
       private ProgressBar progressBar;
       private boolean isPlaying;
       private boolean isInitialized;
       private String url;
       private final String TAG=StreamingActivity.class.getSimpleName();
       @Nullable
       @Override
       public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
           View view=inflater.inflate(R.layout.activity_streaming,null,false);
           surfaceView = (SurfaceView)view.findViewById(R.id.surfaceView);
           progressBar = ((ProgressBar)view.findViewById(R.id.progressBar));
           surfaceView.getHolder().addCallback(this);

           url =getArguments().getString("url");

           return view;

       }

       @Override
       public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
           super.onViewCreated(view, savedInstanceState);
           new PlayVideo().execute();
       }


       @DebugLog
       private void postInit() {
           if (isInitialized) {
               initPlay();
               progressBar.setVisibility(View.GONE);
           } else {
               getActivity().finish();
           }
       }

       private void initPlay() {
           int[] res = naGetVideoRes();
           Log.d("ANURAN", "res width " + res[0] + ": height " + res[1]);
           if (res[0] <= 0) {
               res[0] = 480;
           }
           if (res[1] <= 0) {
               res[1] = 320;
           }
           int[] screenRes = getScreenRes();
           int width, height;
           float widthScaledRatio = screenRes[0] * 1.0f / res[0];
           float heightScaledRatio = screenRes[1] * 1.0f / res[1];
           if (widthScaledRatio > heightScaledRatio) {
               //use heightScaledRatio
               width = (int) (res[0] * heightScaledRatio);
               height = screenRes[1];
           } else {
               //use widthScaledRatio
               width = screenRes[0];
               height = (int) (res[1] * widthScaledRatio);
           }
           Log.d(TAG, "width " + width + ",height:" + height);
           updateSurfaceView(width, height);
           naSetup(width, height);
           playMedia();
       }

       private void playMedia() {
           if(progressBar.getVisibility()==View.VISIBLE){
               progressBar.setVisibility(View.GONE);
           }
           naPlay();
           isPlaying = true;
       }

       @DebugLog
       private void updateSurfaceView(int pWidth, int pHeight) {
           //update surfaceview dimension, this will cause the native window to change
           Log.d("ANURAN UPDATE SURFACE", "width " + pWidth + ",height:" + pHeight);
           FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) surfaceView.getLayoutParams();
           params.width = pWidth;
           params.height = pHeight;
           surfaceView.setLayoutParams(params);
       }

       @DebugLog
       @SuppressLint("NewApi")
       private int[] getScreenRes() {
           int[] res = new int[2];
           Display display = getActivity().getWindowManager().getDefaultDisplay();
           Point size = new Point();
           display.getSize(size);
           res[0] = size.x;
           res[1] = size.y;
           return res;
       }

       @Override
       public void onStop() {
           super.onStop();
           Toast.makeText(getActivity(),"onStop called",Toast.LENGTH_SHORT).show();
           stopPlaying();
           getActivity().finish();
       }

    //    @Override
    //    public void onBackPressed() {
    //        stopPlaying();
    //        getActivity().finish();
    //    }

       private void stopPlaying() {
           isPlaying = false;
           naStop();
       }

       @Override
       public void onDestroy() {
           super.onDestroy();
           stopPlaying();
           getActivity().finish();
       }

       @Override
       public void onResume() {
           super.onResume();
           progressBar.setVisibility(View.VISIBLE);

       }


       private static native int naInit(String pFileName);
       private static native int[] naGetVideoRes();
       private static native void naSetSurface(Surface pSurface);
       private static native int naSetup(int pWidth, int pHeight);
       private static native void naPlay();
       private static native void naStop();



       @Override
       public void surfaceChanged(SurfaceHolder holder, int format, int width,
                                  int height) {
           Timber.d(TAG, "surfacechanged: " + width + ":" + height);
           naSetSurface(holder.getSurface());
       }

       @Override
       public void surfaceCreated(SurfaceHolder holder) {

       }

       @Override
       public void surfaceDestroyed(SurfaceHolder holder) {
           Timber.d(TAG, "surfaceDestroyed");
           naSetSurface(null);
       }



       private class PlayVideo extends AsyncTask{

           @Override
           protected Void doInBackground(Void... voids) {
               isInitialized=(naInit(url)==0);
               return null;
           }

           @Override
           protected void onPostExecute(Void aVoid) {
               super.onPostExecute(aVoid);
               postInit();
               this.cancel(true);
           }
       }
    }

    My activity which is loading the two fragments :

    public class CamerasActivity extends BaseActivity {

       FragmentManager fragmentManager;
       FragmentTransaction fragmentTransaction;

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

           fragmentManager=getSupportFragmentManager();
           fragmentTransaction=fragmentManager.beginTransaction();

           StreamingActivity streamingFragment=new StreamingActivity();
           Bundle bundle=new Bundle();
           bundle.putString("url",getIntent().getStringExtra(Constants.IntentExtras.DATA));
           streamingFragment.setArguments(bundle);

           StreamingActivity streamingFragment2=new StreamingActivity();
           Bundle bundle2=new Bundle();
           bundle2.putString("url",getIntent().getStringExtra(Constants.IntentExtras.DATA));
           streamingFragment2.setArguments(bundle2);

           fragmentTransaction.replace(R.id.frame1,streamingFragment);
           fragmentTransaction.replace(R.id.frame2,streamingFragment2);

           fragmentTransaction.commit();
       }
    }

    layout for CamerasActivity.java

    <?xml version="1.0" encoding="utf-8"?>
    <linearlayout>
       <linearlayout></linearlayout>
       <linearlayout></linearlayout>
    </linearlayout>

    Why is the second fragment crashing ?
    As we mention in the JNI wrapper which Java class will be calling the native functions can there only one instance of that class in whole scope ? can that be the reason ?