Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (28)

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

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (4126)

  • Creating GIF from QImages with ffmpeg

    17 août 2016, par Sierra

    I would like to generate GIF from QImage, using ffmpeg - all of that programmatically (C++). I’m working with Qt 5.6 and the last build of ffmpeg (build git-0a9e781 (2016-06-10).

    I’m already able to convert these QImage in .mp4 and it works. I tried to use the same principle for the GIF, changing format pixel and codec. GIF is generated with two pictures (1 second each), in 15 FPS.

    ## INITIALIZATION
    #####################################################################

    // Filepath : "C:/Users/.../qt_temp.Jv7868.gif"  
    // Allocating an AVFormatContext for an output format...
    avformat_alloc_output_context2(formatContext, NULL, NULL, filepath);

    ...

    // Adding the video streams using the default format codecs and initializing the codecs.
    stream = avformat_new_stream(formatContext, *codec);

    AVCodecContext * codecContext = avcodec_alloc_context3(*codec);

    context->codec_id       = codecId;
    context->bit_rate       = 400000;
    ...
    context->pix_fmt        = AV_PIX_FMT_BGR8;

    ...

    // Opening the codec...
    avcodec_open2(codecContext, codec, NULL);

    ...

    frame = allocPicture(codecContext->width, codecContext->height, codecContext->pix_fmt);
    tmpFrame = allocPicture(codecContext->width, codecContext->height, AV_PIX_FMT_RGBA);

    ...

    avformat_write_header(formatContext, NULL);

    ## ADDING A NEW FRAME
    #####################################################################

    // Getting in parameter the QImage: newFrame(const QImage & image)
    const qint32 width  = image.width();
    const qint32 height = image.height();

    // Converting QImage into AVFrame
    for (qint32 y = 0; y < height; y++) {
       const uint8_t * scanline = image.scanLine(y);

       for (qint32 x = 0; x < width * 4; x++) {
           tmpFrame->data[0][y * tmpFrame->linesize[0] + x] = scanline[x];
       }
    }

    ...

    // Scaling...
    if (codec->pix_fmt != AV_PIX_FMT_BGRA) {
       if (!swsCtx) {
           swsCtx = sws_getContext(codec->width, codec->height,
                                   AV_PIX_FMT_BGRA,
                                   codec->width, codec->height,
                                   codec->pix_fmt,
                                   SWS_BICUBIC, NULL, NULL, NULL);
       }

       sws_scale(swsCtx,
                 (const uint8_t * const *)tmpFrame->data,
                 tmpFrame->linesize,
                 0,
                 codec->height,
                 frame->data,
                 frame->linesize);
    }
    frame->pts = nextPts++;

    ...

    int gotPacket = 0;
    AVPacket packet = {0};

    av_init_packet(&packet);
    avcodec_encode_video2(codec, &packet, frame, &gotPacket);

    if (gotPacket) {
       av_packet_rescale_ts(paket, *codec->time_base, stream->time_base);
       paket->stream_index = stream->index;

       av_interleaved_write_frame(formatContext, paket);
    }

    But when I’m trying to modify the video codec and pixel format to match with GIF specifications, I’m facing some issues.
    I tried several codecs such as AV_CODEC_ID_GIF and AV_CODEC_ID_RAWVIDEO but none of them seem to work. During the initialization phase, avcodec_open2() always returns such kind of errors :

    Specified pixel format rgb24 is invalid or not supported
    Could not open video codec:  gif

    EDIT 17/06/2016

    Digging a little bit more, avcodec_open2() returns -22 :

    #define EINVAL          22      /* Invalid argument */

    EDIT 22/06/2016

    Here are the flags used to compile ffmpeg :

    "FFmpeg/Libav configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib"

    Did I miss a crucial one for GIF ?

    EDIT 27/06/2016

    Thanks to Gwen, I have a first output : I setted the context->pix_fmt to AV_PIX_FMT_BGR8. Btw I’m still facing some issues with the generated GIF. It’s not playing and encoding appears to fail.

    GIF generated in command lines with ffmpeg (left) . . . GIF generated programmatically (right)
    Generated in command line with ffmpeg
    enter image description here

    It looks like some options are not defined... also may be a wrong conversion between QImage and AVFrame ? I updated the code above. It represents a lot of code, so I tried to stay short. Don’t hesitate to ask more details.

    End of EDIT

    I’m not really familiar with ffmpeg, any kind of help would be highly appreciated. Thank you.

  • Install ffmpeg-light with cabal

    20 septembre 2016, par WirflBirfl

    I want to install the ffmpeg-light library from hackage via cabal on Windows 10 (64 bit). So I downloaded ffmpeg and extracted it to C :\FFmpeg.

    At first pkg-config was complaining that it could not find various packages. I solved this problem with .pc files.

    When I tried to use the command : cabal install ffmpeg-light cabal complained about missing C-libraries, being exactly those for which I created the .pc files.

    Then I tried the command : cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib. Now I have a different error message, which says :

    Enums.hsc:7:32: fatal error: libavcodec/avcodec.h: No such file or directory

    Edit :
    Then I tried the following command :

    cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib \
                              --extra-include-dirs=C:\FFmpeg\include

    Now first the compiler gives some warnings about deprecated functions in ffmpeg and redundant imports in ffmpeg-light, but compiles 11 of 11. But the build is still not successfull.

    In-place registering ffmpeg-light-0.11.1...
    setup-Simple-Cabal-1.22.5.0-x86_64-windows-ghc-7.10.3.exe:
    'C:\Haskell\bin\ghc-pkg.exe' exited with an error:
    ffmpeg-light-0.11.1: Warning: haddock-interfaces:
    C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light\ffmpeg-light.haddock
    doesn't exist or isn't a file
    ffmpeg-light-0.11.1: Warning: haddock-html:
    C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light
    doesn't exist or isn't a directory
    ffmpeg-light-0.11.1: library-dirs: C:FFmpeglib is a relative path which makes
    no sense (as there is nothing for it to be relative to). You can make paths
    relative to the package database itself by using ${pkgroot}. (use --force to
    override)
    ffmpeg-light-0.11.1: include-dirs: C:FFmpeginclude is a relative path which
    makes no sense (as there is nothing for it to be relative to). You can make
    paths relative to the package database itself by using ${pkgroot}. (use
    --force to override)
    cabal: Error: some packages failed to install:
    ffmpeg-light-0.11.1 failed during the building phase. The exception was:
    ExitFailure 1

    Some additional information :

    cabal version: cabal-install version 1.22.6.0
    using version 1.22.5.0 of the Cabal library
    gcc version of my installed Haskell platform: 5.2.0

    Example .pc file I used for pkg-config :

    Name: libavcodec
    Description: Library for ffmpeg
    Version: 57
    Cflags: -IC:\FFmpeg\include
    Libs: -LC:\FFmpeg\lib -llibavcodec
  • lavfi/pan : renormalize negative gain coefficients properly

    9 octobre 2016, par Moritz Barsnick
    lavfi/pan : renormalize negative gain coefficients properly
    

    The parser for the outdef will accept a negative value for the first
    named channel’s gain. As negative values effectively only invert the
    phase of the signal, and not negate the level, the gains’ absolute
    values must be used to correctly accumulate the levels.

    Signed-off-by : Moritz Barsnick <barsnick@gmx.net>
    Reviewed-by : Nicolas George <george@nsup.org>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavfilter/af_pan.c