
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (69)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (7119)
-
fftools/ffmpeg_filter : stop accessing OutputStream.[max_]frame_rate
12 septembre 2024, par Anton Khirnovfftools/ffmpeg_filter : stop accessing OutputStream.[max_]frame_rate
Pass them to ofilter_bind_ost() via OutputFilterOptions, as is done for
most other data it needs. OutputStream.[max_]frame_rate/force_fps are no
longer used outside of ffmpeg_mux*, and so can be made private.This is a step toward decoupling encoders from muxers.
-
Jquery auto-refresh stop refreshing after 10seconds
11 février 2016, par Mick JackI have this JQuery script to auto refresh every 2seconds after a video is uploaded and retrieve the estimated time needed to process the video with ffmpeg
However my refresh script stop refreshing after 10-15seconds. i traced the problem to the session_start() ; when i remove this session_start() ; my refresh script work perfectly. what could be the cause and solution here ?
videoupload.php
<div title="test">
<h5>Encoding percentage</h5>
<code class="echappe-js"><script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script><script><br />
$("#Submit").click(function(event){<br />
setInterval(function(){<br />
$("#myDiv").load('progress.php')<br />
}, 2000);<br />
});<br />
</script>Progress.php
<?php
$content = @file_get_contents('logfile.txt');
if($content){
//get duration of source
preg_match("/Duration: (.*?), start:/", $content, $matches);
$rawDuration = $matches[1];
//rawDuration is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawDuration));
$duration = floatval($ar[0]);
if (!empty($ar[1])) $duration += intval($ar[1]) * 60 ;
if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60 * 60;
//get the time in the file that is already encoded
preg_match_all("/time=(.*?) bitrate/", $content, $matches);
$rawTime = array_pop($matches);
//this is needed if there is more than one match
if (is_array($rawTime)){$rawTime = array_pop($rawTime);}
//rawTime is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawTime));
$time = floatval($ar[0]);
if (!empty($ar[1])) $time += intval($ar[1]) * 60;
if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;
//calculate the progress
$progress = round(($time/$duration) * 100);
echo "Duration: " . $duration . "<br />";
echo "Current Time: " . $time . "<br />";
echo "Progress: " . $progress . "%";
}
?>upload.php
session_start();
$userID = $_SESSION['login_user'];
// rest of the code to convert video using ffmpeg
How to start and stop saving video frames according to a trigger with OpenCV VideoWriter
I 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.