
Recherche avancée
Autres articles (65)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)
Sur d’autres sites (12912)
-
Pipe OpenCV and PyAudio to ffmpeg streaming youtube rtmp from python
22 août 2021, par a0910115172How can I pipe openCV and PyAudio to ffmpeg streaming youtube rtmp from python.
The error message shows as following :
No such filter : 'pipe:1'
pipe:1 : Invalid argument


Here is my code :


Import module


import cv2
import subprocess
import pyaudio



Audio


p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')
for i in range(0, numdevices):
 if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
 print("Input Device id ", i, " - ", p.get_device_info_by_host_api_device_index(0, i).get('name'))

CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100

stream = p.open(format=FORMAT,
 channels=CHANNELS,
 rate=RATE,
 input=True,
 frames_per_buffer=CHUNK)

# Stream Audio data here
# data = stream.read(CHUNK)



Video


rtmp = r'rtmp://a.rtmp.youtube.com/live2/key'

cap = cv2.VideoCapture(0)
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
fps = 30




command param here


command = ['ffmpeg',
 '-y',
 '-f', 'rawvideo',
 '-pixel_format', 'bgr24',
 '-video_size', "{}x{}".format(width, height),
 '-framerate', str(fps),
 '-i', 'pipe:0',
 '-re',
 '-f', 'lavfi',
 '-i', 'pipe:1',
 '-c:v', 'libx264',
 '-c:a', 'aac',
 '-vf', 'format=yuv420p',
 '-f', 'flv',
 rtmp]



Create subprocess to ffmpeg command


pipe = subprocess.Popen(command, shell=False, stdin=subprocess.PIPE
)
while cap.isOpened():
 success, frame = cap.read()
 if success:
 if cv2.waitKey(1) & 0xFF == ord('q'):
 break
 pipe.stdin.write(frame.tostring())
 pipe.stdin.write(stream.read(CHUNK))



Audio Stop


stream.stop_stream()
stream.close()
p.terminate()



Video Stop


cap.release()
pipe.terminate()



Thanks


-
pipe compressed stream to another process using ffmpeg subprocess
29 août 2021, par Naseer AhmedI want to get compressed data from camera and send it to client side before converting it to frames. I have created a dummy code. but i am getting error that
cannot reshape array of 0 byte


import cv2
import subprocess as sp
import numpy

IMG_W = 640
IMG_H = 480

FFMPEG_BIN = "/usr/bin/ffmpeg"
ffmpeg_cmd = [ FFMPEG_BIN,
 '-i', 'h264.h264',
 '-vcodec', 'h264', # disable audio processing
 '-f', 'image2pipe', '-'] 

ffmpeg_cmd2 = [ FFMPEG_BIN,
 '-i','image2pipe',
 '-r', '30', # FPS
 '-pix_fmt', 'bgr24', # opencv requires bgr24 pixel format.
 '-vcodec', 'rawvideo',
 '-an','-sn', # disable audio processing
 '-f', 'image2pipe', '-'] 

 
pipe = sp.Popen(ffmpeg_cmd, stdout = sp.PIPE, bufsize=10)
 
pipe2 = sp.Popen(ffmpeg_cmd2, stdin = pipe.stdout,stdout = sp.PIPE, bufsize=10)

while True:
 raw_image = pipe2.stdout.read(IMG_W*IMG_H*3)
 image = numpy.fromstring(raw_image, dtype='uint8') # convert read bytes to np
 image = image.reshape((IMG_H,IMG_W,3))

 cv2.imshow('Video', image)
 if cv2.waitKey(1) & 0xFF == ord('q'):
 break

pipe.stdout.flush()
cv2.destroyAllWindows()



-
Split ffmpeg audio and video to different pipe outputs
8 septembre 2021, par Bryan HornaI have a conference application using Jitsi Meet, and using their Jibri tool for streaming to an RTMP source.

But the delay is intolerable as of now so while looking out for alternatives I found that I can use WebRTC.

It turns out that most of the tools I've found (Pion, and others) expect me to send separate video/audio streams.

And Jibri uses anffmpeg
command which outputs both streams joined, so I want to split them.

Here's the command in question :


ffmpeg \
-y -v info \
-f x11grab \
-draw_mouse 0 \
-r 30 \
-s 1920x1080 \
-thread_queue_size 4096 \
-i :0.0+0,0 \
-f alsa \
-thread_queue_size 4096 \
-i plug:bsnoop \
-acodec aac -strict -2 -ar 44100 -b:a 128k \
-af aresample=async=1 \
-c:v libx264 -preset veryfast \
-maxrate 2976k -bufsize 5952k \
-pix_fmt yuv420p -r 30 \
-crf 25 \
-g 60 -tune zerolatency \
-f flv rtmps://redacted.info



I'd want to have it output to at least two outputs (one for video and other for audio), using
pipe:x
orrtp://
.

It'll be better if multiple output codecs are possible (audio opus/aac, video h264/vp8), so it supports most of WebRTC.

I've read the documentation at ffmpeg website but still can't get to a command that does this job in just one command.

I know I could use-an
and-vn
with two differentffmpeg
commands but that would consume more CPU I guess.

Thanks in advance for your great help !