
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (95)
-
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (5989)
-
FFmpeg streaming UDP
2 octobre 2020, par xKedarI'm trying to stream, using FFmpeg, my webcam and audio to a PC in another LAN that connects to mine.


I basically wait for incoming connection in order to acquire IP and port of the other side


import socket

 localPort = 1234
 bufferSize = 1024

 UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
 UDPServerSocket.bind(("", localPort)) # Bind to address and port

 while(True):
 bytesAddressPair = UDPServerSocket.recvfrom(bufferSize)
 message = bytesAddressPair[0].decode("utf-8")
 address = bytesAddressPair[1]
 # Sending a reply to client
 UDPServerSocket.sendto(str.encode("Hello"), address)
 break

 UDPServerSocket.close()



Then I try to send the stream with FFmpeg using the same port number both for server(localPort) and client(the one I acquired from address)


import re
 from threading import Thread
 from subprocess import Popen, PIPE

 def detect_devices():
 list_cmd = 'ffmpeg -list_devices true -f dshow -i dummy'.split()
 p = Popen(list_cmd, stderr=PIPE)
 flagcam = flagmic = False
 for line in iter(p.stderr.readline,''):
 if flagcam:
 cam = re.search('".*"',line.decode(encoding='UTF-8')).group(0)
 cam = cam if cam else ''
 flagcam = False
 if flagmic:
 mic = re.search('".*"',line.decode(encoding='UTF-8')).group(0)
 mic = mic if mic else ''
 flagmic = False
 elif 'DirectShow video devices'.encode(encoding='UTF-8') in line:
 flagcam = True
 elif 'DirectShow audio devices'.encode(encoding='UTF-8') in line:
 flagmic = True
 elif 'Immediate exit requested'.encode(encoding='UTF-8') in line:
 break
 return cam, mic 


 class ffmpegThread (Thread):
 def __init__(self, address):
 Thread.__init__(self)
 self.address = address

 def run(self):
 cam, mic = detect_devices()
 command = 'ffmpeg -f dshow -i video='+cam+':audio='+mic+' -profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -b:v 512k -s 240x160 -acodec aac -ac 2 -ab 32k -ar 44100 -f mpegts -flush_packets 0 -t 40 udp://'+self.address+'?pkt_size=1316?localport='+str(localPort)
 p = Popen(command , stderr=PIPE)
 for line in iter(p.stderr.readline,''):
 if len(line) <5: break
 p.terminate()

 thread1 = ffmpegThread(address[0]+":"+str(address[1]))
 thread1.start()



While on the other side I have :


from threading import Thread
 import tkinter as tk
 import vlc

 class myframe(tk.Frame):
 def __init__(self, width=240, height=160):
 self.root = tk.Tk()
 super(myframe, self).__init__(self.root)
 self.root.geometry("%dx%d" % (width, height))
 self.root.wm_attributes("-topmost", 1)
 self.grid()
 self.frame = tk.Frame(self, width=240, height=160)
 self.frame.configure(bg="black")
 self.frame.grid(row=0, column=0, columnspan=2)
 self.play()
 self.root.mainloop()

 def play(self):
 self.player = vlc.Instance().media_player_new()
 self.player.set_mrl('udp://@0.0.0.0:5000')
 self.player.set_hwnd(self.frame.winfo_id())
 self.player.play()

 class guiThread (Thread):
 def __init__(self, nome):
 Thread.__init__(self)
 self.nome = nome

 def run(self):
 app = myframe()



and :


import socket

 msgFromClient = "Hello UDP Server"
 bytesToSend = str.encode(msgFromClient)
 serverAddressPort = ("MYglobal_IPaddress", 1234)
 bufferSize = 1024
 localPort = 5000

 # Create a UDP socket at client side
 UDPClientSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) 
 UDPClientSocket.bind(("", localPort))

 UDPClientSocket.sendto(bytesToSend, serverAddressPort)

 msgFromServer = UDPClientSocket.recvfrom(bufferSize)
 msg = msgFromServer[0].decode("utf-8")
 print(msg)
 UDPClientSocket.close()
 gui = guiThread("ThreadGUI")
 gui.start()



I'm not able to reach the client with the stream. I tested everything else so the problem should be in the way I try to reach the client


-
Capturing Screen with FFMPEG on RTP protocol
23 septembre 2020, par mertakkartalI am struggling about capturing the screen of remote computer on the same network with ffmpeg on RTP protocol.


On the remote computer I run these two parameter blocks in different bash scripts for making the server catches the stream.


For video :


