Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (54)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (5710)

  • Creating GIF from QImages with ffmpeg

    21 mars 2020, 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.

  • Evolution #4753 : Styles du privé : listes d’objets (suite des boîtes et des formulaires)

    4 mai 2021

    Un point étape.
    Cette fois-ci j’aimerais bien un historique pas trop cassé, donc discussion avant de balancer du code.
    Maintenant les captures ne sont plus des maquettes, mais du vrai code.

    Emballage extérieur

    Donc pour la partie « emballage extérieur », les boîtes, formulaires et listes sont unifiés et réutilisent les mêmes variables CSS.
    Elles ont toutes une variante .mini pour tout ressérer. Cette variante est automatiquement appliquée en certains endroits (dans les colonnes, etc.).

    Intérieur

    Pour l’intérieur, j’ai donc appliqué ces quelques règles :

    • Padding un peu plus grand
    • Plus de largeur fixe, à l’exception de quelques colonnes précises (id, statut, picto)
    • Même taille de texte dans toutes les colonnes, à l’exception des <small></small> éventuels

    Dans les colonnes latérales (.lat), toutes les colonnes du tableau sont masquées à l’exception des .principale et de quelques autres choisies à la main (id, statut).

    J’ai testé avec toutes les listes de la dist, il faudra bien continuer à tester avec d’autres cas de figure.

    Listes, formulaires et +

    Le sujet des listes objets-lies et objets-associer m’a amené à déborder un peu du sujet initial. Mais tout est un peu lié, un sujet en amène un autre.

    Donc ces 2 listes sont utilisées dans le formulaire editer_liens, j’en ai profité pour essayer de le remettre d’aplomb.
    Là j’ai vu qu’avec l’apparence par défaut (bordure grise + fond blanc), quand plusieurs formulaires de liens se suivaient, on avait du mal à voir où finissait l’un et où commençait l’autre (pas de capture, croyez moi sur parole :).
    En mettant un fond gris, on les distingue beaucoup mieux.
    Et j’ai bien insisté quand ils sont "dépliés", pour distinguer les 2 zones.

    Mais ça a également un autre avantage : en scannant la fiche objet dans son ensemble, on voit mieux où commence le « vrai » contenu de l’objet, par rapport aux bidules de configuration (date, liens, etc.).
    D’abord les formulaires et autres sur fond gris, puis ensuite le texte de l’objet.

    Donc je pense qu’on pourrait généraliser ça : au lieu de dire « les formulaires editer_liens sont sur fond gris », on pourrait étendre à « tous les formulaires ajoutés par afficher_milieu sont sur fond gris ». Ça reste une règle graphique assez légère, normalement ça ne devrait pas poser de problème avec les formulaires à cet endroit.
    Le problème c’est qu’actuellement il n’y a aucun moyen de cibler en CSS ce qui est ajouté par affiche_milieu, il faut encapsuler tout ça dans un div.afficher_milieu (ce que j’ai fait pour tester le principe).

    Et donc, la fiche objet dans son ensemble pour illustrer :

    Ah, et un test pour le formulaire de traductions :

  • Unable to 'make' android ndk project - build fails : [build-openh264-x86] Error 2

    18 décembre 2015, par NoobNinja

    I’ve attempted these two fixes I’ve found while researching the issue :

    android update project  --23 --/Users/ajswann/Downloads/android-sdk-macosx

    make OS=android NDKROOT=/Users/ajswann/Downloads/android-sdk-macosx TARGET=android-19 ARCH=x86 clean

    ...however neither seems to resolve the issue.

    Any input/suggestions are appreciated.

    P.S.

    I’m running OSX - could this be an issue with attempting to run an x86 architecture on a 64 bit machine ?

    Error Message :

    chris-mini-mac:linphone-android ajswann$ sudo make
    ls: /opt/local/etc/openssl/certs: No such file or directory
    /Users/ajswann/Downloads/android-sdk-macosx/tools/android update project --path . --target android-23
    Updated project.properties
    Updated local.properties
    build.xml: Found version-tag: custom. File will not be updated.
    Updated file ./proguard-project.txt
    It seems that there are sub-projects. If you want to update them
    please use the --subprojects parameter.
    /Users/ajswann/Downloads/android-sdk-macosx/tools/android update test-project --path tests -m .
    Resolved location of main project to: /groupchat/linphone-android/tests
    Updated project.properties
    Updated local.properties
    Updated file tests/proguard-project.txt
    Updated ant.properties
    /Users/ajswann/Downloads/android-sdk-macosx/tools/android update project --path liblinphone_tester --target android-23
    Updated project.properties
    Updated local.properties
    Updated file liblinphone_tester/proguard-project.txt
    ant -e -S clean
    Buildfile: /groupchat/linphone-android/build.xml
    No sub-builds to iterate on
    mkdir -p /groupchat/linphone-android/submodules/externals/openh264/include/wels
    rsync -rvLpgoc --exclude ".git"  /groupchat/linphone-android/submodules/externals/openh264/codec/api/svc/* /groupchat/linphone-android/submodules/externals/openh264/include/wels/.
    building file list ... done

    sent 156 bytes  received 20 bytes  352.00 bytes/sec
    total size is 56216  speedup is 319.41
    mkdir -p /groupchat/linphone-android/submodules/externals/build/openh264
    mkdir -p /groupchat/linphone-android/submodules/externals/build/openh264/arm
    cd /groupchat/linphone-android/submodules/externals/build/openh264/arm \
       &amp;&amp; rsync -rvLpgoc --exclude ".git"  /groupchat/linphone-android/submodules/externals/openh264/* .
    building file list ... done

    sent 18841 bytes  received 20 bytes  37722.00 bytes/sec
    total size is 48272799  speedup is 2559.40
    cd /groupchat/linphone-android/submodules/externals/build/openh264/arm &amp;&amp; \
       make libraries -j4 OS=android ARCH=arm NDKROOT=/Users/ajswann/Downloads/android-ndk-r10e TARGET=android-19
    cd ./ &amp;&amp; sh ./codec/common/generate_version.sh
    Keeping existing codec/common/inc/version_gen.h
    mkdir -p /groupchat/linphone-android/submodules/externals/build/openh264
    mkdir -p /groupchat/linphone-android/submodules/externals/build/openh264/x86
    cd /groupchat/linphone-android/submodules/externals/build/openh264/x86 \
       &amp;&amp; rsync -rvLpgoc --exclude ".git"  /groupchat/linphone-android/submodules/externals/openh264/* .
    building file list ... done

    sent 18841 bytes  received 20 bytes  12574.00 bytes/sec
    total size is 48272799  speedup is 2559.40
    cd /groupchat/linphone-android/submodules/externals/build/openh264/x86 &amp;&amp; \
       make libraries -j4 OS=android ARCH=x86 NDKROOT=/Users/ajswann/Downloads/android-ndk-r10e TARGET=android-19
    cd ./ &amp;&amp; sh ./codec/common/generate_version.sh
    nasm -DX86_32 -f elf -I./codec/common/x86/   -o codec/decoder/core/x86/dct.o codec/decoder/core/x86/dct.asm
    codec/decoder/core/x86/dct.asm:1: error: label or instruction expected at start of line
    codec/decoder/core/x86/dct.asm:144: error: label or instruction expected at start of line
    codec/decoder/core/x86/dct.asm:234: error: symbol `IdctResAddPred_mmx' redefined
    codec/decoder/core/x86/dct.asm:262: error: symbol `WelsBlockZero16x16_sse2' redefined
    codec/decoder/core/x86/dct.asm:276: error: symbol `WelsBlockZero8x8_sse2' redefined
    codec/decoder/core/x86/dct.asm:287: error: label or instruction expected at start of line
    make[1]: *** [codec/decoder/core/x86/dct.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    Keeping existing codec/common/inc/version_gen.h
    make[1]: *** wait: No child processes.  Stop.
    make: *** [build-openh264-x86] Error 2

    Source Repository (I simply clone it, add the platform-tools and tools folder from my android-sdk and run ’make’ and I get this error) :

    https://github.com/TheBaobabTeam/linphone-android