
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (106)
-
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 (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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" (...)
Sur d’autres sites (13726)
-
How to pipe live video frames from ffmpeg to PIL ?
30 janvier 2017, par Ryan MartinI need to use ffmpeg/avconv to pipe jpg frames to a python PIL (Pillow) Image object, using gst as an intermediary*. I’ve been searching everywhere for this answer without much luck. I think I’m close - but I’m stuck. Using Python 2.7
My ideal pipeline, launched from python, looks like this :
- ffmpeg/avconv (as h264 video)
- Piped ->
- gst-streamer (frames split into jpg)
- Piped ->
- Pil Image Object
I have the first few steps under control as a single command that writes .jpgs to disk as furiously fast as the hardware will allow.
That command looks something like this :
command = [
"ffmpeg",
"-f video4linux2",
"-r 30",
"-video_size 1280x720",
"-pixel_format 'uyvy422'",
"-i /dev/video0",
"-vf fps=30",
"-f H264",
"-vcodec libx264",
"-preset ultrafast",
"pipe:1 -",
"|", # Pipe to GST
"gst-launch-1.0 fdsrc !",
"video/x-h264,framerate=30/1,stream-format=byte-stream !",
"decodebin ! videorate ! video/x-raw,framerate=30/1 !",
"videoconvert !",
"jpegenc quality=55 !",
"multifilesink location=" + Utils.live_sync_path + "live_%04d.jpg"
]This will successfully write frames to disk if ran with popen or os.system.
But instead of writing frames to disk, I want to capture the output in my subprocess pipe and read the frames, as they are written, in a file-like buffer that can then be read by PIL.
Something like this :
import subprocess as sp
import shlex
import StringIO
clean_cmd = shlex.split(" ".join(command))
pipe = sp.Popen(clean_cmd, stdout = sp.PIPE, bufsize=10**8)
while pipe:
raw = pipe.stdout.read()
buff = StringIO.StringIO()
buff.write(raw)
buff.seek(0)
# Open or do something clever...
im = Image.open(buff)
im.show()
pipe.flush()This code doesn’t work - I’m not even sure I can use "while pipe" in this way. I’m fairly new to using buffers and piping in this way.
I’m not sure how I would know that an image has been written to the pipe or when to read the ’next’ image.
Any help would be greatly appreciated in understanding how to read the images from a pipe rather than to disk.
- This is ultimately a Raspberry Pi 3 pipeline and in order to increase my frame rates I can’t (A) read/write to/from disk or (B) use a frame by frame capture method - as opposed to running H246 video directly from the camera chip.
-
C++ Parse data from FFMPEG pipe output
5 janvier 2017, par SimonI want to play around with data coming from an RTSP stream (e.g., do motion detection). Instead of using the cumbersome ffmpeg C API for decoding the stream, I decided to try something different. FFmpeg offers the possibility to pipe its output to stdout. Therefore, I wrote a C++ program which calls popen() to make an external call to ffmpeg and grabs the output. My aim is now to extract the YUV images from the resulting stream. As a first test, I decoded an h264 video file and wrote the stdout output coming from the ffmpeg call to a file.
#include <iostream>
#include <fstream>
#include
using namespace std;
int main()
{
FILE *in;
char buff[512];
if(!(in = popen("ffmpeg -i input.mp4 -c:v rawvideo -an -r 1 -f rawvideo pipe:1", "r")))
{
return 1;
}
ofstream outputFile("output.yuv");
while(fgets(buff, sizeof(buff), in) != NULL)
{
outputFile << buff;
}
outputFile.close();
pclose(in);
return 0;
}
</fstream></iostream>The resulting raw video can be played with vlc afterwards :
vlc --rawvid-fps 1 --rawvid-width 1280 --rawvid-height 544 --rawvid-chroma I420 output.yuv
Here, I chose the width and height from the video (a trailer of the Simpsons movie from http://www.dvdloc8.com/clip.php?movieid=12167&clipid=3). This first test worked very well. The resulting file is the same as when calling the ffmpeg binary directly with
ffmpeg -i input.mp4 -c:v rawvideo -an -f output_ffmpeg.yuv
Now I want to do some processing with the images coming from the ffmpeg output instead of dumping it to a file. My question is : Is there a clever way of parsing the stdout data from ffmpeg ? Ideally, I want to parse the stream into a sequence of instances of a YUVImage class (for example).
-
c# pipe using youtube-dl to ffmpeg
1er janvier 2017, par lilscarecrowI am trying to pipe the audio stream from youtube-dl into ffmpeg for a program using discord.NET. I am not sure exactly how to achieve this in c#, though. Currently, I can play ffmpeg with a url or path from this code on the docs for discord.NET :
var process = Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg",
Arguments = $"-i {outLine.Data}" +
" -f s16le -ar 48000 -ac 2 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true
});
Thread.Sleep(2000);
int blockSize = 3840;
byte[] buffer = new byte[blockSize];
int byteCount;
while (!playing)
{
byteCount = process.StandardOutput.BaseStream
.Read(buffer, 0, blockSize);
if (byteCount == 0)
break;
_vClient.Send(buffer, 0, byteCount);
}
_vClient.Wait();So, I am trying to pipe the youtube-dl audio to this I assume. I just have no idea how to achieve piping in this format and for the file while it is downloading. Also, the program works on async if that helps.