Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (97)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (6499)

  • Encoding a screenshot into a video using FFMPEG

    2 juillet 2013, par mohM

    I'm trying to get the pixels from the screen, and encode the screenshot into a video using ffmpeg. I've seen a couple of examples but they either assume you already have the pixel data, or use image file input. It seems like whether I use sws_scale() or not (which is included in the examples I've seen), or whether I'm typecasting a HBITMAP or RGBQUAD* it's telling me that the image src data is bad and is encoding a blank image rather than the screenshot. Is there something I'm missing here ?

    AVCodec* codec;
    AVCodecContext* c = NULL;
    AVFrame* inpic;
    uint8_t* outbuf, *picture_buf;
    int i, out_size, size, outbuf_size;
    HBITMAP hBmp;
    //int x,y;

    avcodec_register_all();

    printf("Video encoding\n");

    // Find the mpeg1 video encoder
    codec = avcodec_find_encoder(CODEC_ID_H264);
    if (!codec) {
       fprintf(stderr, "Codec not found\n");
       exit(1);
    }
    else printf("H264 codec found\n");

    c = avcodec_alloc_context3(codec);
    inpic = avcodec_alloc_frame();

    c->bit_rate = 400000;
    c->width = screenWidth;                                     // resolution must be a multiple of two
    c->height = screenHeight;
    c->time_base.num = 1;
    c->time_base.den = 25;
    c->gop_size = 10;                                           // emit one intra frame every ten frames
    c->max_b_frames=1;
    c->pix_fmt = PIX_FMT_YUV420P;
    c->codec_id = CODEC_ID_H264;
    //c->codec_type = AVMEDIA_TYPE_VIDEO;

    //av_opt_set(c->priv_data, "preset", "slow", 0);
    //printf("Setting presets to slow for performance\n");

    // Open the encoder
    if (avcodec_open2(c, codec,NULL) < 0) {
       fprintf(stderr, "Could not open codec\n");
       exit(1);
    }
    else printf("H264 codec opened\n");

    outbuf_size = 100000 + 12*c->width*c->height;           // alloc image and output buffer
    //outbuf_size = 100000;
    outbuf = static_cast(malloc(outbuf_size));
    size = c->width * c->height;
    picture_buf = static_cast(malloc((size*3)/2));
    printf("Setting buffer size to: %d\n",outbuf_size);

    FILE* f = fopen("example.mpg","wb");
    if(!f) printf("x  -  Cannot open video file for writing\n");
    else printf("Opened video file for writing\n");

    /*inpic->data[0] = picture_buf;
    inpic->data[1] = inpic->data[0] + size;
    inpic->data[2] = inpic->data[1] + size / 4;
    inpic->linesize[0] = c->width;
    inpic->linesize[1] = c->width / 2;
    inpic->linesize[2] = c->width / 2;*/


    //int x,y;
    // encode 1 second of video
    for(i=0;itime_base.den;i++) {
       fflush(stdout);


       HWND hDesktopWnd = GetDesktopWindow();
       HDC hDesktopDC = GetDC(hDesktopWnd);
       HDC hCaptureDC = CreateCompatibleDC(hDesktopDC);
       hBmp = CreateCompatibleBitmap(GetDC(0), screenWidth, screenHeight);
       SelectObject(hCaptureDC, hBmp);
       BitBlt(hCaptureDC, 0, 0, screenWidth, screenHeight, hDesktopDC, 0, 0, SRCCOPY|CAPTUREBLT);
       BITMAPINFO bmi = {0};
       bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
       bmi.bmiHeader.biWidth = screenWidth;
       bmi.bmiHeader.biHeight = screenHeight;
       bmi.bmiHeader.biPlanes = 1;
       bmi.bmiHeader.biBitCount = 32;
       bmi.bmiHeader.biCompression = BI_RGB;
       RGBQUAD *pPixels = new RGBQUAD[screenWidth*screenHeight];
       GetDIBits(hCaptureDC,hBmp,0,screenHeight,pPixels,&bmi,DIB_RGB_COLORS);

    inpic->pts = (float) i * (1000.0/(float)(c->time_base.den))*90;
       avpicture_fill((AVPicture*)inpic, (uint8_t*)pPixels, PIX_FMT_BGR32, c->width, c->height);                   // Fill picture with image
       av_image_alloc(inpic->data, inpic->linesize, c->width, c->height, c->pix_fmt, 1);
       //printf("Allocated frame\n");
       //SaveBMPFile(L"screenshot.bmp",hBmp,hDc,screenWidth,screenHeight);
       ReleaseDC(hDesktopWnd,hDesktopDC);
       DeleteDC(hCaptureDC);
       DeleteObject(hBmp);

       // encode the image
       out_size = avcodec_encode_video(c, outbuf, outbuf_size, inpic);
       printf("Encoding frame %3d (size=%5d)\n", i, out_size);
       fwrite(outbuf, 1, out_size, f);
    }

    // get the delayed frames
    for(; out_size; i++) {
       fflush(stdout);

       out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
       printf("Writing frame %3d (size=%5d)\n", i, out_size);
       fwrite(outbuf, 1, out_size, f);
    }

    // add sequence end code to have a real mpeg file
    outbuf[0] = 0x00;
    outbuf[1] = 0x00;
    outbuf[2] = 0x01;
    outbuf[3] = 0xb7;
    fwrite(outbuf, 1, 4, f);
    fclose(f);
    free(picture_buf);
    free(outbuf);

    avcodec_close(c);
    av_free(c);
    av_free(inpic);
    printf("Closed codec and Freed\n");
  • ffmpeg concatenate images in one image

    26 juillet 2016, par drlexa

    I use this to get frames from video and concatenate them in one image :

    ffmpeg -i output.mp4 -vf 'fps=2,tile=1000x1' out.jpg

    But there is a problem : I do not know number of frames that will be fetched. Here I hardcoded tile size 1000x1, but if there will be more than 1000 frames, then will be an error. Before starting ffmpeg I do not know actual size of tile.

    So I want use command like :

    ffmpeg -i output.mp4 -vf 'fps=2,tile=*x1' out.jpg

    That means : I want you to concatenate ALL images that will be fetched in one row, but I cannot use * as an argument for tile.

    Is there some way to solve my problem ?

  • converting all the mp4 audio files in a folder to mp3 using ffmpeg

    21 juillet 2016, par Raulp

    how can I convert all of the mp4 files in a given folder to mp3 using ffmpeg.
    Almost all of the links I have seen on google is all about converting mp4 video to mp3.
    I can do this via VLC player but I have got huge collection 1000 mp4 audio files and want this to be done over command line by some script or command.
    Is it possible to do it via gstreamer ?