
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 (42)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (6857)
-
FFMPEG - local video to UDP streaming to OpenCV - video quality degraded
6 juin 2021, par user3925023my goal is to re-stream local video content / desktop screencasting, to an UDP flow that I need to process on a Python script.



Here is the FFMPEG script that I'm using :



ffmpeg -re -i C:\Users\test\Downloads\out.ts -strict -2 -c:v copy -an -preset slower -tune stillimage -b 11200k -f rawvideo udp://127.0.0.1:5000




And here is the simple Python script supposed to read the stream flow :



import cv2

cap = cv2.VideoCapture('udp://127.0.0.1:5000',cv2.CAP_FFMPEG)
if not cap.isOpened():
 print('VideoCapture not opened')
 exit(-1)
width = cap.get(cv2.CAP_PROP_FRAME_WIDTH) # float
height = cap.get(cv2.CAP_PROP_FRAME_HEIGHT) # float
print(str(width))
print(str(height))
while True:
 ret, frame = cap.read()
 imgray = frame[int(round((height/100)*70,0)):int(round((width/100)*42,0)), int(round((height/100)*74,0)):int(round((width/100)*54,0))]
 if not ret:
 print('frame empty')
 break
 cv2.imshow('image', imgray)
 if cv2.waitKey(1)&0XFF == ord('q'):
 break
cap.release()




I'm able to visualize portion of the stream video as expect, but I'm facing lot of issue in video quality degradation, specially video artifact probably due missing packet processing :






Also these are error log I'm geting from script :



[h264 @ 0000026eb272f280] error while decoding MB 105 66, bytestream -21
[h264 @ 0000026eb2fcb740] error while decoding MB 100 53, bytestream -11
[h264 @ 0000026eb272f280] error while decoding MB 32 22, bytestream -11
[h264 @ 0000026ead9ee300] error while decoding MB 60 20, bytestream -25
[h264 @ 0000026eb27f00c0] error while decoding MB 9 62, bytestream -5
[h264 @ 0000026ead9ee780] error while decoding MB 85 44, bytestream -5
[h264 @ 0000026eb27f0800] error while decoding MB 64 25, bytestream -15
[h264 @ 0000026eb272f280] error while decoding MB 112 23, bytestream -17
[h264 @ 0000026eb2735200] error while decoding MB 30 21, bytestream -7




Actually I don't care about video fluidity,I can also reduce the FPS, important thing is the video quality. Not sure if I'm doing wrong on the scripting python part or if I'm using wrong FFMPEG command.



Many Thanks


-
FFmpeg Muxing binary data with video into MPEG-TS stream
22 avril 2020, par diogoaosI'm trying to create a MPEG-TS stream with FFmpeg. I feed FFmpeg video form a file and binary data from a UDP stream.



ffmpeg -re -i video.mp4 \
 -f data -i udp://localhost:5000 \
 -map 0:0 -map 0:1 -map 1:0 -codec copy \
 -f mpegts test.ts




I use socat to connect to FFmpeg and type random data :



socat udp:localhost:5000 -




When I try to demux the data channel (channel 2 is for data), it's empty :



ffmpeg -i test.ts -map 0:2 -c:d copy -f data -




I've also tried doing this feeding directly text files and that works fine (I can demux the data stream from the resulting .ts file and it's equal). I've also tried using named pipes connected to a Python script, but that didn't work well (FFmpeg seems to wait for an EOF and than does not keep reading the named pipe).



How do I mux video and binary data from different sources into a single MPEG Transport Stream ?


-
Reading video frame by frame using php, ffmpeg and proc_open
29 avril 2020, par TomI want to use proc_open to read every frame from a video using ffmpeg and then use PHP to do something with the frames.
Here's the example that does the opposite- it sends frame by frame from PHP to ffmpeg :



$descriptors = array(
 0 => array("pipe", "r"),

 1 => array("pipe", "w"), 
 2 => array("file", "C:/error-output.txt", "a") 
);

$frames = glob('Q:/images/*.jpg');


$command = "ffmpeg -f image2pipe -pix_fmt rgb24 -framerate 10 -c:v mjpeg -i - ".
 "-r 10 -vcodec libx264 -pix_fmt yuv420p -preset faster -crf 17 ".
 "-y test.mp4";

$ffmpeg = proc_open($command, $descriptors, $pipes);

if (!is_resource($ffmpeg))
{
 die('Could not run ffmpeg');

}

foreach ($frames AS $frame)
{

 fwrite($pipes[0], file_get_contents($frame) );
}

fclose($pipes[0]);




And here's how I am trying but can't get it right :



$descriptors = array(
 0 => array("pipe", "r"),

 1 => array("pipe", "w"), write to
 2 => array("file", "C:/error-output.txt", "a") 
);


$command = "ffmpeg -i 1.gif -ss 00:00:3 -s 650x390 -vframes 100 -c:v png -f image2pipe -";

$ffmpeg = proc_open($command, $descriptors, $pipes);

if (!is_resource($ffmpeg))
{
 die('Could not run ffmpeg');

}

while (!feof($pipes[1]))
{
 $frame = fread($pipes[1], 5000);
}

fclose($pipes[1]);




The biggest issue is I don't know how much data to read from ffmpeg to get a whole frame.