Recherche avancée

Médias (1)

Mot : - Tags -/ipad

Autres articles (49)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

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

  • ffmpeg H264 Encode Frame at a time for network streaming

    4 février 2017, par Richard Harrow

    I’m working on a remote desktop application, I would like to send an encoded H264 packet over TCP by using ffmpeg for the encoding. However I couldn’t find useful info for the particular case of encoding just one frame (already on YUV444) and get the packet.

    I have several issues, the first was that :

    avcodec_encode_video2

    Was not blocking, I found that most of the time you get the "delayed" frames at the end, however, since this is a real time streaming the solution was :

    av_opt_set(mCodecContext->priv_data, "tune", "zerolatency", 0);

    Now I got the frame, but several issues, it takes a while and even worse I got a gray with trash pixels video as result. My configuration for the Codec Context :

    m_pCodecCtx->bit_rate=8000000;
    m_pCodecCtx->codec_id=AV_CODEC_ID_H264;
    m_pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
    m_pCodecCtx->width=1920;
    m_pCodecCtx->height=1080;
    m_pCodecCtx->pix_fmt=AV_PIX_FMT_YUV444P;
    m_pCodecCtx->time_base.num = 1;
    m_pCodecCtx->time_base.den = 25;
    m_pCodecCtx->gop_size = 1;
    m_pCodecCtx->keyint_min = 1;
    m_pCodecCtx->i_quant_factor = float(0.71);
    m_pCodecCtx->b_frame_strategy = 20;
    m_pCodecCtx->qcompress = (float)0.6;
    m_pCodecCtx->qmax = 51;
    m_pCodecCtx->qmin = 20;
    m_pCodecCtx->max_qdiff = 4;
    m_pCodecCtx->refs = 4;
    m_pCodecCtx->max_b_frames = 1;
    m_pCodecCtx->thread_count = 1;

    I would like to know how this could be done, how do I set the "I Frames" ? and, that would be the optimal for a "one at a time" encoding ? Also I’m not concerned right now with the quality, just need to be fast enough (under 16 ms).

    For the encoding part :

    nres = avcodec_encode_video2(m_pCodecCtx,&packet,m_pFrame,&framefinished);

    if(nres<0){
       qDebug() << "error encoding: " << nres << endl;
    }

    if(framefinished){
       m_pFrame->pts++;
        ofstream vidout("video.h264",ios::app);
        if(vidout.good()){
            vidout.write((const char*)&packet.data[0],packet.size);
        }
        vidout.close();

        av_packet_unref(&packet);

    }

    I’m not using a container, just a raw file, ffplay reproduce raw files if the packets are right, and that’s my principal issue. I’m planning to send the packet over tcp and decode on the client. Any help would be greatly appreciated.

  • Can't replicate FFMpeg Prores quality setting

    3 février 2017, par Ben L

    Using ffmpeg as a library. I’m looking to create a global-quality slider with very inconsistent results. AvCodecContext::global_quality seems like a good place to start. Not all lossy codecs make reference to this member, but it does appear to work for ProRes.

    c:\>ffmpeg.exe -i test.mov -c:v prores_ks -q:v 28 out.mov     # output 10mb file

    c:\>ffmpeg.exe -i test.mov -c:v prores_ks -q:v 2 out.mov     # output 28mb file

    Great. Now let’s do it in code. Based on Muxing.c. I’m distilling down the code a lot just to give a hint about which api’s I’m calling.

    AVStream* AddStream(AVFormatContext* formatContext, int quality)
    {
       AVCodec* codec = AVFindEncoder("prores_ks");

       AVStream* newStream = avformat_new_stream(formatContext, codec);

       newStream->id = formatContext->nb_streams - 1;

       AVCodecContext c = avcodec_alloc_context3(codec);

       c->codec_id = AV_CODEC_ID_PRORES;
       c->codec_type = AVMEDIA_TYPE_VIDEO;
       c->width = 1920;
       c->height = 1080;

       newStream->time_base = av_inv_q(frameRate);
       c->time_base = av_inv_q(frameRate);

       c->pix_fmt = AV_PIX_FMT_YUVA444P10;

       c->global_quality = quality;

       return newStream;
    }
    ......
    //excerpt from WriteFrame()

    AVPacket pkt;
    av_init_packet(&pkt);
    pkt.data= pVideoBuffer;
    pkt.size= iVideoBufferSize;
    int gotpkt = 0;
    int ret = avcodec_encode_video2(pCodecContext, &pkt, pPicture, &gotpkt);
    if (ret == 0)
    {
       av_packet_rescale_ts(&pkt, pCodecContext->time_base, pVideoStream->time_base);

       if (gotpkt) {
           ret = av_interleaved_write_frame(pFormatContext, &pkt);
       }
    }

    I can’t get quality to affect the size of the output. Any ideas ?

    This is the excerpt from proresenc_kostya.c

    ctx->force_quant = avctx->global_quality / FF_QP2LAMBDA;
    if (!ctx->force_quant) {
       if (!ctx->bits_per_mb) {
           for (i = 0; i < NUM_MB_LIMITS - 1; i++)
               if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height *
                                          ctx->pictures_per_frame)
                   break;
           ctx->bits_per_mb   = ctx->profile_info->br_tab[i];
       } else if (ctx->bits_per_mb < 128) {
           av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
           return AVERROR_INVALIDDATA;
       }

       min_quant = ctx->profile_info->min_quant;
       max_quant = ctx->profile_info->max_quant;
       for (i = min_quant; i < MAX_STORED_Q; i++) {
           for (j = 0; j < 64; j++)
               ctx->quants[i][j] = ctx->quant_mat[j] * i;
       }

       ctx->slice_q = av_malloc(ctx->slices_per_picture * sizeof(*ctx->slice_q));
       if (!ctx->slice_q) {
           encode_close(avctx);
           return AVERROR(ENOMEM);
       }

       ctx->tdata = av_mallocz(avctx->thread_count * sizeof(*ctx->tdata));
       if (!ctx->tdata) {
           encode_close(avctx);
           return AVERROR(ENOMEM);
       }

       for (j = 0; j < avctx->thread_count; j++) {
           ctx->tdata[j].nodes = av_malloc((ctx->slices_width + 1)
                                           * TRELLIS_WIDTH
                                           * sizeof(*ctx->tdata->nodes));
           if (!ctx->tdata[j].nodes) {
               encode_close(avctx);
               return AVERROR(ENOMEM);
           }
           for (i = min_quant; i < max_quant + 2; i++) {
               ctx->tdata[j].nodes[i].prev_node = -1;
               ctx->tdata[j].nodes[i].bits      = 0;
               ctx->tdata[j].nodes[i].score     = 0;
           }
       }
    }

    Edit :

    Outputs from ffmpeg.exe :

    profile 4, 1020 slices, interlacing: no, 6576 bits per MB
    frame size upper bound: 11429274

    Output from ffmpeg avlog on my app :

    profile 4, 1020 slices, interlacing: no, 1425 bits per MB
    frame size upper bound: 6170103
  • ffmpeg c# Windows forms

    7 février 2017, par TODO

    I’m fairly new to windows forms and ffmpeg (unity background).

    I’m trying to get a button click on a windows form to take a png sequence, and convert it to an mp4 with ffmpeg.

           Process ffmpeg = new Process();

           ffmpeg.StartInfo.FileName = Path.Combine(Environment.CurrentDirectory, @"c:\test\ffmpeg.exe");

           ffmpeg.StartInfo.Arguments = "-framerate 25 -i 0001_IMG%03d.JPG -c:v libx264 -preset ultrafast -crf 0 -vf scale=-2:1080 -pix_fmt yuv420p temp.mp4";

           ffmpeg.Start();

    I have no problem running the same ffmpeg command from cmd, or from within a c++ console application I experimented with Using system("")

    I’ve been stuck on this for a little longer than I care to admit, and have tried searching for answers, but am still learning as i go.

    Any help would be much appreciated.