Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (81)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (9829)

  • Rendering Bitmap using ANativeWindow

    19 février 2016, par William Seemann

    I’m decoding a video frame and trying to render is using Android’s ANativeWindow API in conjunction with a SurfaceView. I know I’m decoding the frame successfully because my demo application returns the decoded (and re-encoded) frame as a bitmap and displays it in an ImageView (bottom image). However, when trying to draw the decoded frame to a SurfaceView I’m getting garbage output (top image). Can someone explain why ?

    const int TARGET_IMAGE_FORMAT = AV_PIX_FMT_RGBA;
    const int TARGET_IMAGE_CODEC = AV_CODEC_ID_PNG;

    void convert_image(State *state, AVCodecContext *pCodecCtx, AVFrame *pFrame, AVPacket *avpkt, int *got_packet_ptr, int width, int height) {
           AVCodecContext *codecCtx;
           AVCodec *codec;
           AVFrame *frame;

           *got_packet_ptr = 0;

           if (width == -1) {
               width = pCodecCtx->width;
           }

           if (height == -1) {
               height = pCodecCtx->height;
           }

           codec = avcodec_find_encoder(TARGET_IMAGE_CODEC);
           if (!codec) {
               printf("avcodec_find_decoder() failed to find decoder\n");
               goto fail;
           }

           codecCtx = avcodec_alloc_context3(codec);
           if (!codecCtx) {
               printf("avcodec_alloc_context3 failed\n");
               goto fail;
           }

           codecCtx->bit_rate = pCodecCtx->bit_rate;
           //codecCtx->width = pCodecCtx->width;
           //codecCtx->height = pCodecCtx->height;
           codecCtx->width = width;
           codecCtx->height = height;
           codecCtx->pix_fmt = TARGET_IMAGE_FORMAT;
           codecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
           codecCtx->time_base.num = pCodecCtx->time_base.num;
           codecCtx->time_base.den = pCodecCtx->time_base.den;

           if (!codec || avcodec_open2(codecCtx, codec, NULL) < 0) {
               printf("avcodec_open2() failed\n");
               goto fail;
           }

           frame = av_frame_alloc();

           if (!frame) {
               goto fail;
           }

           // Determine required buffer size and allocate buffer
           int numBytes = avpicture_get_size(TARGET_IMAGE_FORMAT, codecCtx->width, codecCtx->height);
           void * buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t));

           printf("wqwq %d\n", numBytes);

           avpicture_fill(((AVPicture *)frame),
                   buffer,
                   TARGET_IMAGE_FORMAT,
                   codecCtx->width,
                   codecCtx->height);

           avpicture_alloc(((AVPicture *)frame),
                   TARGET_IMAGE_FORMAT,
                   codecCtx->width,
                   codecCtx->height);

           struct SwsContext *scalerCtx = sws_getContext(pCodecCtx->width,
                   pCodecCtx->height,
                   pCodecCtx->pix_fmt,
                   //pCodecCtx->width,
                   //pCodecCtx->height,
                   width,
                   height,
                   TARGET_IMAGE_FORMAT,
                   SWS_FAST_BILINEAR, 0, 0, 0);

           if (!scalerCtx) {
               printf("sws_getContext() failed\n");
               goto fail;
           }

           sws_scale(scalerCtx,
                   (const uint8_t * const *) pFrame->data,
                   pFrame->linesize,
                   0,
                   pFrame->height,
                   frame->data,
                   frame->linesize);

           int ret = avcodec_encode_video2(codecCtx, avpkt, frame, got_packet_ptr);

           // code to draw the re-encoded frame on the surface view
           if (state->native_window) {    
               ANativeWindow_Buffer windowBuffer;

               if (ANativeWindow_lock(state->native_window, &windowBuffer, NULL) == 0) {
                   memcpy(windowBuffer.bits, avpkt->data, windowBuffer.width * windowBuffer.height * 4);
                   ANativeWindow_unlockAndPost(state->native_window);
               }
           }

           if (ret < 0) {
               *got_packet_ptr = 0;
           }

           fail:
           av_free(frame);

           free(buffer);

           if (codecCtx) {
               avcodec_close(codecCtx);
               av_free(codecCtx);
           }

           if (scalerCtx) {
               sws_freeContext(scalerCtx);
           }

           if (ret < 0 || !*got_packet_ptr) {
               av_free_packet(avpkt);
           }
       }

    enter image description here

  • ffmpeg x11grab Fedora 22 cannot open display [on hold]

    4 août 2015, par voor

    Running a fairly recent version of Fedora 22 :

    Linux localhost 4.1.3-200.fc22.x86_64 #1 SMP Wed Jul 22 19:51:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

    Dual screen Acer XB270HU and AOC 2369. Also uses NVIDIA Drivers :

    ➜  ~  rpm -qa | grep nvidia
    nvidia-driver-libs-352.30-1.fc22.x86_64
    nvidia-driver-352.30-1.fc22.x86_64
    nvidia-settings-352.30-1.fc22.x86_64
    nvidia-libXNVCtrl-352.30-1.fc22.x86_64
    dkms-nvidia-352.30-1.fc22.x86_64
    nvidia-driver-libs-352.30-1.fc22.i686

    Whenever I attempt to do a x11grab in ffmpeg I get an error :

    ➜  ~  ffmpeg -f x11grab -r 15 -s 1920x1080 -i :0 -vcodec h264 -crf 30 -y output.mp4
    ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 5.1.1 (GCC) 20150422 (Red Hat 5.1.1-1)
     configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
     libavutil      54. 20.100 / 54. 20.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 25.101 / 56. 25.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.102 /  5. 11.102
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0x1fe1d40] Cannot open display :0, error 1.
    :0: Input/output error

    I’ve tried a few different commands basically copy/pasta from the web on how to do screengrabs. I don’t need audio, just video, and all of them result in the same error.

    I am able to do xwininfo without any problems :

    ➜  ~  xwininfo    

    xwininfo: Please select the window about which you
             would like information by clicking the
             mouse in that window.

    xwininfo: Window id: 0x1e0006c "linux - ffmpeg x11grab Fedora 22 cannot open display - Stack Overflow - Google Chrome"

     Absolute upper-left X:  0
     Absolute upper-left Y:  27
     Relative upper-left X:  0
     Relative upper-left Y:  27
     Width: 2560
     Height: 1413
     Depth: 24
     Visual: 0x21
     Visual Class: TrueColor
     Border width: 0
     Class: InputOutput
     Colormap: 0x20 (installed)
     Bit Gravity State: ForgetGravity
     Window Gravity State: NorthWestGravity
     Backing Store State: NotUseful
     Save Under State: no
     Map State: IsViewable
     Override Redirect State: no
     Corners:  +0+27  -1920+27  -1920-0  0
     -geometry 2560x14130
  • hwcontext : Add frame context mapping for nontrivial contexts

    4 mars 2017, par Mark Thompson
    hwcontext : Add frame context mapping for nontrivial contexts
    

    Some frames contexts are not usable without additional format-specific
    state in hwctx. This change adds new functions frames_derive_from and
    frames_derive_to to initialise this state appropriately when deriving
    a frames context which will require it to be set.

    (cherry picked from commit 27978155bc661eec9f22bcf82c9cfc099cff4365)

    • [DH] libavutil/hwcontext.c
    • [DH] libavutil/hwcontext_internal.h