Recherche avancée

Médias (3)

Mot : - Tags -/Valkaama

Autres articles (52)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike 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 (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (7141)

  • 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 !

  • 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

  • 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(&amp;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 = &amp;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&amp; 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_);
    }