Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (106)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (10053)

  • FFmpeg using Intel quicksync

    3 mars 2016, par KevinA

    I’m trying to use FFmpeg with Intel QuickSync(qsv)

    Finding the codec works, but when I go to open the codec I get a -40

    I’ve traced it to :
    ret = MFXVideoENCODE_GetVideoParam(q->session, &q->param) ;

    Below in my initialzation code :

    AVCodec* m_codec = ::avcodec_find_encoder_by_name("h264_qsv");
    if (!m_codec){
       DBGPRINTF("Could not find encoder");
       return E_INVALIDARG;
    }

    AVCodecContext* m_context = ::avcodec_alloc_context3(m_codec);
    if (!m_context){
       DBGPRINTF("Could not alloc AV context");
       return E_INVALIDARG;
    }

    mfxIMPL impl = MFX_IMPL_AUTO;
    mfxVersion ver = { { 1, 1 } };

    MFXInit(impl, &ver, &m_qsvContext->session);

    m_qsvContext->iopattern             = MFX_IOPATTERN_IN_OPAQUE_MEMORY;
    m_qsvContext->opaque_alloc          = 1;
    m_qsvContext->nb_opaque_surfaces    = 16;

    m_context->hwaccel_context          = m_qsvContext;    
    m_context->profile                  = FF_PROFILE_H264_BASELINE;

    AVRational fps;
    AVRational sar;
    fps.num                             = static_cast(m_targetFPS);
    fps.den                             = 1;
    sar.num                             = m_iHeightOut;
    sar.den                             = m_iWidthOut;
    //m_context->bit_rate               = 400000;
    m_context->width                    = m_iWidthOut;
    m_context->height                   = m_iHeightOut;
    m_context->has_b_frames             = 0;
    m_context->sample_aspect_ratio      = sar;
    m_context->time_base                = fps;

    m_context->gop_size                 = s_keyFramesMax;
    m_context->pix_fmt                  = AV_PIX_FMT_QSV;
    m_context->flags                   |= AV_CODEC_FLAG_QSCALE;
    m_context->flags                   |= CODEC_FLAG_PASS1;
    m_context->thread_count             = 1;
    m_context->codec_type               = AVMEDIA_TYPE_VIDEO;

    ::av_opt_set(m_context->priv_data, "preset", "fast", 0);
    ::av_opt_set(m_context->priv_data, "look_ahead", "0", 0);

    int ret = avcodec_open2(context, codec, nullptr);
    if (ret < 0) {
       DBGPRINTF("Could not open codec h264_qsv with code %d", ret);
       return ret;
    }

    I’m obviously missing something, but i’m not sure what. Can someone help point me in the correct direction ?

  • Create MPEG-DASH Initialization segment

    5 janvier 2016, par Mahout

    I am looking to convert between HLS and MPEG Dash. I do not access to the original fully concatenated video file, only the individual HLS segments.

    In doing this transformation to MPEG Dash I need to supply an initialziation segment for the Dash manifest .mpd file.

    My questions are :

    1. What is the structure of a Dash video initialization segment ?
    2. How can I generate/create one without the need for the original full file ?

    Perhaps a solution would involve getting MP4Box to convert the ’.ts’ HLS segments to Dash ’.m4s’ segments which are self initializing, but I am unsure how to go about this this ?

    Any ideas are much appreciated.

    Many thanks.

    UPDATE :
    Snippet to stream using original hls segments. Video plays all the way through but is just black.

     <representation width="426" height="238" framerate="25" bandwidth="400000">
       <segmentlist timescale="25000" duration="112500">
              <segmenturl media="video_0_400000/hls/segment_0.ts"></segmenturl>
              <segmenturl media="video_0_400000/hls/segment_1.ts"></segmenturl>
             <segmenturl media="video_0_400000/hls/segment_2.ts"></segmenturl>
       </segmentlist>
      </representation>
  • Increase Duration of a video FFMPEG C++

    9 avril 2015, par Shahroz Tariq

    I am using the code from the samples of FFmpeg which encodes a picture into a video. All I want to do is to give it a series of pictures and it gives me a video with each picture is taking one second`Code below is just taking one picture from my file system & creating video from it

    AVCodec *codec;
    AVCodecContext *c = NULL;
    int i, ret, x, y, got_output;
    FILE *f;

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

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

    /* find the mpeg1 video encoder */
    codec = avcodec_find_encoder((AVCodecID)codec_id);
    if (!codec)
    {
       fprintf(stderr, "Codec not found\n");
       exit(1);
    }

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

    /* put sample parameters */
    c->bit_rate = 400000;
    /* resolution must be a multiple of two */
    c->width = 200;
    c->height = 200;
    /* frames per second */
    AVRational rational;
    rational.num = 1;
    rational.den = 25;
    c->time_base = rational;
    /* emit one intra frame every ten frames
    * check frame pict_type before passing frame
    * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
    * then gop_size is ignored and the output of encoder
    * will always be I frame irrespective to gop_size
    */
    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);

    /* open it */
    if (avcodec_open2(c, codec, NULL) &lt; 0)
    {
       fprintf(stderr, "Could not open codec\n");
       exit(1);
    }

    fopen_s(&amp;f, filename, "wb");
    if (!f)
    {
       fprintf(stderr, "Could not open %s\n", filename);
       exit(1);
    }
    AVFrame *frame = OpenImage("..\\..\\..\\..\\..\\..\\1.jpg");
    //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;
    /* the image can be allocated by any means and av_image_alloc() is
    * just the most convenient way if av_malloc() is to be used */

    int screenHeight = 200;
    int screenWidth = 200;
    for (i = 0; i &lt; 25; i++)
    {
       av_init_packet(&amp;pkt);
       pkt.data = NULL;    // packet data will be allocated by the encoder
       pkt.size = 0;

       fflush(stdout);



       frame->pts = i;

       /* encode the image */
       ret = avcodec_encode_video2(c, &amp;pkt, frame, &amp;got_output);
       if (ret &lt; 0)
       {
           fprintf(stderr, "Error encoding frame\n");
           exit(1);
       }

       if (got_output)
       {
           printf("Write frame %3d (size=%5d)\n", i, pkt.size);
           fwrite(pkt.data, 1, pkt.size, f);
           av_free_packet(&amp;pkt);
       }
    }

    /* get the delayed frames */
    for (got_output = 1; got_output; i++)
    {
       fflush(stdout);

       ret = avcodec_encode_video2(c, &amp;pkt, NULL, &amp;got_output);
       if (ret &lt; 0)
       {
           fprintf(stderr, "Error encoding frame\n");
           exit(1);
       }

       if (got_output)
       {
           printf("Write frame %3d (size=%5d)\n", i, pkt.size);
           fwrite(pkt.data, 1, pkt.size, f);
           av_free_packet(&amp;pkt);
       }
    }

    /* add sequence end code to have a real mpeg file */
    fwrite(endcode, 1, sizeof(endcode), f);
    fclose(f);

    avcodec_close(c);
    av_free(c);
    av_freep(&amp;frame->data[0]);
    av_frame_free(&amp;frame);
    printf("\n");`