Recherche avancée

Médias (91)

Autres articles (112)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (11450)

  • How to solve error : "cvCreateFileCaptureWithPreference : backend FFMPEG doesn't support legacy API anymore"

    24 octobre 2018, par Sarvin

    I am trying to build and run an OpenCV project from Github using OpenCV 3.4.2, Cmake 3.13.0-rc1 and VS 2017. The project builds successfully as I understand from the build output but it throws the above warning after I run the program. The video I want to load is in a .AVI format and uses cvCaptureFromAVI function. Just trying to learn OpenCV, your help and kindness is appreciated.

    Source :

    #include <iostream>
    #include <opencv2></opencv2>opencv.hpp>

    #include "package_bgs/PBAS/PixelBasedAdaptiveSegmenter.h"
    #include "package_tracking/BlobTracking.h"
    #include "package_analysis/VehicleCouting.h"

    using namespace cv;

    int main(int argc, char **argv)
    {
     std::cout &lt;&lt; "Using OpenCV " &lt;&lt; CV_MAJOR_VERSION &lt;&lt; "." &lt;&lt;
     CV_MINOR_VERSION &lt;&lt; "." &lt;&lt; CV_SUBMINOR_VERSION &lt;&lt; std::endl;

     /* Open video file */
     CvCapture *capture = 0;

     capture = cvCaptureFromAVI("video.avi");
     if(!capture){
       std::cerr &lt;&lt; "Cannot open video ting tong!" &lt;&lt; std::endl;
       return 1;
     }

     /* Background Subtraction Algorithm */
     IBGS *bgs;
     bgs = new PixelBasedAdaptiveSegmenter;

     /* Blob Tracking Algorithm */



    cv::Mat img_blob;
     BlobTracking* blobTracking;
     blobTracking = new BlobTracking;

     /* Vehicle Counting Algorithm */
     VehicleCouting* vehicleCouting;
     vehicleCouting = new VehicleCouting;

     std::cout &lt;&lt; "Press 'q' to quit..." &lt;&lt; std::endl;
     int key = 0;
     IplImage *frame;
     while(key != 'q')
     {
       frame = cvQueryFrame(capture);
       if(!frame) break;

       cv::Mat img_input = cv::cvarrToMat(frame);
       cv::imshow("Input", img_input);

       // bgs->process(...) internally process and show the foreground mask image
       cv::Mat img_mask;
       bgs->process(img_input, img_mask);

       if(!img_mask.empty())
       {
         // Perform blob tracking
         blobTracking->process(img_input, img_mask, img_blob);

         // Perform vehicle counting
         vehicleCouting->setInput(img_blob);
         vehicleCouting->setTracks(blobTracking->getTracks());
         vehicleCouting->process();
       }

       key = cvWaitKey(1);
     }

     delete vehicleCouting;
     delete blobTracking;
     delete bgs;

     cvDestroyAllWindows();
     cvReleaseCapture(&amp;capture);

     return 0;
    }
    </iostream>

    Error :

    backend FFMPEG doesn't support legacy API anymore

  • Live stream is gets delayed while processing frame in opencv + python

    18 mars 2021, par Himanshu sharma

    I capture and process an IP camera RTSP stream in a OpenCV 4.4.0.46 on Ubuntu.&#xA;Unfortunately the processing takes quite a lot of time, roughly 0.2s per frame, and the stream quickly gets delayed.&#xA;Video file have to save for 5 min but by this delaying video file is saved for 3-4 min only.

    &#xA;

    Can we process faster to overcome delays ?

    &#xA;

    I have two IP camera which have two diffrent fps_rate(Camera 1 have 18000 and camera 2 have 20 fps)

    &#xA;

    I am implementing this code in difference Ubuntu PCs

    &#xA;

      &#xA;
    • Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux
    • &#xA;

    • Django==3.1.2
    • &#xA;

    • Ubuntu = 18.04 and 20.04
    • &#xA;

    • opencv-contrib-python==4.4.0.46
    • &#xA;

    • opencv-python==4.4.0.46
    • &#xA;

    &#xA;

    input_stream = &#x27;rtsp://&#x27;&#x2B;username&#x2B;&#x27;:&#x27;&#x2B;password&#x2B;&#x27;@&#x27;&#x2B;ip&#x2B;&#x27;/user=&#x27;&#x2B;username&#x2B;&#x27;_password=&#x27;&#x2B;password&#x2B;&#x27;_channel=0channel_number_stream=0.sdp&#x27;&#xA;input_stream---> rtsp://admin:Admin123@192.168.1.208/user=admin_password=Admin123_channel=0channel_number_stream=0.sdp&#xA;&#xA;input_stream---> rtsp://Admin:@192.168.1.209/user=Admin_password=_channel=0channel_number_stream=0.sdp&#xA;&#xA;vs = cv2.VideoCapture(input_stream)&#xA;fps_rate = int(vs.get(cv2.CAP_PROP_FPS))&#xA;I have two IP camera which have two diffrent fps_rate(Camera 1 have 18000 and camera 2 have 20 fps)&#xA;&#xA;video_file_name = 0&#xA;start_time = time.time()&#xA;while(True):&#xA;    ret, frame = vs.read()&#xA;    time.sleep(0.2)     # &lt;= Simulate processing time (mask detection, face detection and many detection is hapning)&#xA;&#xA;&#xA;    ###  Start of  writing a video to disk          &#xA;    minute = 5  ## saving a file for 5 minute only then saving another file for 5 min&#xA;    second  = 60&#xA;    minite_to_save_video = int(minute) * int(second)&#xA;&#xA;&#xA;    # if we are supposed to be writing a video to disk, initialize&#xA;    if time.time() - start_time >= minite_to_save_video or  video_file_name == 0 :&#xA;        ## where H = heigth, W = width, C = channel &#xA;        H, W, C = frame.shape&#xA;        &#xA;        print(&#x27;time.time()-->&#x27;,time.time(),&#x27;video_file_name-->&#x27;, video_file_name,  &#x27; #####&#x27;)&#xA;        start_time = time.time()&#xA;&#xA;        video_file_name = str(time.mktime(datetime.datetime.now().timetuple())).replace(&#x27;.0&#x27;, &#x27;&#x27;)&#xA;        output_save_directory = output_stream&#x2B;str(int(video_file_name))&#x2B;&#x27;.mp4&#x27;&#xA;&#xA;&#xA;        fourcc = cv2.VideoWriter_fourcc(*&#x27;avc1&#x27;)&#xA;        &#xA;        writer = cv2.VideoWriter(output_save_directory, fourcc,20.0,(W, H), True)&#xA;&#xA;    # check to see if we should write the frame to disk&#xA;    if writer is not None:&#xA;        &#xA;        try:&#xA;            writer.write(frame)&#xA;&#xA;        except Exception as e:&#xA;            print(&#x27;Error in writing video output---> &#x27;, e)&#xA;

    &#xA;

  • FFPROBE get start-time of audio only

    13 février 2023, par Marcus

    I am using this to get the start time of the video and audio :

    &#xA;

    ffprobe -show_entries stream=start_time -i https://www.website.com/video.mp4&#xA;

    &#xA;

    And the response I get is :

    &#xA;

        ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers&#xA;      built with Apple clang version 12.0.0 (clang-1200.0.32.28)&#xA;      configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack&#xA;      libavutil      56. 51.100 / 56. 51.100&#xA;      libavcodec     58. 91.100 / 58. 91.100&#xA;      libavformat    58. 45.100 / 58. 45.100&#xA;      libavdevice    58. 10.100 / 58. 10.100&#xA;      libavfilter     7. 85.100 /  7. 85.100&#xA;      libavresample   4.  0.  0 /  4.  0.  0&#xA;      libswscale      5.  7.100 /  5.  7.100&#xA;      libswresample   3.  7.100 /  3.  7.100&#xA;      libpostproc    55.  7.100 / 55.  7.100&#xA;    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;https://www.website.com/video.mp4&#x27;:&#xA;      Metadata:&#xA;        major_brand     : isom&#xA;        minor_version   : 512&#xA;        compatible_brands: isomiso2avc1mp41&#xA;        encoder         : Lavf58.76.100&#xA;      Duration: 00:03:14.85, start: 0.000000, bitrate: 4488 kb/s&#xA;        Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 4418 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)&#xA;        Metadata:&#xA;          handler_name    : VideoHandler&#xA;        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default)&#xA;        Metadata:&#xA;          handler_name    : SoundHandler&#xA;[STREAM]&#xA;start_time=0.000000&#xA;[/STREAM]&#xA;[STREAM]&#xA;start_time=9.892993&#xA;[/STREAM]&#xA;

    &#xA;

    How can I get only the second stream, which is the audio, and without all the extra info ?

    &#xA;

    So the response would just be :

    &#xA;

    &#xA;

    start_time=9.892993

    &#xA;

    &#xA;