
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (58)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
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 (4954)
-
FFMpeg Playlist with pipe for streaming [on hold]
24 juillet 2017, par sword1stI’m trying to find a solution for stream multiple files without any connection breaks. I found this answer from KKetch :
I managed to stream a static playlist of videos by using for each video a pipe (ex vid1.mp4 -> pipe1, vid2.mp4 -> pipe2 etc). Then i write into a single stream named pipe "stream" this way cat pipe1 pipe2 pipe3 > stream, and i use the stream pipe as input in FFMPEG to publish my stream.
(I’m using windows. I don’t know to use named pipes. I searched a lot but i couldn’t do it. I can do it with vb.net if it’s possible. But i don’t know how :/ Sorry for my bad english)
But i can’t reply his message cuz i don’t have enough reputation. I hope someone can help me how can i use pipes for input like playlist. Thanks !
-
How to pipe Picamera video to FFMPEG with subprocess (Python)
31 juillet 2017, par VeniVidiReliquiI see a ton of info about piping a raspivid stream directly to FFMPEG for encoding, muxing, and restreaming but these use cases are mostly from bash ; similar to :
raspivid -n -w 480 -h 320 -b 300000 -fps 15 -t 0 -o - | ffmpeg -i - -f mpegts udp ://192.168.1.2:8090ffmpeg
I’m hoping to utilize the functionality of the Picamera library so I can do concurrent processing with OpenCV and similar while still streaming with FFMPEG. But I can’t figure out how to properly open FFMPEG as subprocess and pipe video data to it. I have seen plenty of attempts, unanswered posts, and people claiming to have done it, but none of it seems to work on my Pi.
Should I create a video buffer with Picamera and pipe that raw video to FFMPEG ? Can I use camera.capture_continuous() and pass FFMPEG the bgr24 images I’m using for my OpenCV calculation ?
I’ve tried all sorts of variations and I’m not sure if I’m just misunderstanding how to use the subprocess module, FFMPEG, or I’m simply missing a few settings. I understand the raw stream won’t have any metadata, but I’m not completely sure what settings I need to give FFMPEG for it to understand what I’m giving it.
I have a Wowza server I’ll eventually be streaming to, but I’m currently testing by streaming to a VLC server on my laptop. I’ve currently tried this :
import subprocess as sp
import picamera
import picamera.array
import numpy as np
npimage = np.empty(
(480, 640, 3),
dtype=np.uint8)
with picamera.PiCamera() as camera:
camera.resolution = (640, 480)
camera.framerate = 24
camera.start_recording('/dev/null', format='h264')
command = [
'ffmpeg',
'-y',
'-f', 'rawvideo',
'-video_size', '640x480',
'-pix_fmt', 'bgr24',
'-framerate', '24',
'-an',
'-i', '-',
'-f', 'mpegts', 'udp://192.168.1.54:1234']
pipe = sp.Popen(command, stdin=sp.PIPE,
stdout=sp.PIPE, stderr=sp.PIPE, bufsize=10**8)
if pipe.returncode != 0:
output, error = pipe.communicate()
print('Pipe failed: %d %s %s' % (pipe.returncode, output, error))
raise sp.CalledProcessError(pipe.returncode, command)
while True:
camera.wait_recording(0)
for i, image in enumerate(
camera.capture_continuous(
npimage,
format='bgr24',
use_video_port=True)):
pipe.stdout.write(npimage.tostring())
camera.stop_recording()I’ve also tried writing the stream to a file-like object that simply creates the FFMPEG subprocess and writes to the stdin of it (camera.start_recording() can be given an object like this when you initialize the picam) :
class PipeClass():
"""Start pipes and load ffmpeg."""
def __init__(self):
"""Create FFMPEG subprocess."""
self.size = 0
command = [
'ffmpeg',
'-f', 'rawvideo',
'-s', '640x480',
'-r', '24',
'-i', '-',
'-an',
'-f', 'mpegts', 'udp://192.168.1.54:1234']
self.pipe = sp.Popen(command, stdin=sp.PIPE,
stdout=sp.PIPE, stderr=sp.PIPE)
if self.pipe.returncode != 0:
raise sp.CalledProcessError(self.pipe.returncode, command)
def write(self, s):
"""Write to the pipe."""
self.pipe.stdin.write(s)
def flush(self):
"""Flush pipe."""
print("Flushed")
usage:
(...)
with picamera.PiCamera() as camera:
p = PipeClass()
camera.start_recording(p, format='h264')
(...)Any assistance with this would be amazing !
-
Pipe PIL images to ffmpeg stdin - Python
19 juillet 2017, par bluesummersI’m trying to convert an html5 video to mp4 video and am doing so by screen shooting through PhantomJS over time
I’m also cropping the images using PIL so eventually my code is roughly :
while time() < end_time:
screenshot_list.append(phantom.get_screenshot_as_base64())
.
.
for screenshot in screenshot_list:
im = Image.open(BytesIO(base64.b64decode(screenshot)))
im = im.crop((left, top, right, bottom))Right now I’m saving to disc all those images and using ffmpeg from saved files :
os.system('ffmpeg -r {fps} -f image2 -s {width}x{height} -i {screenshots_dir}%04d.png -vf scale={width}:-2 '
'-vcodec libx264 -crf 25 -vb 20M -pix_fmt yuv420p {output}'.format(fps=fps, width=width,
screenshots_dir=screenshots_dir,
height=height, output=output))But I want instead of using those saved files, to be able to pipe the PIL.Images directy to ffmpeg, how can I do that ?