Recherche avancée

Médias (91)

Autres articles (90)

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

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

Sur d’autres sites (11636)

  • 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>
  • MVC - Audio Convert file from M4A to MP3

    17 octobre 2016, par Matheus Miranda

    In my application I upload an audio file type MP4 from a windows explorer and save it in data base SQL in field VARBINARY. It is OK. I would like to convert it to MP3 before insert in my DB, for these I am using a FFMPEG but i am not able to get success. Can anybody help me ?

    Below is the screenshot where we can see the file and type in my application.

    enter image description here

    Is possible to use a FFMPEG reading the file directly from MODEL ? Parameter : FileName ?

    What is the best way to convert a audio file as mentioned above via MVC program ?

    Thanks for any suggestion or help.

    Best Regards,

  • How run subprocess in Python 3 on windows for convert video ?

    31 août 2016, par Diego F. Ruiz S.

    I have a little problem, I have trying for a lot time converted a video with FFMPEG in python 3 like this :

    The model,

    class Video(models.Model):
      name = models.CharField(max_length=200, null=False)
      state = models.CharField(max_length=30, null=False)
      user_email = models.CharField(max_length=30, null=False)
      uploadDate = models.DateTimeField(null=False)
      message = models.CharField(max_length=200, null=False)
      original_video = models.FileField(upload_to='video', null=True)
      converted = models.BooleanField(default=False)

    And the code of converted.

    video = Video.objects.filter(id=param_id).get()
    pathConverted = 'C:\\Users\\diego\\Documents\\GitHub\\convertido.mp4'
    cmd = ['ffmpeg', '-i ', video.original_video.path, ' -b 1500k -vcodec ibx264 -g 30', pathConverted]
    print('Ejecutando... ', ' '.join(cmd))
    try:
       proc = subprocess.run(cmd, shell=True, check=True)
       proc.subprocess.wait()
    except subprocess.CalledProcessError as e:
       raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))

    The error is this.

    raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) RuntimeError: command '['ffmpeg', '-i ', 'C:\\Users\\diego\\Documents\\GitHub\\video1.avi', ' -b 1500k -vcodec libx264 -g 30', 'C:\\Users\\diego\\Documents\\GitHub\\convertido.mp4']' return with error (code 1): None

    And also I have tried this :

    video = Video.objects.filter(id=1).get()
    pathConverted = 'C:\\Users\\diego\\Documents\\GitHub\\convertido.mp4'
    cmd = ['ffmpeg', '-i ', video.original_video.path, ' -b 1500k -vcodec libx264 -g 30', pathConverted]
    print('Ejecutando... ', ' '.join(cmd))
    proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
    proc.subprocess.wait()

    In this case the error is :

    FileNotFoundError: [WinError 2] No such file or directory

    But when I copy the path and paste this in CMD on windows for try this converted the video. It works fine.

    Then, I am confused, I don’t understand what is the error.

    Somebody can help me please ?