Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (41)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

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

  • Reading images from AXIS ip camera using OpenCV

    14 juin 2016, par batuman

    I am trying to access AXIS IP camera from my program using OpenCV.
    My OpenCV version is 3.1. I follow this tutorial link.

    I have all libraries installed.
    My following program can load mp4 video successfully. That means ffmpeg and necessary libraries are working fine.

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

    using namespace std;
    int main() {
       cv::VideoCapture vcap("test.mp4");
       cv::Mat image;
    //    const string address = "rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1";
    //    if(!vcap.open(address)){
    //      std::cout &lt;&lt; "Error opening video stream or file " &lt;&lt; std::endl;
    //      return -1;
    //    }
       for(;;){
           if(!vcap.read(image)){
               std::cout &lt;&lt; "No frame" &lt;&lt; std::endl;
               cv::waitKey(0);
           }
           cv::imshow("Display", image);
           cv::waitKey(1);
       }
       return 0;
    }
    </iostream>

    When I tried to access the IP Camera as follow

    cv::VideoCapture vcap("rtsp://root:pass@192.168.0.90/axis-media/media.amp?camera=1");

    I have the following error

    GStreamer Plugin: Embedded video playback halted; module source reported: Could
    not open resource for reading and writing.
    OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
    ) in cvCaptureFromCAM_GStreamer, file /home/Softwares/opencv/opencv/modules
    /videoio/src/cap_gstreamer.cpp, line 818
    terminate called after throwing an instance of 'cv::Exception'
     what():  /home/Softwares/opencv/opencv/modules/videoio/src/cap_gstreamer.
    cpp:818: error: (-2) GStreamer: unable to start pipeline
    in function cvCaptureFromCAM_GStreamer

    User is root and password is pass and ip 192.168.0.90 are all defaults.

    My if config gave me

    ifconfig
    eth0      Link encap:Ethernet  HWaddr b8:2a:72:c6:b8:13  
             inet6 addr: fe80::ba2a:72ff:fec6:b813/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             RX packets:723959 errors:0 dropped:0 overruns:0 frame:0
             TX packets:116637 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:199422245 (199.4 MB)  TX bytes:13701699 (13.7 MB)

    lo        Link encap:Local Loopback  
             inet addr:127.0.0.1  Mask:255.0.0.0
             inet6 addr: ::1/128 Scope:Host
             UP LOOPBACK RUNNING  MTU:65536  Metric:1
             RX packets:24829 errors:0 dropped:0 overruns:0 frame:0
             TX packets:24829 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:0
             RX bytes:2502903 (2.5 MB)  TX bytes:2502903 (2.5 MB)

    wlan0     Link encap:Ethernet  HWaddr a0:a8:cd:99:92:60  
             UP BROADCAST MULTICAST  MTU:1500  Metric:1
             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    What could be the problem for this access to the camera ?

    Thanks

  • Raspberry / Nginx RTMP video streaming player

    28 mai 2016, par Emmanuel Brunet

    I’ve set up a Nginx RTMP server that receives a flv stream from a raspberry cam using raspivid and avconv (ffmpeg)

    on the pi side I run

    /opt/vc/bin/raspivid -n -fl -mm matrix -w 800 -h 600 -fps 25 -g 80 -t 0 -b 6000000 -o - | avconv -re -i - -nostats -c copy -f flv rtmp://mercure/cam/live

    note : the target host is called mercure

    the Nginx rtmp module on mercure is set like bellow

    rtmp {
       server {
           listen 1935;
           # chunk_size 8192; # This might positively affect CPU load
           chunk_size 4096;

           application cam {

                   # max_connections 100;
                   live on;
                   # meta copy;
                   allow play all;

                   record all;
                   record_path /var/CCTV;
                   record_interval 1800s;
                   record_suffix -%Y-%m-%d-%T.flv;

                   hls on;
                   # hls_nested on;
                   hls_path /tmp/HLS;
           }
    }

    in the http section I’ve defined a hls location

       location /hls {

               root /tmp/HLS;
               types {
                       video/MP2T ts;
                       application/vnd.apple.mpegurl m3u8;
               }
       }

    when I run

    ffplay rtmp://mercure/cam/live

    it works like a charm but I can’t get it working with Vlc using the same url.

    Any idea ?

    otherwise I’m also trying to install a javascript rtmp / hls video player does anybody succeed or experienced using an open source component like flowplayer ? I’ve read a lot of doc about that but each time installs fail or some components are missing.

    please help me getting this stream available thru a web broser. thanks in advance

  • WinAPI multithreading access violation when writing in local variable

    26 février 2016, par JustPingo

    I’m making a multithreaded program using Visual C++, Win32 API (using _beginthread) that also uses FFmpeg (it is claimed to be thread-safe, and I’m using it only with one single thread anyway).

    Here is the part of my thread’s code that causes problems (everything is inside of the thread function) :

    Arena* arena = NULL;

    switch (task) {
       case TaskOne:
           arena = (Arena*) malloc(sizeof(Arena));
           for (uint i = 0; i &lt; FIGHTSPERROUND; i++) {
               generateArena(arena, ARENAWALLSAMOUNT, ARENAWIDTH, ARENAHEIGHT, ARENAMAXENTITIES, 255);
               spawnPlayer(arena, playerOne, 3, 1, 0, 0, ARENAPLAYERLIFE);
               spawnPlayer(arena, playerTwo, 2, 2, ARENAWIDTH-1, ARENAHEIGHT-1, ARENAPLAYERLIFE);

               do {
                   tickArena(arena);
               } while ((result = getResult(arena)) == 0);

               switch (result) {
                   case 1: teamOneScore++; break;
                   case 2: teamTwoScore++; break;
                   default: break;
               }

               freeArena(arena);
               clearMemory(playerOne);
               clearMemory(playerTwo);
               clearBrain(playerOne);
               clearBrain(playerTwo);
           }
           threadTeamOneScore[threadID] = teamOneScore;
           threadTeamTwoScore[threadID] = teamTwoScore;
           break;

       default: break;
    }

    Here is how I generate my arena :

    void generateArena(Arena* arena, uint wallsAmount, uint xSize, uint ySize, uint maxEntities, uint maxTurns) {
       CasesTypes** map;
       map = (CasesTypes**) malloc(xSize * sizeof(CasesTypes*));
       memset(map, 0, xSize * sizeof(CasesTypes*));
       for (uint i = 0; i &lt; xSize; i++) {
           map[i] = (CasesTypes*)malloc(ySize * sizeof(CasesTypes));
           memset(map[i], 0, ySize * sizeof(CasesTypes));
       }

       arena->map = map;
       arena->entities = (Entity*) malloc(maxEntities * sizeof(Entity));
       memset(arena->entities, 0, maxEntities * sizeof(Entity));
       arena->width = xSize;
       arena->height = ySize;
       arena->maxEntities = maxEntities;
       arena->maxTurns = maxTurns;
       arena->currentTurn = 0;
       arena->entitiesAmount = 0;
       for (uint i = 0; i &lt; wallsAmount; i++)
           arena->map[random2(1, xSize-1)][random2(1, ySize-1)] = Wall;
    }

    This works as expected 4 times in 5.
    But sometimes, for some reason, arena = (Arena*) malloc(sizeof(Arena)); throws an access violation exception.

    For example, Visual Studio 2015’s debugger once said :
    Exception thrown at 0x77DBE389 (ntdll.dll) in MyProgram.exe: 0xC0000005: Access violation writing location 0x007C160F.

    When I used the debugger to find what ((void*) 0x007C160F) was, it always happened to be something similar to :

    avformat-57.dll!0x007c160f (load symbols for additional information)

    avformat is a part of FFmpeg. The address was different every times, but it always had something to do with FFmpeg.

    I can’t figure out what is causing the problem.
    If that can help, sometimes the arena also happens to get corrupted (some of its fields get extremely big while generating them with generateArena although it is never changed and only set once to an integer, this leads to a crash later).

    Thank you in advance !