Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (63)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (11255)

  • Youtue Watch Me Android application closing unexpectedly

    18 septembre 2015, par Kichu

    I create android application from https://github.com/youtube/yt-watchme.

    When I try to create the event using the "CREATE LIVE EVENT" button.It throws some following error. I think it’s happening due to the camera permission issue.

    ERROR :

    09-17 11:43:53.582  32383-32383/com.google.android.apps.watchme E/AndroidRuntime﹕ FATAL EXCEPTION: main
       Process: com.google.android.apps.watchme, PID: 32383
       java.lang.NoSuchMethodError: com.google.android.apps.watchme.StreamerActivity.checkSelfPermission
               at com.google.android.apps.watchme.StreamerActivity.startStreaming(StreamerActivity.java:174)
               at com.google.android.apps.watchme.StreamerActivity.access$200(StreamerActivity.java:46)
               at com.google.android.apps.watchme.StreamerActivity$1.onServiceConnected(StreamerActivity.java:63)
               at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1110)
               at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1127)
               at android.os.Handler.handleCallback(Handler.java:733)
               at android.os.Handler.dispatchMessage(Handler.java:95)
               at android.os.Looper.loop(Looper.java:136)
               at android.app.ActivityThread.main(ActivityThread.java:5097)
               at java.lang.reflect.Method.invokeNative(Native Method)
               at java.lang.reflect.Method.invoke(Method.java:515)
               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
               at dalvik.system.NativeStart.main(Native Method)

    Any one please suggest . How can I solve this issue.

    Thanks In Advance

    Code Update :

    Manifest file XML

    <manifest package="com.google.android.apps.watchme">


       
       
       
       
       
       
       
       
       

       
       

       <application>
           <activity>
               
                   <action></action>

                   <category></category>
               
           </activity>
           <activity></activity>

           <service></service>
       </application>
       
    </manifest>

    Stream Activity File

    /*
    * Copyright (c) 2014 Google Inc.
    *
    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
    * in compliance with the License. You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software distributed under the License
    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
    * or implied. See the License for the specific language governing permissions and limitations under
    * the License.
    */

    package com.google.android.apps.watchme;

    import android.Manifest;
    import android.app.Activity;
    import android.content.ComponentName;
    import android.content.Context;
    import android.content.Intent;
    import android.content.ServiceConnection;
    import android.content.pm.PackageManager;
    import android.hardware.Camera;
    import android.os.Bundle;
    import android.os.IBinder;
    import android.os.PowerManager;
    import android.support.design.widget.Snackbar;
    import android.support.v4.app.ActivityCompat;
    import android.util.Log;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.ToggleButton;

    import com.google.android.apps.watchme.util.Utils;
    import com.google.android.apps.watchme.util.YouTubeApi;

    import java.util.ArrayList;
    import java.util.List;

    /**
    * @author Ibrahim Ulukaya &lt;ulukaya@google.com&gt;
    *         <p></p>
    *         StreamerActivity class which previews the camera and streams via StreamerService.
    */
    public class StreamerActivity extends Activity {
       // CONSTANTS
       // TODO: Stop hardcoding this and read values from the camera's supported sizes.
       public static final int CAMERA_WIDTH = 640;
       public static final int CAMERA_HEIGHT = 480;
       private static final int REQUEST_CAMERA_MICROPHONE = 0;

       // Member variables
       private StreamerService streamerService;
       private ServiceConnection streamerConnection = new ServiceConnection() {
           @Override
           public void onServiceConnected(ComponentName className, IBinder service) {
               Log.d(MainActivity.APP_NAME, "onServiceConnected");

               streamerService = ((StreamerService.LocalBinder) service).getService();

               restoreStateFromService();
               startStreaming();
           }

           @Override
           public void onServiceDisconnected(ComponentName className) {
               Log.e(MainActivity.APP_NAME, "onServiceDisconnected");

               // This should never happen, because our service runs in the same process.
               streamerService = null;
           }
       };
       private PowerManager.WakeLock wakeLock;
       private Preview preview;
       private String rtmpUrl;
       private String broadcastId;

       @Override
       public void onCreate(Bundle savedInstanceState) {
           Log.d(MainActivity.APP_NAME, "onCreate");
           super.onCreate(savedInstanceState);

           broadcastId = getIntent().getStringExtra(YouTubeApi.BROADCAST_ID_KEY);
           //Log.v(MainActivity.APP_NAME, broadcastId);

           rtmpUrl = getIntent().getStringExtra(YouTubeApi.RTMP_URL_KEY);

           if (rtmpUrl == null) {
               Log.w(MainActivity.APP_NAME, "No RTMP URL was passed in; bailing.");
               finish();
           }
           Log.i(MainActivity.APP_NAME, String.format("Got RTMP URL '%s' from calling activity.", rtmpUrl));

           setContentView(R.layout.streamer);
           preview = (Preview) findViewById(R.id.surfaceViewPreview);

           if (!bindService(new Intent(this, StreamerService.class), streamerConnection,
                   BIND_AUTO_CREATE | BIND_DEBUG_UNBIND)) {
               Log.e(MainActivity.APP_NAME, "Failed to bind StreamerService!");
           }

           final ToggleButton toggleButton = (ToggleButton) findViewById(R.id.toggleBroadcasting);
           toggleButton.setOnClickListener(new OnClickListener() {
               @Override
               public void onClick(View v) {
                   if (toggleButton.isChecked()) {
                       streamerService.startStreaming(rtmpUrl);
                   } else {
                       streamerService.stopStreaming();
                   }
               }
           });
       }

       @Override
       protected void onResume() {
           Log.d(MainActivity.APP_NAME, "onResume");

           super.onResume();

           if (streamerService != null) {
               restoreStateFromService();
           }
       }

       @Override
       protected void onPause() {
           Log.d(MainActivity.APP_NAME, "onPause");

           super.onPause();

           if (preview != null) {
               preview.setCamera(null);
           }

           if (streamerService != null) {
               streamerService.releaseCamera();
           }
       }

       @Override
       protected void onDestroy() {
           Log.d(MainActivity.APP_NAME, "onDestroy");

           super.onDestroy();

           if (streamerConnection != null) {
               unbindService(streamerConnection);
           }

           stopStreaming();

           if (streamerService != null) {
               streamerService.releaseCamera();
           }
       }

       private void restoreStateFromService() {
           preview.setCamera(Utils.getCamera(Camera.CameraInfo.CAMERA_FACING_FRONT));
       }

       private void startStreaming() {
           Log.d(MainActivity.APP_NAME, "startStreaming");

           PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
           wakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, this.getClass().getName());
           wakeLock.acquire();

           if (!streamerService.isStreaming()) {

               String cameraPermission = Manifest.permission.CAMERA;
               String microphonePermission = Manifest.permission.RECORD_AUDIO;
               int hasCamPermission = checkSelfPermission(cameraPermission);
               int hasMicPermission = checkSelfPermission(microphonePermission);
               List<string> permissions = new ArrayList<string>();
               if (hasCamPermission != PackageManager.PERMISSION_GRANTED) {
                   permissions.add(cameraPermission);
                   if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                           Manifest.permission.CAMERA)) {
                       // Provide rationale in Snackbar to request permission
                       Snackbar.make(preview, R.string.permission_camera_rationale,
                               Snackbar.LENGTH_INDEFINITE).show();
                   } else {
                       // Explain in Snackbar to turn on permission in settings
                       Snackbar.make(preview, R.string.permission_camera_explain,
                               Snackbar.LENGTH_INDEFINITE).show();
                   }
               }
               if (hasMicPermission != PackageManager.PERMISSION_GRANTED) {
                   permissions.add(microphonePermission);
                   if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                           Manifest.permission.RECORD_AUDIO)) {
                       // Provide rationale in Snackbar to request permission
                       Snackbar.make(preview, R.string.permission_microphone_rationale,
                               Snackbar.LENGTH_INDEFINITE).show();
                   } else {
                       // Explain in Snackbar to turn on permission in settings
                       Snackbar.make(preview, R.string.permission_microphone_explain,
                               Snackbar.LENGTH_INDEFINITE).show();
                   }
               }
               if (!permissions.isEmpty()) {
                   String[] params = permissions.toArray(new String[permissions.size()]);
                   ActivityCompat.requestPermissions(this, params, REQUEST_CAMERA_MICROPHONE);
               } else {
                   // We already have permission, so handle as normal
                   streamerService.startStreaming(rtmpUrl);
               }
           }
       }

       /**
        * Callback received when a permissions request has been completed.
        */
       @Override
       public void onRequestPermissionsResult(int requestCode,
                                              String permissions[], int[] grantResults) {
           switch (requestCode) {
               case REQUEST_CAMERA_MICROPHONE: {
                   Log.i(MainActivity.APP_NAME, "Received response for camera with mic permissions request.");

                   // We have requested multiple permissions for contacts, so all of them need to be
                   // checked.
                   if (Utils.verifyPermissions(grantResults)) {
                       // permissions were granted, yay! do the
                       // streamer task you need to do.
                       streamerService.startStreaming(rtmpUrl);
                   } else {
                       Log.i(MainActivity.APP_NAME, "Camera with mic permissions were NOT granted.");
                       Snackbar.make(preview, R.string.permissions_not_granted,
                               Snackbar.LENGTH_SHORT)
                               .show();
                   }
                   break;
               }

               // other 'switch' lines to check for other
               // permissions this app might request
           }
           return;
       }


       private void stopStreaming() {
           Log.d(MainActivity.APP_NAME, "stopStreaming");

           if (wakeLock != null) {
               wakeLock.release();
               wakeLock = null;
           }

           if (streamerService.isStreaming()) {
               streamerService.stopStreaming();
           }
       }

       public void endEvent(View view) {
           Intent data = new Intent();
           data.putExtra(YouTubeApi.BROADCAST_ID_KEY, broadcastId);
           if (getParent() == null) {
               setResult(Activity.RESULT_OK, data);
           } else {
               getParent().setResult(Activity.RESULT_OK, data);
           }
           finish();
       }

    }
    </string></string>

    Update ERROR CODE :

    08:57:14.447  18829-18829/com.google.android.apps.watchme E/AndroidRuntime﹕ FATAL EXCEPTION: main
       Process: com.google.android.apps.watchme, PID: 18829
       java.lang.UnsatisfiedLinkError: Couldn't load ffmpeg from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.google.android.apps.watchme-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.google.android.apps.watchme-1, /vendor/lib, /system/lib]]]: findLibrary returned null
               at java.lang.Runtime.loadLibrary(Runtime.java:358)
               at java.lang.System.loadLibrary(System.java:526)
               at com.google.android.apps.watchme.Ffmpeg.<clinit>(Ffmpeg.java:26)
               at com.google.android.apps.watchme.VideoStreamingConnection.open(VideoStreamingConnection.java:71)
               at com.google.android.apps.watchme.StreamerService.startStreaming(StreamerService.java:80)
               at com.google.android.apps.watchme.StreamerActivity.startStreaming(StreamerActivity.java:212)
               at com.google.android.apps.watchme.StreamerActivity.access$200(StreamerActivity.java:47)
               at com.google.android.apps.watchme.StreamerActivity$1.onServiceConnected(StreamerActivity.java:64)
               at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1110)
               at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1127)
               at android.os.Handler.handleCallback(Handler.java:733)
               at android.os.Handler.dispatchMessage(Handler.java:95)
               at android.os.Looper.loop(Looper.java:136)
               at android.app.ActivityThread.main(ActivityThread.java:5097)
               at java.lang.reflect.Method.invokeNative(Native Method)
               at java.lang.reflect.Method.invoke(Method.java:515)
               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
               at dalvik.system.NativeStart.main(Native Method)
    </clinit>
  • matroskaenc : write the channel mask for FLAC

    26 mai 2014, par Anton Khirnov
    matroskaenc : write the channel mask for FLAC
    
    • [DBH] libavformat/Makefile
    • [DBH] libavformat/matroskaenc.c
  • Opencv mask object from rtsp camera

    19 août 2016, par user3689259

    i want to add an image as mask in camera live frame after detect specific logo .
    if possible Output rtmp ://127.0.0.1:1935/live/mycamOutput ,, I have nginx-rtmp the rtmp can work if we add it in source , pls any one can help me

    //opencv
    #include "opencv2/imgcodecs.hpp"
    #include "opencv2/imgproc.hpp"
    #include "opencv2/videoio.hpp"
    #include <opencv2></opencv2>highgui.hpp>
    #include <opencv2></opencv2>video.hpp>
    //C
    #include
    //C++
    #include <iostream>
    #include <sstream>

    using namespace cv;
    using namespace std;

    // Global variables
    Mat frame; //current frame
    Mat fgMaskMOG2; //fg mask fg mask generated by MOG2 method
    Ptr<backgroundsubtractor> pMOG2; //MOG2 Background subtractor
    int keyboard; //input from keyboard

    /** Function Headers */
    void help();
    void processVideo(char* videoFilename);
    void processImages(char* firstFrameFilename);

    void help()
    {
       cout
       &lt;&lt; "--------------------------------------------------------------------------" &lt;&lt; endl
       &lt;&lt; "This program shows how to use background subtraction methods provided by "  &lt;&lt; endl
       &lt;&lt; " OpenCV. You can process both videos (-vid) and images (-img)."             &lt;&lt; endl
                                                                                       &lt;&lt; endl
       &lt;&lt; "Usage:"                                                                     &lt;&lt; endl
       &lt;&lt; "./bg_sub {-vid <video filename="filename">|-img <image filename="filename">}"                     &lt;&lt; endl
       &lt;&lt; "for example: ./bg_sub -vid video.avi"                                       &lt;&lt; endl
       &lt;&lt; "or: ./bg_sub -img /data/images/1.png"                                       &lt;&lt; endl
       &lt;&lt; "--------------------------------------------------------------------------" &lt;&lt; endl
       &lt;&lt; endl;
    }

    /**
    * @function main
    */
    int main(int argc, char* argv[])
    {
       //print help information
       help();

       //check for the input parameter correctness
       if(argc != 3) {
           cerr &lt;&lt;"Incorret input list" &lt;&lt; endl;
           cerr &lt;&lt;"exiting..." &lt;&lt; endl;
           return EXIT_FAILURE;
       }

       //create GUI windows
       namedWindow("Frame");
       namedWindow("FG Mask MOG 2");

       //create Background Subtractor objects
       pMOG2 = createBackgroundSubtractorMOG2(); //MOG2 approach

       if(strcmp(argv[1], "-vid") == 0) {
           //input data coming from a video
           processVideo(argv[2]);
       }
       else if(strcmp(argv[1], "-img") == 0) {
           //input data coming from a sequence of images
           processImages(argv[2]);
       }
       else {
           //error in reading input parameters
           cerr &lt;&lt;"Please, check the input parameters." &lt;&lt; endl;
           cerr &lt;&lt;"Exiting..." &lt;&lt; endl;
           return EXIT_FAILURE;
       }
       //destroy GUI windows
       destroyAllWindows();
       return EXIT_SUCCESS;
    }

    /**
    * @function processVideo
    */
    void processVideo(char* videoFilename) {
       //create the capture object
       VideoCapture capture(videoFilename);
       if(!capture.isOpened()){
           //error in opening the video input
           cerr &lt;&lt; "Unable to open video file: " &lt;&lt; videoFilename &lt;&lt; endl;
           exit(EXIT_FAILURE);
       }
       //read input data. ESC or 'q' for quitting
       while( (char)keyboard != 'q' &amp;&amp; (char)keyboard != 27 ){
           //read the current frame
           if(!capture.read(frame)) {
               cerr &lt;&lt; "Unable to read next frame." &lt;&lt; endl;
               cerr &lt;&lt; "Exiting..." &lt;&lt; endl;
               exit(EXIT_FAILURE);
           }
           //update the background model
           pMOG2->apply(frame, fgMaskMOG2);
           //get the frame number and write it on the current frame
           stringstream ss;
           rectangle(frame, cv::Point(10, 2), cv::Point(100,20),
                     cv::Scalar(255,255,255), -1);
           ss &lt;&lt; capture.get(CAP_PROP_POS_FRAMES);
           string frameNumberString = ss.str();
           putText(frame, frameNumberString.c_str(), cv::Point(15, 15),
                   FONT_HERSHEY_SIMPLEX, 0.5 , cv::Scalar(0,0,0));
           //show the current frame and the fg masks
           imshow("Frame", frame);
           imshow("FG Mask MOG 2", fgMaskMOG2);
           //get the input from the keyboard
           keyboard = waitKey( 30 );
       }
       //delete capture object
       capture.release();
    }

    /**
    * @function processImages
    */
    void processImages(char* fistFrameFilename) {
       //read the first file of the sequence
       frame = imread(fistFrameFilename);
       if(frame.empty()){
           //error in opening the first image
           cerr &lt;&lt; "Unable to open first image frame: " &lt;&lt; fistFrameFilename &lt;&lt; endl;
           exit(EXIT_FAILURE);
       }
       //current image filename
       string fn(fistFrameFilename);
       //read input data. ESC or 'q' for quitting
       while( (char)keyboard != 'q' &amp;&amp; (char)keyboard != 27 ){
           //update the background model
           pMOG2->apply(frame, fgMaskMOG2);
           //get the frame number and write it on the current frame
           size_t index = fn.find_last_of("/");
           if(index == string::npos) {
               index = fn.find_last_of("\\");
           }
           size_t index2 = fn.find_last_of(".");
           string prefix = fn.substr(0,index+1);
           string suffix = fn.substr(index2);
           string frameNumberString = fn.substr(index+1, index2-index-1);
           istringstream iss(frameNumberString);
           int frameNumber = 0;
           iss >> frameNumber;
           rectangle(frame, cv::Point(10, 2), cv::Point(100,20),
                     cv::Scalar(255,255,255), -1);
           putText(frame, frameNumberString.c_str(), cv::Point(15, 15),
                   FONT_HERSHEY_SIMPLEX, 0.5 , cv::Scalar(0,0,0));
           //show the current frame and the fg masks
           imshow("Frame", frame);
           imshow("FG Mask MOG 2", fgMaskMOG2);
           //get the input from the keyboard
           keyboard = waitKey( 30 );
           //search for the next image in the sequence
           ostringstream oss;
           oss &lt;&lt; (frameNumber + 1);
           string nextFrameNumberString = oss.str();
           string nextFrameFilename = prefix + nextFrameNumberString + suffix;
           //read the next frame
           frame = imread(nextFrameFilename);
           if(frame.empty()){
               //error in opening the next image in the sequence
               cerr &lt;&lt; "Unable to open image frame: " &lt;&lt; nextFrameFilename &lt;&lt; endl;
               exit(EXIT_FAILURE);
           }
           //update the path of the current frame
           fn.assign(nextFrameFilename);
       }
    }
    </image></video></backgroundsubtractor></sstream></iostream>