
Recherche avancée
Autres articles (39)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (5092)
-
h264_mp4toannexb : Stop reallocating the output buffer
14 décembre 2019, par Andreas Rheinhardth264_mp4toannexb : Stop reallocating the output buffer
Up until now, h264_mp4toannexb would grow the output packet's buffer by
the desired amount every time another NAL unit of the input packet has
been read ; this commit changes this : The input buffer is now essentially
parsed twice, once to determine the final size of the output packet and
once to write the output packet's data.Fixes : Timeout
Fixes : 19322/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_MP4TOANNEXB_fuzzer-5688407821123584Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Non stop stream to rtmp with FFMPEG
13 février 2020, par Надежда ПеременI want to stream to RTMP with FFMPEG. I need to dynamically change next play file, for that i use web urls for my localhost.
I have PHP file located : http://127.0.0.1/mp3.php
$file = '1.mp3';
$mime_type = "audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3";
if(file_exists($file)){
header('Content-type: {$mime_type}');
header('Content-length: ' . filesize($file));
header('Content-Disposition: filename="' . $file);
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($file);
}else{
header("HTTP/1.0 404 Not Found");
}And i run ffmpeg with this command line :
ffmpeg -re -stream_loop -1 -i logo.png -stream_loop -1 -i http://127.0.0.1/mp3.php -ab 320k -c:v libx264 -f flv "rtmp://ms......."
This works, but it playing only once time and FFMPEG returns an error :
Seek to start failed
http://127.0.0.1/mp3.php: Function not implementedHow can i fix it ?
-
How to start and stop saving video frames according to a trigger with OpenCV VideoWriter
11 août 2021, par Jacob nighForI am building an app that records frames from IP camera through RTSP.



My engine is in charge to save a video in mp4 with Opencv VideoWriter working well.
What I am looking for is to create a startRecord and a stopRecord class method that will respectively start and stop recording according to a trigger (it could be an argument that I pass to the thread).
Is anyone know what the best way to do that kind of stuff ?



Here is my class :



from threading import Thread
import cv2
import time
import multiprocessing
import threading
class RTSPVideoWriterObject(object):
 def __init__(self, src=0):
 # Create a VideoCapture object
 self.capture = cv2.VideoCapture(src)

 # Start the thread to read frames from the video stream
 self.thread = Thread(target=self.update, args=())
 self.thread.daemon = True
 self.thread.start()

 def update(self):
 # Read the next frame from the stream in a different thread
 while True:
 if self.capture.isOpened():
 (self.status, self.frame) = self.capture.read()

 def endRecord(self):
 self.capture.release()
 self.output_video.release()
 exit(1)

 def startRecord(self,endRec):

 self.frame_width = int(self.capture.get(3))
 self.frame_height = int(self.capture.get(4))
 self.codec = cv2.VideoWriter_fourcc(*'mp4v')
 self.output_video = cv2.VideoWriter('fileOutput.mp4', self.codec, 30, (self.frame_width, self.frame_height))
 while True: 
 try:
 self.output_video.write(self.frame)
 if endRec:
 self.endRecord()
 except AttributeError:
 pass




if __name__ == '__main__':

 rtsp_stream_link = 'rtsp://foo:192.5545....'
 video_stream_widget = RTSPVideoWriterObject(rtsp_stream_link)

 stop_threads = False
 t1 = threading.Thread(target = video_stream_widget.startRecord, args =[stop_threads]) 
 t1.start() 
 time.sleep(15)
 stop_threads = True





As you can see in the main I reading frames and store them in a separate thread. Then I am starting to record (record method is with an infinite loop so blocking) and then after 15 sec, I am trying to pass a 'stop_record' argument to stop recording properly.



A part of the code comes from Storing RTSP stream as video file with OpenCV VideoWriter



Is someone have an idea ?
I read a lot that OpenCV can be very tricky for multithreading



N.