
Recherche avancée
Autres articles (100)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
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" (...)
Sur d’autres sites (13866)
-
php ffmpeg pipe multicast issue
15 septembre 2024, par cihan ranxI have four video in my server. I want to display all of them same page but video tag url is a php page.
Actually it is working. But when i tried to open new tab again index.php then display only 2 video. When waiting to long display all of them. Why i must to waiting and why server take long time to response ? I have ubuntu 20.04 and 8gb ram. If you copy link and open it multiple tab same time you will see the issue.


Video Link is :
index.php


index.php



<video src="test.php?video_name=1.mp4" type="video/mp4" autoplay="autoplay" class="video"></video>
<video src="test.php?video_name=2.mp4" type="video/mp4" autoplay="autoplay" class="video"></video>
<video src="test.php?video_name=3.mp4" type="video/mp4" autoplay="autoplay" class="video"></video>
<video src="test.php?video_name=4.mp4" type="video/mp4" autoplay="autoplay" class="video"></video>




test.php


<?
$video_name=$_GET['video_name'];
header('Content-type: video/mp4');
passthru('ffmpeg -i '.$video_name.'.mp4 -c copy -movflags frag_keyframe+empty_moov+faststart -f mp4 pipe:');
exit();
?>



If close one of tab display all. I think ffmpeg or passthru function make server busy. It must be opened all tab without waiting. It is very importing for me. I developed online camera view system and serving to html with passthru and ffmpeg. But if user open multiple tab server not responding or take long time.


-
How to read data from subprocess pipe ffmpeg without block in line when rtsp is disconnected
22 août 2024, par Jester48I have some problems with the ffmpeg subprocess in python where I open an RTSP stream.
One of them is the long time of reading a frame from the pipe, I noticed that reading one frame takes about 250ms -> most of this time is the select.select() line which can take just that long. This makes opening the stream above 4FPS problematic. When I do not use the select.select function, the reading speed is normal, but when the connection to RTSP streams is lost, the program gets stuck in the self.pipe.stdout.read() function and does not exit from it. Is it possible to protect yourself in case of missing data in pipe.stdout.read() without losing frame reading speed as in the case of select.select() ?


class RTSPReceiver(threading.Thread):
 def __init__(self):
 threading.Thread.__init__(self)
 self.ffmpeg_cmd = ['ffmpeg','-loglevel','quiet','-rtsp_transport' ,'tcp','-nostdin','-i',f'rtsp://{config("LOGIN")}:{config("PASS")}@{config("HOST")}/stream=0','-fflags','nobuffer','-flags','low_delay','-map','0:0','-r',f'{config("RTSP_FPS")}','-f','rawvideo','-pix_fmt','bgr24','-']
 self.img_w = 2688
 self.img_h = 1520
 self.image = None
 self.pipe = subprocess.Popen(self.ffmpeg_cmd, stdout=subprocess.PIPE)

 def reconnect(self) -> None:
 if self.pipe:
 self.pipe.terminate()
 self.pipe.kill()
 self.pipe.wait()

 def run(self) -> None:
 self.connect()
 while True:
 try:
 ready, _, _ = select.select([self.pipe.stdout], [], [], 15.0)
 if ready:
 raw_image = self.pipe.stdout.read(self.img_w*self.img_h*3)
 if raw_image:
 with self.lock:
 self.image = np.frombuffer(raw_image, dtype=np.uint8).reshape(self.img_h, self.img_w, 3)
 else:
 self.reconnect()
 except Exception as e:
 self.connect()



-
Creating an MP4 video with ffmpeg from timestamped JPEG frames received by pipe
16 août 2024, par Denis FevralevI need to create a video with following conditions :


- 

- It can only be made from a sequence of JPEG files, each having its timestamp (milliseconds) in the name. The images' durations are not the same, they differ, so i cannot just concat them all and use particular fps
- There are several tar archives with the images sequences, the archives are kind of huge so I read them from a file storage as an async steam of data and cannot save them on the disk as files. The frames are read and right away put to ffmpeg running process stdin.
- The images may have different aspect ratios so it's required to make a NxN square and scale the images to fit in with filling the empty space with pads








My current solution :


ffmpeg -r $someFpsValue -i - -vf scale=w=$w:h=$h:force_original_aspect_ratio=1,pad=$w:$h:(((ow-iw)/2)):(((oh-ih)/2)) result.mp4



As you can see, it doesn't let me concat the images with correct durations. I know that the concat demuxer can solve the problem of merging images with different durations but seemingly it doesn't work with pipe protocol. I have an idea of evaluating an average fps as (videoFramesCount) / (videoDurationInSeconds) for
-r
argument, or maybe even counting the fps for each video's second and then getting the avg, but maybe there is a more reliable solution (like some concat demuxer analogue) ?

Thanks in advance :)