Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (47)

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

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (4132)

  • How to fetch video frame and its timestamp from ffmpeg to python code

    14 février 2017, par vijiboy

    Searching for an alternative as OpenCV would not provide timestamps which were required in my computer vision algorithm, I found this excellent article https://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/
    Working up the code on windows I still could’nt get the frame timestamps.
    I recollected seeing on ffmpeg forum somewhere that the video filters like showinfo are bypassed when redirected.

    Here’s what I tried :

    import subprocess as sp
    import numpy
    import cv2

    command = [ 'ffmpeg',
               '-i', 'e:\sample.wmv',
               '-pix_fmt', 'rgb24',
               '-vcodec', 'rawvideo',
               '-vf', 'showinfo', # video filter - showinfo will provide frame timestamps
               '-an','-sn', #-an, -sn disables audio and sub-title processing respectively
               '-f', 'image2pipe', '-'] # we need to output to a pipe

    pipe = sp.Popen(command, stdout = sp.PIPE, stderr = sp.STDOUT) # TODO someone on ffmpeg forum said video filters (e.g. showinfo) are bypassed when stdout is redirected to pipes???

    for i in range(10):
       raw_image = pipe.stdout.read(1280*720*3)
       img_info = pipe.stdout.read(244) # 244 characters is the current output of showinfo video filter
       print "showinfo output", img_info
       image1 =  numpy.fromstring(raw_image, dtype='uint8')
       image2 = image1.reshape((720,1280,3))  

       # write video frame to file just to verify
       videoFrameName = 'Video_Frame{0}.png'.format(i)
       cv2.imwrite(videoFrameName,image2)

       # throw away the data in the pipe's buffer.
       pipe.stdout.flush()

    So how to still get the frame timestamps from ffmpeg into python code so that it can be used in my computer vision algorithm ...

  • OpenCV 4.5.2 VideoWriter produces “can't find starting number” error

    28 avril 2021, par Peter Kronenberg

    There are several issues with similar names, but none of them seem to have a definitive answer. Using the last version of OpenCV 4.5.2 with Java on Windows 10. Below is a short reproducible test case which results in

    


    [ERROR:0] global C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap.cpp (589) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.5.2) C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): C:/testfiles/output.avi in function 'cv::icvExtractPattern'


    


    Here is the code :

    


    public class OpenCVError {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        final int fourcc = VideoWriter.fourcc('m', 'j', 'p', 'g');
        final double fps = 30.00;
        Size frameSize = new Size(1080, 1920);
        VideoWriter videoWriter = new VideoWriter("C:/testfiles/output.avi", fourcc, fps, frameSize, true);
    }
}


    


    Update

    


    Found out from https://forum.opencv.org/t/error-in-java-cant-find-starting-number-in-the-name-of-file/3014 that I seem to be missing opencv_videoio_ffmpeg452_64.dll
I am using the Maven distribution at

    


      <dependency>&#xA;            <groupid>org.openpnp</groupid>&#xA;            <artifactid>opencv</artifactid>&#xA;            <version>4.5.1-2</version>&#xA;  </dependency>&#xA;

    &#xA;

    which doesn't appear to have this file. I tried adding the file to my classpath (using IntelliJ), but it still doesn't seem to work.

    &#xA;

    Anyone have any ideas ? Why isn't this file part of the openpnp distribution ?

    &#xA;

  • Streaming Video from RTMP to EMGUCV

    22 juillet 2017, par Isuru

    I’m trying to stream a webcam using RTMP to an EMGUCV project in order to process the video. I have set up a private RTMP server in a linux box using this tutorial,
    https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/

    I’m testing the webcam stream using ffmpeg with the following commands,

    • Write to the rtmp server using,

      ffmpeg -y -f vfwcap -framerate 25 -video_size 640x480 -i 0 -an -f flv rtmp://rtmp-server:1935/live/stream
    • Read from the rtmp server using,
      ffplay -fflags nobuffer rtmp ://rtmp-server:1935/live/stream -loglevel verbose

    I’m able to write a simple OpenCV C++ application to read the stream and display it. Code below,

       cv::VideoCapture vcap;
       cv::Mat image;
       const std::string videoStreamAddress = "rtmp://rtmp-server:1935/live/stream";
       if(!vcap.open(videoStreamAddress)) {
           printf("Error opening video stream or file");
           return -1;
       }

       cv::namedWindow("Output Window");
       cv::Mat edges;
       for(;;) {
           if(!vcap.read(image)) {
               printf("No frame");
               cv::waitKey();
           }
           cv::imshow("Output Window", image);
           if(cv::waitKey(1) >= 0) break;
       }
    return 0;

    The above code works properly. However when I try it using EMGUCV C#, I get the error message
    unable to create to capture from rtmp://rtmp-server:1935/live/stream

    This is my C# Code,

       public partial class MainForm : Form
       {
           private static Capture _cameraCapture;

           public MainForm()
           {
               InitializeComponent();
               Run();
           }

           void Run()
           {
               try
               {
                   _cameraCapture = new Capture("rtmp://192.168.56.101:1935/live/stream");                
               }
               catch (Exception e)
               {
                   MessageBox.Show(e.Message);
                   return;
               }            
           }
      }

    Do I need a specific build of EMGUCV with FFMPEG or is RTMP capturing not available in EMGUCV ?