
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (23)
-
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" (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (5798)
-
Setting up multi webcam streaming
28 septembre 2013, par Moritz Mädlerwe are currently planning to connect all our offices via webcams selectable from a website. So I guess the setup could be something like this :
Webcam 1 \
Webcam 2 - > Streamserver -> Webserver displaying html5 Video
Webcam n /I've made first tests from streaming from Windows using VLC to a central ffserver, but the results where rather bad (after 1-2 frames the stream stopped).
Do you have any suggestions on
which stream software I can use on the client/webcam site (Linux or Windows)
which software I can use on the server side (Linux) for collecting and recoding streams ?
Thanks,
Moritz
-
Gstreamer Multiple Source with Single Sink Implementation in PythonGST
11 octobre 2018, par biswajitGhoshI’m new to Gstreamer as well as Python-GST also. I have to collect multiple source raw video stream data into a single sink, I don’t know, if it is possible or not.
Lets explain more my scenario :
I have 2 video source server for now, one is my webcam and another is just an mp4 file, I did open those source using following command
Source1 :
gst-launch-1.0 v4l2src device=/dev/video0 !
’video/x-raw,width=640,height=480’ ! x264enc pass=qual quantizer=20
tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5000Source2 :
gst-launch-1.0 filesrc location = file_name.mp4 !
’video/x-raw,width=640,height=480’ ! x264enc pass=qual quantizer=20
tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=5000I’m trying to send both stream data to localhost 5000 port after encoding with H264.
For receiving I have a Python Sink Server like this :
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstApp', '1.0')
from gi.repository import GObject, Gst, GstApp
GObject.threads_init()
Gst.init(None)
GST_DEBUG="6"
class Example:
def __init__(self):
self.mainloop = GObject.MainLoop()
self.pipeline = Gst.Pipeline.new("Pipeline")
self.bus = self.pipeline.get_bus()
self.bus.add_signal_watch()
self.bus.connect("message", self.on_message)
# self.bus.connect('message::eos', self.on_eos)
# self.bus.connect('message::error', self.on_error)
# self.bus.connect("sync-message::element", self.on_sync_message)
#Create QUEUE elements
self.queue1 = Gst.ElementFactory.make("queue", None)
self.queue2 = Gst.ElementFactory.make("queue", None)
# Create the elements
self.source = Gst.ElementFactory.make("udpsrc", None)
self.depay = Gst.ElementFactory.make("rtph264depay", None)
self.parser = Gst.ElementFactory.make("h264parse", None)
self.decoder = Gst.ElementFactory.make("avdec_h264", None)
self.sink = Gst.ElementFactory.make("appsink", None)
# Add elements to pipeline
self.pipeline.add(self.source)
self.pipeline.add(self.queue1)
self.pipeline.add(self.depay)
self.pipeline.add(self.parser)
self.pipeline.add(self.decoder)
self.pipeline.add(self.queue2)
self.pipeline.add(self.sink)
# Set properties
self.source.set_property('port', 5000)
self.source.set_property('caps', Gst.caps_from_string("application/x-rtp, encoding-name=H264,payload=96"))
self.sink.set_property('emit-signals', True)
# turns off sync to make decoding as fast as possible
self.sink.set_property('sync', False)
self.sink.connect('new-sample', self.on_new_buffer, self.sink)
def on_new_buffer(self, appsink, data):
print "exec two..."
appsink_sample = GstApp.AppSink.pull_sample(self.sink)
# with open('example.h264', 'a+') as streamer:
buff = appsink_sample.get_buffer()
size, offset, maxsize = buff.get_sizes()
frame_data = buff.extract_dup(offset, size)
print(size)
# flag, info = buff.map(Gst.MapFlags.READ)
# streamer.write(info.data)
# print(info.size)
return False
def run(self):
ret = self.pipeline.set_state(Gst.State.PLAYING)
if ret == Gst.StateChangeReturn.FAILURE:
print("Unable to set the pipeline to the playing state.")
exit(-1)
self.mainloop.run()
def kill(self):
self.pipeline.set_state(Gst.State.NULL)
self.mainloop.quit()
def on_eos(self, bus, msg):
print('on_eos()')
self.kill()
def on_error(self, bus, msg):
print('on_error():', msg.parse_error())
self.kill()
def on_message(self, bus, message):
t = message.type
if t == Gst.MessageType.EOS:
print "End of Stream :("
self.kill()
elif t == Gst.MessageType.ERROR:
err, debug = message.parse_error()
print "Error: %s" % err, debug
self.kill()
def on_sync_message(self, bus, message):
print message.src
example = Example()
example.run()Firstly AppSink callback does not working, I don’t know why ? I think I have to make that configuration correct into Python Code. Can any one please help to figure it out ?
Secondly when I tried with FFMpeg and FFPlay I got so many H264 encoding issues like this :
Main confusion is Can GStreamer handle Multiple Source data into a single sink(I need to distinguished each video frame).
Thanks a lot.
-
Http server live streaming in python
8 juillet 2015, par George SubiI want to send the live output of ffmpeg command to every GET request, but I’m novice in python and can’t solve it. This is my code :
import subprocess # for piping
from http.server import HTTPServer, BaseHTTPRequestHandler
class RequestHandler(BaseHTTPRequestHandler):
def _writeheaders(self):
self.send_response(200) # 200 OK http response
self.send_header('Connection', 'keep-alive')
self.send_header('Content-Type', 'video/mp4')
self.send_header('Accept-Ranges', 'bytes')
self.end_headers()
def do_GET(self):
self._writeheaders()
global p
DataChunkSize = 10000
print("starting polling loop.")
while(p.poll() is None):
print("looping... ")
stdoutdata = p.stdout.read(DataChunkSize)
self.wfile.write(stdoutdata)
print("Done Looping")
print("dumping last data, if any")
stdoutdata = p.stdout.read(DataChunkSize)
self.wfile.write(stdoutdata)
if __name__ == '__main__':
command = 'ffmpeg -re -i video.avi -an -vcodec libx264 -vb 448k -f mp4 -movflags dash -'
print("running command: %s" % (command, ))
p = subprocess.Popen(command, stdout=subprocess.PIPE, bufsize=-1, shell=True)
print("Server in port 8080...")
serveraddr = ('', 8080) # connect to port 8080
srvr = HTTPServer(serveraddr, RequestHandler)
srvr.serve_forever()This is a prove of concept with a video.avi but the real application is with a live signal video.
When connect to html5 video tag, play the video well, but when open another connection then play the video from the begining and not from the live moment. Also, when close the web, the server print an error :
BrokenPipeError: [Errno 32] Broken pipe
Yes, the pipe is broken when cut the connection is obvious. I think that maybe do it with pipes is not correct, but I don’t know how to do it.
The goal is to run only one ffmpeg command and the output send to every client connected or will do it. Anybody can help me please ?