Recherche avancée

Médias (91)

Autres articles (104)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (11473)

  • 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 ?