Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (68)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP 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 (12262)

  • Some bugs when using SDL2 and ffmpeg to make a video player

    1er juin 2017, par trycatch

    used 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_);
    }
  • ffmpeg Unrecognized option 'hls_enc'

    16 juin 2017, par riubin

    Does 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

  • ValueError When Reading Video Frame

    28 juin 2017, par Bassie

    I 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 by numpy, but probably because I am calculating the values for my video incorrectly.

    Output :

    raw_image : b’ ’

    len(raw_image) : 0

    image : [ ]

    len(image) : 0

    I am not sure whether I am passing in the correct values for read or reshape functions - any help at all is much appreciated !