
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 (21)
-
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 (...)
-
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 (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
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 (...)
Sur d’autres sites (5614)
-
How to join webcam FLVs
18 mars 2015, par Marc-André LafortuneI want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this ? For simplicity’s sake, I’ll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row.
That should be easy enough, right ? There’s even a full code example in the ffmpeg FAQ.
Well, pipes seem to be giving me problems (both on my mac running Leopard and on Ubuntu 8.04) so let’s keep it simple and use normal files. Also, if I don’t specify a rate of 15 fps, the visual part plays extremely fast. The example script thus becomes :
ffmpeg -i input.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 \
- > temp.a < /dev/null
ffmpeg -i input.flv -an -f yuv4mpegpipe - > temp.v < /dev/null
cat temp.v temp.v > all.v
cat temp.a temp.a > all.a
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v -sameq -y output.flvWell, using this will work for the audio, but I only get the video the first time around. This seems to be the case for any flv I throw as input.flv, including the movie teasers that come with red5.
a) Why doesn’t the example script work as advertised, in particular why do I not get all the video I’m expecting ?
b) Why do I have to specify a framerate while Wimpy player can play the flv at the right speed ?
The only way I found to join two flvs was to use mencoder. Problem is, mencoder doesn’t seem to join flvs :
mencoder input.flv input.flv -o output.flv -of lavf -oac copy \
-ovc lavc -lavcopts vcodec=flvI get a Floating point exception...
MEncoder 1.0rc2-4.0.1 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Xeon(R) CPU 5150 @ 2.66GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
success: format: 0 data: 0x0 - 0x45b2f
libavformat file format detected.
[flv @ 0x697160]Unsupported audio codec (6)
[flv @ 0x697160]Could not find codec parameters (Audio: 0x0006, 22050 Hz, mono)
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [FLV1] 240x180 0bpp 1000.000 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x31564C46 size:240x180 fps:1000.00 ftime:=0.0010
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
==========================================================================
audiocodec: framecopy (format=6 chans=1 rate=22050 bits=16 B/s=0 sample-0)
VDec: vo config request - 240 x 180 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (240x180 fourcc=31564c46 [FLV1])
VIDEO CODEC ID: 22
AUDIO CODEC ID: 10007, TAG: 0
Writing header...
[NULL @ 0x67d110]codec not compatible with flv
Floating point exceptionc) Is there a way for mencoder to decode and encode flvs correctly ?
So the only way I’ve found so far to join flvs, is to use ffmpeg to go back and forth between flv and avi, and use mencoder to join the avis :
ffmpeg -i input.flv -vcodec rawvideo -acodec pcm_s16le -r 15 file.avi
mencoder -o output.avi -oac copy -ovc copy -noskip file.avi file.avi
ffmpeg -i output.avi output.flvd) There must be a better way to achieve this... Which one ?
e) Because of the problem of the framerate, though, only flvs with constant framerate (like the one I recorded through facebook) will be converted correctly to avis, but this won’t work for the flvs I seem to be recording (like this one or this one). Is there a way to do this for these flvs too ?
Any help would be very appreciated.
-
Writing data to a Node.js child process's stdin fails due to ECONNRESET
8 juillet 2015, par SwothProblem
Passing data to a child process’s stdin seems to fail. It fails due to an ECONNRESET after writing the data.Context
I am developing a small programm that is supposed to render a video, as fast as possible, based on frames captured from a canvas. The animation is rendered to a headless canvas implementation using Rekapi (JavaScript animation framework). The headless canvas is a Node.js module called node-canvas by Automattic. The animation frames are rendered one after another, after each rendering the frame is retrieved using canvas.getImageData().data (Uint8ClampedArray - rgba, faster than canvas.toDataUrl) and put into an array. Every frame is supposed to be send to ffmpeg to create a video.Rekapi -> canvas -> getImageData -> array -> ffmpeg
What I do
I already tried various possibilities to pipe that data to ffmpeg. In general I created a child process in Node.js executing ffmpeg :var spawn = require('child_process').spawn;
var child = spawn('ffmpeg', [
'-pix_fmt', 'rgba',
'-s','1280x720',
'-r', 25,
'-f', 'rawvideo',
'-vcodec', 'rawvideo',
'-i', '-', // read frames from stdin
'-threads', 0, // use all cores
'test.mpg']);Now I write my array data to the child’s stdin :
for(var i = 0; i < dataArray.length; ++i){
var buffer = new Buffer(dataArray[i]);
child.stdin.write(buffer);
console.log('wrote: ' + i);
}I wrote 25 frames this way. The console displays the following :
wrote: 24
wrote: 25
events.js:85
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at Pipe.onread (net.js:559:26)ffmpeg generated a 0 byte test.mpg.
I am very new to Node.js, thus I might not understand the big picture of it’s child processes. -
FFMpeg Command work in command line, but in python script the image is blueish ? (Semi Solved)
17 juin 2015, par FooldjOkay, kind of a weird problem. But I’m not sure whether it’s python, ffmpeg, or some stupid thing I’m doing wrong.
I’m trying to take a video, and take 1 frame a second, and output that frame to an image. Right now, if i use the command line with ffmpeg :
ffmpeg -i test.avi -r 1 -f image2 image-%3d.jpeg -pix_fmt rgb24 -vcodec rawrvideo
It outputs about 10 images, the images look fine, awesome. Now I have this code (right now some code from some github, as I wanted stuff that i was relatively sure would work, and mine is allll convoluted)
import subprocess as sp
import numpy as np
import re
import cv2
import time
FFMPEG_BIN = r'ffmpeg.exe'
INPUT_VID = 'test.avi'
def getInfo():
command = [FFMPEG_BIN,'-i', INPUT_VID, '-']
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE)
pipe.stdout.readline()
pipe.terminate()
infos = pipe.stderr.read()
infos_list = infos.split('\r\n')
res = re.search(' \d+x\d+ ',infos)
res = [int(x) for x in res.group(0).split('x')]
return res
res = getInfo()
command = [ FFMPEG_BIN,
'-i', INPUT_VID,
'-f', 'image2pipe',
'-pix_fmt', 'rgb24',
'-vcodec', 'rawvideo', '-']
pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8)
n = 0
im2 = []
try:
mog = cv2.BackgroundSubtractorMOG2(120,2,True)
while True:
raw_image = pipe.stdout.read(res[0]*res[1]*3)
# transform the byte read into a numpy array
image = np.fromstring(raw_image, dtype='uint8')
image = image.reshape((res[1],res[0],3))
rgbImg = image.copy()
fname = ('_tmp%03d.png'%time.time())
cv2.imwrite(fname, rgbImg)
# throw away the data in the pipe's buffer.
#pipe.stdout.flush()
n += 1
print n
except:
print 'done',n
pipe.kill()
cv2.destroyAllWindows()When I run this, I get 10 images, but they all have a Blue Tint ! I cannot for the life of me figure out why. I’ve done tons of searches, I’ve tried quite a few different codecs (usually just messes things up worse). The media info for the video file is here :
General
Complete name : test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 85.0 KiB
Duration : 133ms
Overall bit rate : 5 235 Kbps
Video
ID : 0
Format : JPEG
Codec ID : MJPG
Duration : 133ms
Bit rate : 1 240 Kbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.135
Stream size : 20.1 KiB (24%)Any suggestions ? It seems like it should be an RGB mixup...just not sure where at...
EDIT : So I fixed the problem by switching the blue and red channels with this code :
bChannel = rgbImg[ :, :,0]
rChannel = rgbImg[ :, :,2]
gChannel = rgbImg[ :, :,1]rgbArray = np.zeros((res[1],res[0],3), 'uint8')
rgbArray[...,0] = rChannel
rgbArray[...,1] = gChannel
rgbArray[...,2] = bChannelSo I guess this is now a question of, why is python mixing up these channels ? Is it a problem with python, or ffmpeg, the codec ?
Thanks !