
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (74)
-
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 (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (21352)
-
How to receive byte-stream by using gstreamer with python subprocess module or gst-launch-1.0 command ?
21 avril 2022, par yuniversiI want to receive byte-stream by using gstreamer with python subprocess module.
Now I can successfully use ffmpeg to pull the byte-stream. As shown below.


import cv2
import subprocess as sp


height = 714
width = 420
rtsp_url = 'rtsp://127.0.0.1:8554/video'

# command
command = ['ffmpeg',
 '-i', rtsp_url,
 '-f', 'rawvideo',
 '-s',str(width)+'*'+str(height),
 '-pix_fmt', 'bgr24',
 '-fflags', 'nobuffer',
 '-']

p = sp.Popen(command, stdout=sp.PIPE, bufsize=10**8)

while True:
 raw_image = p.stdout.read(width*height*3)
 image = np.fromstring(raw_image, dtype='uint8')
 image = image.reshape((height,width,3)).copy()
 cv2.imshow('image', image)
 key = cv2.waitKey(20)



I want to use gstreamer command instead of ffmpeg. So far, I have realized writing byte-stream to a file by using gstreamer command line.


gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/video latency=0 drop-on-latency=true ! rtph264depay ! video/x-h264, stream-format='byte-stream' ! filesink location=/home/name/stdout



But it can't output byte-stream to pipe, so the terminal dosen't display byte-stream, not like ffmpeg command. How to change this command to output byte-stream through pipe so I can read from pipe.
Thank you for taking the time to answer for me !


This is RTSP streaming code.


import cv2
import time
import subprocess as sp
import numpy as np


rtsp_url = 'rtsp://127.0.0.1:8554/video'
video_path = r'test.mp4'
cap = cv2.VideoCapture(video_path)

# Get video information
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
print('fps={}'.format(fps))

# command
command = ['ffmpeg',
 '-re',
 '-y',
 '-stream_loop', '-1',
 '-f', 'rawvideo',
 '-vcodec', 'rawvideo',
 '-pix_fmt', 'bgr24',
 '-s', "{}x{}".format(width, height),
 '-r', str(fps),
 '-i', '-',
 '-c:v', 'libx264',
 '-pix_fmt', 'yuv420p',
 '-preset', 'ultrafast',
 # '-flags2', 'local_header',
 '-bsf:v', "'dump_extra=freq=k'", 
 '-keyint_min', '60',
 '-g', '60',
 '-sc_threshold', '0', 
 '-f', 'rtsp',
 '-rtsp_transport', 'tcp',
 '-muxdelay', '0.1', 
 rtsp_url]

p = sp.Popen(command, stdin=sp.PIPE)

cnt = 0
t_start = time.time()
while (cap.isOpened()):
 t_cur = time.time()-t_start

 ret, frame = cap.read()
 if not ret:
 cnt += 1
 print("count: {}".format(cnt))
 cap = cv2.VideoCapture(video_path)
 continue

 p.stdin.write(frame.tobytes())

 cv2.imshow('real_time', frame)

 key = cv2.waitKey(20)
 if key == 27:
 p.terminate()
 break



-
avformat/movenc : sidx earliest_presentation_time is applied after editlist
29 mars 2022, par Zhao Zhili -
ffbuild/common : Fix CPPFLAGS applied for compiling C++ files
12 mai 2022, par Andreas Rheinhardtffbuild/common : Fix CPPFLAGS applied for compiling C++ files
Currently, $(CPPFLAGS) and $(CFLAGS) are prepended to CXXFLAGS
(the flags for compiling C++) like this :
CXXFLAGS := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
Using " :=" creates a simply expanded variable, i.e. the values
of the variable at the time of assignment are used and later
modifications to them are ignored (using a recursively expanding
variable (i.e. "=" instead of " :=") is not really possible here,
as there would be an infinite loop when evaluating CXXFLAGS).Yet we perform later additions to CPPFLAGS : HAVE_AV_CONFIG_H and
BUILDING_libfoo are defined. These do not reach C++ compilations.To fix this a trick is employed to prepend to a recursively
expanded variable while keeping it recursively expanded.There are two practical consequences of this : C++ files now no longer
include the version.h header, but only the version_major.h header
of their library, saving some recompilations. Furthermore, they
now get some optimized math functions (namely the ones from
lavu/intmath.h instead of the ones from lavu/common.h).
(av_parity() is the only one for which it makes a difference.)Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>