Recherche avancée

Médias (91)

Autres articles (69)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (9997)

  • video.js record timestamp blob is invalid after the first one [closed]

    10 octobre 2022, par Codengine

    I am building a video messaging service. I have used video.js and videojs record to record video and audio.

    


    I have used timeSlice option of record plugin to 2 second so every 2 second I get blobs which I cans save in server and then merge later.

    


    Everything is fine. I can get the blob and upload ins server.

    


    But the issue is - only the first blob is correct and othr blobs I cannot concate altogether. I have tried ffmpeg and opencv both to merge the videos in backend. Both says all but the first blob is incorrect.

    


    Need help on this. I have been strugging with this last few days with no solution yet.

    


  • ffmpeg - how to record live stream from ip cameras and saved as playlist.m3u8 over time for each folder

    29 mars 2016, par Android Mobile

    Can you help me with ffmpeg image processing ?
    I’m trying to execute it with a command that failed.

    My record stream :

    ffmpeg -i "rtsp://192.168.1.10/user=admin_password=_channel=1_stream=0.sdp?real_stream" -c copy -map 0 -f segment -segment_list "D:/Program/xampp/htdocs/cam1/record/list.txt" -segment_time 900 -segment_atclocktime 1 -strftime 1 "D:/Program/xampp/htdocs/cam1/record/%Y-%m-%d_%H-%M-%S.mp4"

    But, I want to save the format playlist.m3u8 and video formats ts.

    Example :

    "D:/Program/xampp/htdocs/cam1/record/[foldertime]/playlist.m3u8" , inside [folertime] playlist.m3u8, cam01.ts, cam02.ts, cam03.ts, cam03.ts,....
  • ffmpeg record change color

    17 mars 2016, par Антон Михайлов

    Im try record video from screen, for write to video file im use ffmpeg(libavcodec). But on result i see other colors, my example :

    AVCodec *codec;
    AVCodecContext *c= NULL;
    AVStream *video_stream;
    AVOutputFormat *out;
    AVFormatContext *out_context;
    int i, ret, x, y, got_output;

    AVFrame *frame;
    AVPacket pkt;
    uint8_t endcode[] = { 0, 0, 1, 0xb7 };

    printf("Encode video file %s\n", filename);

    out = av_guess_format(NULL, filename, NULL);
    if (!out) {
       std::cout << "Could not deduce output format from file extension: using MPEG.\n" << filename << std::endl;
       out = av_guess_format("mpeg", filename, NULL);
    }

    if (!out) {
       std::cout << "Could not find suitable output format\n" << std::endl;
       return;
    }

    out->video_codec = (AVCodecID)codec_id;

    out_context = avformat_alloc_context();
    if (!out_context) {
       std::cout << "Memory error\n";
       return;
    }

    out_context->oformat = out;

    codec = avcodec_find_encoder((AVCodecID)codec_id);
    if (!codec) {
       fprintf(stderr, "Codec not found\n");
       exit(1);
    }

    video_stream = avformat_new_stream(out_context, codec);
    if (!video_stream) {
       std::cout << "Could not alloc stream\n";
       return;
    }

    c = video_stream->codec;
    if (!c) {
       fprintf(stderr, "Could not allocate video codec context\n");
       exit(1);
    }

    c->bit_rate = 20000000;

    c->width = rect_width;
    c->height = rect_height;

    c->time_base = (AVRational){1,25};
    c->gop_size = 10;
    c->max_b_frames = 1;
    c->pix_fmt = AV_PIX_FMT_YUV420P;

    if (codec_id == AV_CODEC_ID_H264)
       av_opt_set(c->priv_data, "preset", "slow", 0);

    if (avcodec_open2(c, codec, NULL) < 0) {
       fprintf(stderr, "Could not open codec\n");
       exit(1);
    }

    avio_open2(&out_context->pb, filename, AVIO_FLAG_WRITE, NULL, NULL );

    avformat_write_header(out_context, 0);

    frame = av_frame_alloc();
    if (!frame) {
       fprintf(stderr, "Could not allocate video frame\n");
       exit(1);
    }
    frame->format = c->pix_fmt;
    frame->width  = c->width;
    frame->height = c->height;

    ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height,
                        c->pix_fmt, 32);
    if (ret < 0) {
       fprintf(stderr, "Could not allocate raw picture buffer\n");
       exit(1);
    }

    fprintf(stderr, "*0\n");

    SwsContext *m_imageConvertContext = 0;

    fprintf(stderr, "*0.1\n");

    printf("size %3d %5d\n", rect_width, rect_height);

    if ((rect_width % 4 != 0 && rect_width % 8 != 0 && rect_width % 16 != 0)
           || (rect_height % 4 != 0 && rect_height % 8 != 0 && rect_height % 16 != 0)) {
       fprintf(stderr, "Video size dimensions must be multiple of 4,8 or 16.");
       return;
    }

    m_imageConvertContext = sws_getCachedContext(m_imageConvertContext, frame->width, frame->height,AV_PIX_FMT_0RGB32, frame->width, frame->height, c->pix_fmt, SWS_BILINEAR, NULL, NULL, NULL);

    fprintf(stderr, "*0.2\n");

    int pts = 0;

    for (i = 0; i < 25 * 20; i++) {

       QImage image = QGuiApplication::primaryScreen()->grabWindow(0, rect_x, rect_y, rect_width, rect_height).toImage().convertToFormat(QImage::Format_RGB32);


       pts ++;

       av_init_packet(&pkt);
       pkt.data = NULL;    // packet data will be allocated by the encoder
       pkt.size = 0;
       fflush(stdout);

       uint8_t *srcplanes[AV_NUM_DATA_POINTERS];
       srcplanes[0]=(uint8_t*)image.bits();
       srcplanes[1]=0;
       srcplanes[2]=0;
       srcplanes[3]=0;
       srcplanes[4]=0;
       srcplanes[5]=0;
       srcplanes[6]=0;
       srcplanes[7]=0;

       int srcstride[AV_NUM_DATA_POINTERS];
       srcstride[0]=image.bytesPerLine();
       srcstride[1]=0;
       srcstride[2]=0;
       srcstride[3]=0;
       srcstride[4]=0;
       srcstride[5]=0;
       srcstride[6]=0;
       srcstride[7]=0;

       int res = sws_scale(m_imageConvertContext, srcplanes, srcstride, 0,frame->height, frame->data, frame->linesize);

       frame->pts = pts;
       ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
       if (ret < 0) {
           fprintf(stderr, "Error encoding frame\n");
           exit(1);
       }
       if (got_output) {
           printf("Write frame %3d (size=%5d)\n", i, pkt.size);
           av_write_frame(out_context,&pkt);
           av_free_packet(&pkt);
       }
    }

    for (got_output = 1; got_output; i++) {
       fflush(stdout);
       ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
       if (ret < 0) {
           fprintf(stderr, "Error encoding frame\n");
           exit(1);
       }
       if (got_output) {
           printf("Write frame %3d (size=%5d)\n", i, pkt.size);
           av_interleaved_write_frame(out_context, &pkt);
           av_free_packet(&pkt);
       }
    }

    av_write_trailer(out_context);
    avio_close(out_context->pb);
    avcodec_close(c);

    av_free(c);
    av_freep(&frame->data[0]);
    av_frame_free(&frame);

    resolution 1920x1080. On original display look this http://joxi.ru/p27bbn6u093elm

    on save video colors is a dimmer http://joxi.ru/YmE99W1fZvbdWm

    It seems, white background color changes to gray. Or may be it is brightness. What im do is wrong ? How i can save to color ?

    UDP

    im try use

    int *inv_table, srcRange, *table, dstRange , brightness, contrast, saturation;

    int ret = sws_getColorspaceDetails(m_imageConvertContext, &inv_table, &srcRange, &table, &dstRange, &brightness, &contrast, &saturation);

    sws_setColorspaceDetails(m_imageConvertContext, sws_getCoefficients(SWS_CS_DEFAULT), srcRange, sws_getCoefficients(SWS_CS_ITU709), dstRange, brightness, contrast, saturation);

    but this is never change