Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (45)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (8146)

  • Crop video scale square to round shape -Android

    13 septembre 2019, par Adil

    Currently I’m developing video editing app, in which i want to overlay video to image i used FFMPEG library and use overlay command and export video to video.mp4 format

    Here is done with overlay command :

    private void extractImagesVideo() {
       File moviesDir = Environment.getExternalStoragePublicDirectory(
       Environment.DIRECTORY_PICTURES
    );

    String filePrefix = "extract_picture";
    String fileExtn = ".mp4";

    File dir = new File(moviesDir, "VideoEditor");
    int fileNo = 0;
    while (dir.exists()) {
    fileNo++;
    dir = new File(moviesDir, "VideoEditor" + fileNo);

    }
    dir.mkdir();
    File dest = new File(dir, filePrefix + "%03d" + fileExtn);

    Log.d(TAG, "startTrim: dest: " + dest.getAbsolutePath());

    // String complexCommand[]={"-y","-i",mStrImagePath,"-i",mStrVideoPath,"-filter_complex","[0]scale=720:1280:force_original_aspect_ratio=decrease,drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max: (ow-iw)/2:(oh-ih)/2,setsar=1[backd],[backd][1] overlay=x=(main_w-overlay_w)/(main_w-overlay_w):y=(main_h-overlay_h)","-acodec","copy",dest.getAbsolutePath()};

    String complexCommand[]={"-y","-i",mStrVideoPath,"-f","lavfi","-i","color=c=black:s=1920x1080","-filter_complex","[0:v]scale=w=0.80*iw:h=0.80*ih[scaled],[1:v][scaled]overlay=x=0.10*main_w:y=0.10*main_h:eof_action=endall[out]","-acodec","copy",dest.getAbsolutePath()};


    // String complexCommand[]={"-y","-i",mStrImagePath,"-i",mStrVideoPath,"-filter_complex","[1:v] scale=200:200 [ovr1], [1:v] scale=200:200 [ovrl2], [0:v][ovr1] overlay=25:25:enable='between(t,0,20)' [temp1], [temp1][ovrl2] overlay=50:50:enable='between(t,20,40)'","-acodec","copy",dest.getAbsolutePath()};
    // String complexCommand[]={"-y","-i",mStrImagePath,"-i",mStrVideoPath,"-filter_complex","[0]scale=1024:1280:force_original_aspect_ratio=decrease,pad=1024:1280:(ow-iw)/2:(oh-ih)/2,setsar=1[backd],[backd][1] overlay=x=(main_w-overlay_w)/(main_w-overlay_w):y=(main_h-overlay_h):shortest=1","-acodec","copy",dest.getAbsolutePath()};

    /* Remove -r 1 if you want to extract all video frames as images from the specified time duration.*/
    execFFmpegBinary(complexCommand);
    }

    Issue is video showing square shape i want to crop video into rounded shape, i check almost solutions and check also FFMPEG commands , i found mask overlay on video but isn’t a proper solution

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