
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
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)
-
ValueError When Reading Video Frame
28 juin 2017, par BassieI am following this article, from where I got this code :
FFMPEG_BIN ="Z:\ffmpeg\bin\ffmpeg.exe"
import subprocess as sp
command = [ FFMPEG_BIN,
'-i', 'video.mp4',
'-f', 'image2pipe',
'-pix_fmt', 'rgb24',
'-vcodec', 'rawvideo', '-']
pipe = sp.Popen(command, stdout = sp.PIPE, bufsize=10**8, shell=True)
import numpy
# read 420*360*3 bytes (= 1 frame)
raw_image = pipe.stdout.read(420*360*3)
# transform the byte read into a numpy array
image = numpy.fromstring(raw_image, dtype='uint8')
image = image.reshape((360,420,3))
# throw away the data in the pipe's buffer.
pipe.stdout.flush()When I run it I see this error :
Traceback (most recent call last):
File "Z:\py\ffmtest\test.py", line 16, in <module>
image = image.reshape((360,420,3))
ValueError: total size of new array must be unchanged
</module>Where line 16 is
image = image.reshape((360,420,3))
. I think this error is produced bynumpy
, but probably because I am calculating the values for my video incorrectly.Output :
raw_image
: b’ ’len(raw_image)
: 0image
: [ ]len(image)
: 0I am not sure whether I am passing in the correct values for
read
orreshape
functions - any help at all is much appreciated ! -
ffmpeg Unrecognized option 'hls_enc'
16 juin 2017, par riubinDoes anyone have a ffmpeg problem that Unrecognized option ’hls_enc’ ?
when I use ffmpeg to convert videos to hls with option ’hls_enc’,followed the document : https://www.ffmpeg.org/ffmpeg-formats.html#Options-5
but throw error:Unrecognized option ’hls_enc’Is it missing any configure options ?
configuration : —enable-gpl —enable-nonfree —yasmexe=/data/ffmpeg.src/_release/bin/yasm —prefix=/data/ffmpeg.src/_release —cc= —enable-static —disable-shared —enable-debug —extra-cflags=’-I/data/ffmpeg.src/_release/include’ —extra-ldflags=’-L/data/ffmpeg.src/_release/lib -lm -ldl’ —enable-postproc —enable-bzlib —enable-zlib —enable-parsers —enable-pthreads —enable-libx264 —enable-libmp3lame —enable-libfdk_aac —enable-libspeex —extra-libs=-lpthread —enable-encoders —enable-decoders —enable-avfilter —enable-muxers —enable-demuxers
-
Some bugs when using SDL2 and ffmpeg to make a video player
1er juin 2017, par trycatchused sws_scale to resize the image, and SDL2.0 to render, pixel format is YUV420P.
1.When I Create SDL Render with SDL_RENDERER_SOFTWARE, I Get a black image like this :enter image description here, the top-left corner has a green point ;
But When I Create SDL Render with SDL_RENDERER_ACCELERATED, I can See normal image ;2.When I resize the window, the player will crash on SDL_UpdateYUVTexture. I check width, height and linesize of the data, everything is OK.
WHY ?
Key Code :
if (swscale_.frame.width % 2)
swscale_.frame.width -= 1;
swscale_.free();
swscale_.context = sws_getContext(
vcodec->width, vcodec->height, vcodec->pix_fmt,
swscale_.frame.width, swscale_.frame.height,
AV_PIX_FMT_YUV420P, SWS_BICUBIC, nullptr, nullptr, nullptr);
if (!swscale_.context)
throw std::runtime_error("sws_getContext.");
if (swscale_.frame.avframe)
av_frame_free(&swscale_.frame.avframe);
swscale_.frame.avframe = av_frame_alloc();
unsigned char* out_buffer = (unsigned char *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_YUV420P, swscale_.frame.width, swscale_.frame.height, 1)+16);
unsigned char* tmp = &out_buffer[16 - (unsigned long long)out_buffer % 16];
av_image_fill_arrays(swscale_.frame.avframe->data, swscale_.frame.avframe->linesize, tmp,
AV_PIX_FMT_YUV420P, swscale_.frame.width, swscale_.frame.height, 1);
sws_scale(swscale_.context, (const unsigned char* const*)vframe_->data, vframe_->linesize,
0, vframe_->height,
swscale_.frame.avframe->data, swscale_.frame.avframe->linesize);
self.onRenderHandle(swscale_.frame);Code of SDL rendering :
void Player::onRender(const frame& frame)
{
if (sdl_lock_.try_lock()) {
::ValidateRect(native_window_, NULL);
if (frame.width != scr_width_ || frame.height != scr_height_) {
scr_width_ = frame.width; scr_height_ = frame.height;
SDL_SetWindowSize(screen_, scr_width_ + 2, scr_height_ + 2);
SDL_DestroyRenderer(sdl_renderer_);
sdl_renderer_ = SDL_CreateRenderer(screen_, -1, 0);
video_texture_ = SDL_CreateTexture(sdl_renderer_, SDL_PIXELFORMAT_IYUV,
SDL_TEXTUREACCESS_STREAMING, scr_width_, scr_height_);
}
SDL_UpdateYUVTexture(video_texture_, NULL,
frame.avframe->data[0], frame.avframe->linesize[0],
frame.avframe->data[1], frame.avframe->linesize[1],
frame.avframe->data[2], frame.avframe->linesize[2]);
sdl_lock_.unlock();
::InvalidateRect(native_window_, NULL, false);
}
}
void Player::onPaint()
{
std::lock_guard lock(sdl_lock_);
SDL_RenderClear(sdl_renderer_);
SDL_RenderCopy(sdl_renderer_, video_texture_, NULL, NULL);
SDL_RenderPresent(sdl_renderer_);
}