Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (105)

  • 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

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (11294)

  • OpenCV - Streaming H264 over RTSP using FFMPEG in version 3.4

    13 novembre 2023, par skr

    I am trying to capture an RTSP stream from a VIRB 360 camera, into OpenCV. The video is H264 and according to one of the comments here, OpenCV 3.4 should be able to handle it. Here is the code :

    



    #include <iostream>&#xA;#include <opencv2></opencv2>core.hpp>&#xA;#include <opencv2></opencv2>highgui.hpp>&#xA;#include <opencv2></opencv2>imgproc.hpp>&#xA;#include <opencv2></opencv2>videoio.hpp>&#xA;&#xA;int main()&#xA;{&#xA;    cv::VideoCapture cap("rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720&amp;liveStreamActive=1", cv::CAP_FFMPEG);&#xA;&#xA;    if(!cap.isOpened())&#xA;    {   &#xA;        std::cout &lt;&lt; "Input error\n";&#xA;        return -1;&#xA;    }&#xA;&#xA;    cv::namedWindow("Video Feed", cv::WINDOW_AUTOSIZE);&#xA;&#xA;    cv::Mat frame;&#xA;    for(;;)&#xA;    {&#xA;        //std::cout &lt;&lt; "Format: " &lt;&lt; cap.get(CV_CAP_PROP_FORMAT) &lt;&lt; "\n";&#xA;        cap >> frame;&#xA;        cv::imshow("Video Feed", frame);    &#xA;        if (cv::waitKey(10) == 27)&#xA;        {&#xA;            break;&#xA;        }&#xA;    }   &#xA;    cv::destroyAllWindows();&#xA;    return 0;&#xA;}&#xA;</iostream>

    &#xA;&#xA;

    I have compiled OpenCV with ffmpeg and gstreamer capabilities. When I run the following Gstreamer command, I am able to stream it, but with a delay of 3 seconds (not acceptable) :

    &#xA;&#xA;

     gst-launch-1.0 playbin uri=rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720\&amp;liveStreamActive=1&#xA;

    &#xA;&#xA;

    On the other hand, I get a 0.5 second delay using ffplay/ffmpeg command (acceptable) :

    &#xA;&#xA;

    ffplay -fflags nobuffer -rtsp_transport udp rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720\&amp;liveStreamActive=1&#xA;

    &#xA;&#xA;

    or

    &#xA;&#xA;

    ffplay -probesize 32 -sync ext rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720\&amp;liveStreamActive=1&#xA;

    &#xA;&#xA;

    In the OpenCV code written above, using cv::CAP_FFMPEG flag in the line :

    &#xA;&#xA;

    cv::VideoCapture cap("rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720&amp;liveStreamActive=1", cv::CAP_FFMPEG);&#xA;

    &#xA;&#xA;

    gives the error :

    &#xA;&#xA;

    [rtsp @ 0x2312040] The profile-level-id field size is invalid (65)&#xA;[rtsp @ 0x2312040] method SETUP failed: 461 Unsupported transport&#xA;Input error&#xA;

    &#xA;&#xA;

    If I use cv::CAP_GSTREAMER, it throws no error, but nothing happens. I believe that the problem is that OpenCV is not able to handle UDP transport layer. What are the possible solutions ? Kindly provide suggestions.

    &#xA;&#xA;

    Edit 1 :&#xA;I was able to get capture the stream by following this. I made the following changes : instead of cv::VideoCapture cap("rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720&amp;liveStreamActive=1", cv::CAP_FFMPEG); the code now has :

    &#xA;&#xA;

    #if WIN32&#xA;    _putenv_s("OPENCV_FFMPEG_CAPTURE_OPTIONS", "rtsp_transport;udp");&#xA;#else&#xA;    setenv("OPENCV_FFMPEG_CAPTURE_OPTIONS", "rtsp_transport;udp", 1);&#xA;#endif&#xA;auto cap = cv::VideoCapture("rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720&amp;liveStreamActive=1", cv::CAP_FFMPEG);&#xA;&#xA;#if WIN32&#xA;    _putenv_s("OPENCV_FFMPEG_CAPTURE_OPTIONS", "");&#xA;#else&#xA;    unsetenv("OPENCV_FFMPEG_CAPTURE_OPTIONS");&#xA;#endif&#xA;

    &#xA;&#xA;

    However, it throws the following errors :

    &#xA;&#xA;

    [rtsp @ 0x2090580] The profile-level-id field size is invalid (65)&#xA;[rtsp @ 0x2090580] Error parsing AU headers&#xA;[h264 @ 0x208d240] error while decoding MB 69 40, bytestream -7&#xA;[rtsp @ 0x2090580] Error parsing AU headers&#xA;[rtsp @ 0x2090580] Error parsing AU headers&#xA;[h264 @ 0x2316700] left block unavailable for requested intra4x4 mode -1&#xA;[h264 @ 0x2316700] error while decoding MB 0 16, bytestream 112500&#xA;[rtsp @ 0x2090580] Error parsing AU headers&#xA;

    &#xA;&#xA;

    which means the video is sometimes glitchy and looks like : enter image description here

    &#xA;&#xA;

    I believe it has something to do with :

    &#xA;&#xA;

    setenv("OPENCV_FFMPEG_CAPTURE_OPTIONS", "rtsp_transport;udp", 1);&#xA;

    &#xA;&#xA;

    I would appreciate any suggestions or improvements. Thank You.

    &#xA;

  • Background version of uploaded video creation in Elixir with Arc and FFmpeg

    12 décembre 2017, par Levit

    I tried to make video uploading on Elixir phoenix project using Arc. I need to have different size versions of video. So I used FFmpeg to do this :

    def transform(:large, {file, scope}) do
     {:ffmpeg, fn(input, output) -> "-i #{input} -c:a copy -s 1920x1080 -f mp4 #{output}" end, :mp4}
    end

    However, it takes a lot of time to create this versions even to small videos. So, I decided to make version creation on background. I want Arc to upload video, then I give the response with uploaded original while other versions are creating.

    I was hoping to find such option at https://github.com/stavro/arc but I didn’t succed. I only found "To disable asynchronous processing, add @async false to your upload definition" but I don’t want to disable it, right ?

    I tried to use Exq https://github.com/akira/exq for background processing but I didn’t menage to use it in uploader.

    Could anybody tell me how it should be made in a proper way or give me some dirty hack advice to make it work. Thanks.

    I tried Task as was advised in comments, but I am not sure how to use them in this case. When I try

    {:ffmpeg, fn(input, output) -> Task.async(fn -> "-i #{input} -c:a copy -s 1920x1080 -f mp4 #{output}" end) end, :mp4}

    or

    {:ffmpeg, Task.async(fn -> fn(input, output) ->  "-i #{input} -c:a copy -s 1920x1080 -f mp4 #{output}" end end), :mp4}

    I got "protocol String.Chars not implemented for %Task".

    When I try

    {:ffmpeg, Task.async(fn(input, output) ->  "-i #{input} -c:a copy -s 1920x1080 -f mp4 #{output}" end), :mp4}

    I got "#Function<20.83953603/2 in MyWebSite.Content.transform/2> with arity 2 called with no arguments". I tried to pass function as an argument with "&" but it fails as well.

    My uploader :

    defmodule MyWebSite.Content do
    use Arc.Definition
    use Arc.Ecto.Definition

    @acl :public_read

    @versions [:original,  :huge]

    def transform(:huge, {file, scope}) do
     {:ffmpeg, Task.async(fn(input, output) ->  "-i #{input} -c:a copy -s 1920x1080 -f mp4 #{output}" end), :mp4}
    end

    def s3_object_headers(version, {file, scope}) do
     [timeout: 3_000_00, content_type: Plug.MIME.path(file.file_name)]
    end
    end
  • How to make use of "&" command in TCL version 8.0 to make a proc or exec command run in background i.e in parallel on windows 7 ?

    21 novembre 2017, par M. D. P

    I am working on a project where I am using FFMPEG to capture video. The FFMPEG command is :

    ffmpeg -f dshow  -t 00:00:10 -i "video=Integrated Webcam" -b 5000k -s 1280x720 c:/test/sample.avi

    The link : https://www.tcl.tk/man/tcl8.5/tutorial/Tcl26.html make the use of the command :

    exec myprog &amp;

    Here they have not specified what is myprog.

    The link : Running shell commands in background, in a tcl proc make the use of command :

    eval exec [linsert $args 0 exec] >> $tempFile &amp;

    Here the command is not accepted as eval and exec is one after another, so it takes exec as a variable.

    Help me, with the write right command which can be used to capture my video in the background with TCL version 8.0 and Windows 7.