Recherche avancée

Médias (1)

Mot : - Tags -/géodiversité

Autres articles (111)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (8451)

  • Additionals : Add statesUS method

    1er juillet 2014, par jdforsythe
    Additionals : Add statesUS method
    

    Validates two-letter US state abbreviations (including DC)

    Closes #1005

  • 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