ffmpeg -f x11grab -framerate 25 -video_size uhd2160 -i :0.0 -c:video h264_nvenc -preset fast -pix_fmt bgr0 -b:v 6M -g 25 -an -f rtp_mpegts rtp://multicastaddress:videoPort


For Audio :


ffmpeg -f alsa -i hw:0,0 -c:audio aac -b:a 48K -f rtp_mpegts rtp://multicastaddress:audioPort


Then , I run my ffmpeg capturing screen parameter block from the server as root privilege like as below :


ffmpeg -y -buffer_size 425984 -thread_queue_size 32 -i rtp://@multicastaddress:videoPort -buffer_size 5000 -thread_queue_size 32 -i rtp://@multicastaddress:audioPort -map 0:0 -map 1:0 -c:v copy -c:a copy output.mp4


When I run it , it outputs those errors as below ,


[rtp @ 0x2329380] RTP: missed 284 packets
[rtp @ 0x2329380] RTP: missed 487 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1320.4kbits/s speed=1.27x 
[rtp @ 0x2329380] RTP: missed 2204 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1308.9kbits/s speed=1.24x 
[rtp @ 0x2329380] RTP: missed 300 packets
[rtp @ 0x2329380] max delay reached. need to consume packet
[rtp @ 0x2329380] RTP: missed 468 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1155.6kbits/s speed= 1.2x 
[rtp @ 0x2329380] RTP: missed 2222 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1197.0kbits/s speed=1.19x 
[rtp @ 0x2329380] RTP: missed 278 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1156.1kbits/s speed=1.18x 
[rtp @ 0x2329380] RTP: missed 303 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1064.8kbits/s speed=1.32x 
[rtp @ 0x2329380] RTP: missed 3 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1064.8kbits/s speed=1.17x 
[rtp @ 0x2329380] RTP: missed 280 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1095.4kbits/s speed=1.16x 
[rtp @ 0x2329380] RTP: missed 1737 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1084.1kbits/s speed=1.15x 
[rtp @ 0x2329380] RTP: missed 485 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1142.9kbits/s speed=1.14x 
[rtp @ 0x2329380] RTP: missed 767 packets
[rtp @ 0x2329380] max delay reached. need to consume packet
[rtp @ 0x2329380] RTP: missed 3 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1080.6kbits/s speed=1.14x 
[rtp @ 0x2329380] RTP: missed 1562 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1063.9kbits/s speed=1.13x 
[rtp @ 0x2329380] RTP: missed 282 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1065.8kbits/s speed=1.12x 
[rtp @ 0x2329380] RTP: missed 1 packets
[rtp @ 0x2329380] max delay reached. need to consume packet
[rtp @ 0x2329380] RTP: missed 771 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1024.3kbits/s speed=1.11x 
[rtp @ 0x2329380] RTP: missed 1731 packets
[rtp @ 0x2329380] max delay reached. need to consume packet bitrate=1019.1kbits/s speed=1.11x 
[rtp @ 0x2329380] RTP: missed 298 packets

frame= 453 fps=8.9 q=-1.0 Lsize= 7397kB time=00:00:56.60 bitrate=1070.6kbits/s speed=1.11x



After checking the video output with mpv player or ffplay ,I can observe that parameters from server caught the stream but mostly with lost packets so there are distortions in the video output file.


I tried protocol_whitelist "file,rtp,udp" for preventing packet loss but it did not work out unfortunately.


Any other parameter for solving this issue ?


-
ffmpeg rtmp broadcast on youtube speed below 1x
23 septembre 2020, par usr6969i made an python and opencv program that produce frame per second around 8-15fps with MJPEG output format where MJPEG address served on localhost webserver (0.0.0.0:5000) and, i do attempt to broadcast its frame to rtmp server like youtube using ffmpeg so basically i do convert MJEG to flv and forward to rtmp server with following command
ffmpeg -f mjpeg -i http://0.0.0.0:5000/video_feed -f lavfi -i anullsrc -c:v libx264 -vf "scale=trunc(oh*a/2)*2:320,unsharp=lx=3:ly=3:la=1.0" -crf 24 -c:a aac -ac 1 -f flv rtmp://a.rtmp.youtube.com/live2/xxx-xxx-xxx
but unfortunatelly youtube stream has too many buffering that occur every around 5 second and ffmpeg terminal tell that writing speed is only around 0.317x (expected to be sync with youtube around 0.99-1x), my question is

does there a way to stream 'realtime' around 8-15fps and automatically sync with youtube rtmp server without buffering because i thought that youtube require around 30fps while my fps only 9-15fps that probably causing buffer.
do there an such like additional ffmpeg's parameter that able to speed up writing ? thank you