
Recherche avancée
Autres articles (108)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (6646)
-
Running pulseaudio inside docker container to record system audio
20 mars 2023, par XXLuigiMarioI'm trying to set up a Docker container with Selenium that takes a recording of the browser with system audio using ffmpeg. I've got video working using Xvfb. Unfortunately, on the audio side, it seems to be more tricky.


I thought I would set up a virtual pulseaudio sink inside the container, which would allow me to record its monitor :


pacmd load-module module-null-sink sink_name=loopback
pacmd set-default-sink loopback
ffmpeg -f pulse -i loopback.monitor test.wav



This works on my host operating system, but when trying to start the pulseaudio daemon in a container, it fails with the following message :


E: [pulseaudio] module-console-kit.c: Unable to contact D-Bus system bus: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory



This would seem to be related to a freedesktop service called dbus. I've tried installing it and starting its daemon, but I couldn't seem to get it to work properly.
I couldn't find much information on how to proceed from here. What am I missing for pulseaudio ? Perhaps there's an easier way to record the system audio inside a container ?


My goal is not to record it from the host operating system, but to play the audio inside the browser and record it all inside the same container.


-
how to make cv2.videoCapture.read() faster ?
9 novembre 2022, par Yu-Long TsaiMy question :



I was working on my computer vision project. I use opencv(4.1.2) and python to implement it.



I need a faster way to pass the reading frame into image processing on my Computer(Ubuntu 18.04 8 cores i7 3.00GHz Memory 32GB). the
cv2.VideoCapture.read()
read frame (frame size : 720x1280) will take about 120 140ms. which is too slow. my processing module take about 40ms per run. And we desire 25 30 FPS.


here is my demo code so far :



import cv2
from collections import deque
from time import sleep, time
import threading


class camCapture:
 def __init__(self, camID, buffer_size):
 self.Frame = deque(maxlen=buffer_size)
 self.status = False
 self.isstop = False
 self.capture = cv2.VideoCapture(camID)


 def start(self):
 print('camera started!')
 t1 = threading.Thread(target=self.queryframe, daemon=True, args=())
 t1.start()

 def stop(self):
 self.isstop = True
 print('camera stopped!')

 def getframe(self):
 print('current buffers : ', len(self.Frame))
 return self.Frame.popleft()

 def queryframe(self):
 while (not self.isstop):
 start = time()
 self.status, tmp = self.capture.read()
 print('read frame processed : ', (time() - start) *1000, 'ms')
 self.Frame.append(tmp)

 self.capture.release()

cam = camCapture(camID=0, buffer_size=50)
W, H = 1280, 720
cam.capture.set(cv2.CAP_PROP_FRAME_WIDTH, W)
cam.capture.set(cv2.CAP_PROP_FRAME_HEIGHT, H)


# start the reading frame thread
cam.start()

# filling frames
sleep(5)

while True:
 frame = cam.getframe() # numpy array shape (720, 1280, 3)

 cv2.imshow('video',frame)
 sleep( 40 / 1000) # mimic the processing time

 if cv2.waitKey(1) == 27:
 cv2.destroyAllWindows()
 cam.stop()
 break





What I tried :



- 

-
multiThread - one thread just reading the frame, the other do the image processing things.
It's NOT what I want. because I could set a buffer deque saving 50 frames for example. but the frame-reading thread worked with the speed frame/130ms. my image processing thread worked with the speed frame/40ms. then the deque just running out. so I've been tried the solution. but not what I need.
-
this topic is the discussion I found out which is most closest to my question. but unfortunately, I tried the accepted solutions (both of two below the discussion).







One of the solution (6 six thumbs up) point out that he could reading and saving 100 frames at 1 sec intervals on his mac. why my machine cannot handle the frame reading work ? Do I missing something ? my installation used conda and pip
conda install -c conda-forge opencv
,pip install opencv-python
(yes, I tried both.)


The other of the solution(1 thumb up) using ffmpeg solution. but it seem's work with video file but not camera device ?



- 

- adjust c2.waitKey() : 
the parameter just controls the frequency when video display. not a solution.





Then, I know I just need some keywords to follow.



code above is my demo code so far, I want some method or guide to make me videoCapture.read() faster. maybe a way to use multithread inside videoCapture object or other camera reading module.



Any suggestions ?


-
-
Loss packets from RTP streaming decoded with ffmpeg
29 avril 2020, par anaVC94Hope someone could help me. I am trying to apply a neural network (YOLOv2) to perform object detection to a RTP stream which I have simulated in local using VLC, with the "using RTP over TCP" mark as true.
The stream is 4K, 30fps, 15Mb/s. I am using OpenCV C API I/O module to read frames from the stream.



I am using the common code. I open the RTP as follows :

cap = cvCaptureFromFile(url);



And then I perform capture in one thread like :

IplImage* src = cvQueryFrame(cap);



and, on another thread, the detection part.



I know OpenCV uses ffmpeg to capture video. I am using ffmpeg 3.3.2. My problem is that when I receive the stream, a lot of artifacts appear. The output I get is :



top block unavailable for requested intra mode -1
[h264 @ 0000016ae36f0a40] error while decoding MB 40 0, bytestream 81024
[h264 @ 0000016ae32f3860] top block unavailable for requested intra mode
[h264 @ 0000016ae32f3860] error while decoding MB 48 0, bytestream 102909
[h264 @ 0000016ae35e9e60] Reference 3 >= 3
[h264 @ 0000016ae35e9e60] error while decoding MB 79 0, bytestream 27231
[h264 @ 0000016a7033eb40] mmco: unref short failure
[h264 @ 0000016ae473ee00] Reference 3 >= 3




over and over again, and there are too many packet losses that I can't see anything when showing the received frames. However, it doesn't happen to me when I stream over RTP other lower quality videos such as HD in 30fps or like that. It is also true that the 4K has a lot of movement (it is a Moto GP Race).



I have tried :
- Reduce the fps of the streaming.
- Reduce the bitrate 
- ffplay either doesn't show correctly the input frames, but VLC does (don't know why).
- Force TCP transmission.
- Force input fps doing
cvSetCaptureProperty(cap, CV_CAP_PROP_FPS, 1);



Why is this happening and how can I improve the packet losses ? Is there any way or something else I can try ?



Thanks a lot