Recherche avancée

Médias (91)

Autres articles (105)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (11952)

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

  • Discord bot stop playing music in random time of song

    25 janvier 2021, par Jusmejtr

    I have a discord to let me play a random song from the list.

    &#xA;

    How bot works :&#xA;Bot IS connected to firestore Cloud (firebase) where i have economy data from my server. Price for playing random song is 75 coins.

    &#xA;

    Everything worked as it should, but yesterday I used command, the bot started playing and after a while it stopped playing music and also no other commands worked, bot probably get freezed.

    &#xA;

    I have no errors in the console until after a minute it showed me this error.

    &#xA;

    https://pastebin.com/ay9gV75T

    &#xA;

    The bot is hosted on Heroku and I also added this buildpack to ffmpeg in the settings.

    &#xA;

    https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest

    &#xA;

    This is my code :

    &#xA;

    module.exports = {&#xA;    name: "buy-music",&#xA;    description: "buy a music",&#xA;&#xA;    async execute(message, config, db){&#xA;        const PREFIX = (config.prefix);&#xA;&#xA;        if(message.content === PREFIX &#x2B; "buy music"){&#xA;            const ytdl = require("ytdl-core");&#xA;            message.delete();&#xA;            let uzivatel = message.author.tag;&#xA;&#xA;            let voiceChannel = message.member.voice.channel;&#xA;            if(!voiceChannel) return message.reply("Mus&#xED;š byť vo voice roomke");&#xA;&#xA;            let cena = 75;&#xA;    &#xA;            db.collection(&#x27;economy&#x27;).doc(uzivatel).get().then(async (q) => {&#xA;                if(!q.exists) return message.reply("Nem&#xE1;š vytvoren&#xFD; &#xFA;čet");&#xA;                var hodnota = q.data().money;&#xA;                if(hodnota &lt; cena) return message.reply("Nem&#xE1;š dostatok financi&#xED;");&#xA;&#xA;                db.collection(&#x27;statusy&#x27;).doc(&#x27;music&#x27;).get().then(async (asaj) => {&#xA;                    let stav = asaj.data().stav;&#xA;                    if(stav == "off"){&#xA;                        db.collection(&#x27;statusy&#x27;).doc(&#x27;music&#x27;).update({&#xA;                            "stav": "on",&#xA;                            "autor": message.author.tag,&#xA;                        });&#xA;                        hodnota -= cena;&#xA;                        db.collection(&#x27;economy&#x27;).doc(uzivatel).update({&#xA;                            &#x27;money&#x27;: hodnota&#xA;                        });&#xA;                        function randomhraj(){&#xA;                            var pole = [&#xA;                     My YT links&#xA;&#xA;                            ]&#xA;                            let rnd = Math.floor(Math.random() * pole.length);&#xA;                            let output = pole[rnd];&#xA;                            return output;&#xA;                        }&#xA;        &#xA;                        try{&#xA;                            var pripojenie = await voiceChannel.join();&#xA;                            message.reply(`&#xDA;spešne si si k&#xFA;pil chuťovečku`);&#xA;                        }catch(error){&#xA;                            console.log(`Error pri pripajani do room (music join) ${error}`);&#xA;                        }&#xA;                        &#xA;                        const dispatcher = pripojenie.play(ytdl(randomhraj())).on("finish", async() => {&#xA;                            await voiceChannel.leave();&#xA;                            await db.collection(&#x27;statusy&#x27;).doc(&#x27;music&#x27;).update({&#xA;                                "stav": "off",&#xA;                                "autor": "nikto",&#xA;                            });&#xA;                        }).on("error", error => {&#xA;                            console.log(error)&#xA;                        })&#xA;                        dispatcher.setVolumeLogarithmic(5 / 5)&#xA;                    }else{&#xA;                        message.reply("Moment&#xE1;lne si hudbu k&#xFA;pil niekto in&#xFD; alebo ak si hudbu k&#xFA;pil a chceš ju zastaviť použi pr&#xED;kaz *stop");&#xA;                    }&#xA;                    &#xA;                });&#xA;            });&#xA;    &#xA;        }else if(message.content === PREFIX &#x2B; "stop"){&#xA;            message.delete();&#xA;            db.collection(&#x27;statusy&#x27;).doc(&#x27;music&#x27;).get().then((n) => {&#xA;                let kto = n.data().autor;&#xA;                let meno = message.author.tag;&#xA;                if(!message.member.voice.channel) return message.channel.send("Mus&#xED;š byť vo voice roomke pre stopnutie hudby");&#xA;                if(kto == meno){&#xA;                    message.member.voice.channel.leave();&#xA;                    message.channel.send("&#xDA;spešne odpojen&#xFD;");&#xA;                    db.collection(&#x27;statusy&#x27;).doc(&#x27;music&#x27;).update({&#xA;                        "stav": "off",&#xA;                        "autor": "nikto",&#xA;                    });&#xA;                }else{&#xA;                    message.reply("Zastaviť hudbu m&#xF4;že len ten kto si ju k&#xFA;pil");&#xA;                }&#xA;            });&#xA;        }&#xA;        &#xA;    }&#xA;}&#xA;

    &#xA;