
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (105)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip 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, parPHP 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, parEcrivez 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 skrI am trying to capture an
RTSP
stream from a VIRB 360 camera, intoOpenCV
. The video isH264
and according to one of the comments here,OpenCV 3.4
should be able to handle it. Here is the code :


#include <iostream>
#include <opencv2></opencv2>core.hpp>
#include <opencv2></opencv2>highgui.hpp>
#include <opencv2></opencv2>imgproc.hpp>
#include <opencv2></opencv2>videoio.hpp>

int main()
{
 cv::VideoCapture cap("rtsp://192.168.0.1/livePreviewStream?maxResolutionVertical=720&liveStreamActive=1", cv::CAP_FFMPEG);

 if(!cap.isOpened())
 { 
 std::cout << "Input error\n";
 return -1;
 }

 cv::namedWindow("Video Feed", cv::WINDOW_AUTOSIZE);

 cv::Mat frame;
 for(;;)
 {
 //std::cout << "Format: " << cap.get(CV_CAP_PROP_FORMAT) << "\n";
 cap >> frame;
 cv::imshow("Video Feed", frame); 
 if (cv::waitKey(10) == 27)
 {
 break;
 }
 } 
 cv::destroyAllWindows();
 return 0;
}
</iostream>



I have compiled
OpenCV
withffmpeg
andgstreamer
capabilities. When I run the followingGstreamer
command, I am able to stream it, but with a delay of 3 seconds (not acceptable) :


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




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


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




or



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




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


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




gives the error :



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




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


Edit 1 :
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&liveStreamActive=1", cv::CAP_FFMPEG);
the code now has :


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

#if WIN32
 _putenv_s("OPENCV_FFMPEG_CAPTURE_OPTIONS", "");
#else
 unsetenv("OPENCV_FFMPEG_CAPTURE_OPTIONS");
#endif




However, it throws the following errors :



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




which means the video is sometimes glitchy and looks like :



I believe it has something to do with :



setenv("OPENCV_FFMPEG_CAPTURE_OPTIONS", "rtsp_transport;udp", 1);




I would appreciate any suggestions or improvements. Thank You.


-
Background version of uploaded video creation in Elixir with Arc and FFmpeg
12 décembre 2017, par LevitI 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}
endHowever, 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. PI am working on a project where I am using
FFMPEG
to capture video. TheFFMPEG
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 &
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 &
Here the command is not accepted as
eval
andexec
is one after another, so it takesexec
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
andWindows 7
.