Recherche avancée

Médias (91)

Autres articles (64)

  • 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

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (12795)

  • FFmpeg command to apply multiple filters and limit the final file size

    16 mars 2016, par Konrad —

    I’m using command below to convert video to a format of the defined scale and in order to hardcode the subtitles

    Original syntax

    ffmpeg -i "Original File.mov"  -vf subtitles=Subtitles.srt -vf scale=1920:1080 \
          -crf 12 "Final File".mov

    Problem

    I would like to expand this command further and :

    • ensure that the produce file is under 2GB
    • I would like to include additional parameters with advanced subtitle options, like setting the canvas size and fixing the potential delay

    Side notes

    I reckon that in case of predefining the file size the -crf 12 paramater will be redundant ?

  • H264 decoding using ffmpeg

    14 juillet 2016, par Kindermann

    I’m trying to decode a video stream with ffmpeg library, that’s how I do it basically :

    void video_decode(const char *filename)
    {
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int frame_count=0;
       FILE *f;
       AVFrame *frame;
       uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
       AVPacket avpkt;
       av_init_packet(&avpkt);
       memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
       printf("Decoding video file...\n");
       /* find the h264 video decoder */
       codec = avcodec_find_decoder(AV_CODEC_ID_H264);
       c = avcodec_alloc_context3(codec);
       c->bit_rate = 400000;
       c->width = 1920;
       c->height = 1080;

       if (avcodec_open2(c, codec, NULL) < 0) {
           fprintf(stderr, "Could not open codec\n");
           exit(1);
       }
       frame = av_frame_alloc();
       for (;;) {
           avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);        
       if (avpkt.size == 0)
               break;
           avpkt.data = inbuf;
           while(avpkt.size > 0){

           int len, got_frame;
               len = avcodec_decode_video2(c, frame, &got_frame, &avpkt);          
           if (len < 0) {
                   fprintf(stderr, "Errr while decding frame %d\n", frame_count);
                   exit (1);
               }
               if (got_frame) {
                   //Print out frame information..
           }
               if (avpkt.data) {
                   avpkt.size -= len;
                   avpkt.data += len;
               }
       }              
       }  
    }

    But I got the following outputs :

    Decoding video file...
    [h264 @ 0x303c040] decode_slice_header error
    [h264 @ 0x303c040] decode_slice_header error
    [h264 @ 0x303c040] decode_slice_header error
    [h264 @ 0x303c040] no frame!
    Errr while decding frame 0

    Obviously the initiation of codec was incomplete. Do you have experience with h264 api ? Any help would be appreciated.

  • Libavcodec and QuickSync

    15 février 2016, par FrancescoBLT

    I’m attempting to encode in h264 format using libavcodec with and without QuickSync hardware acceleration. If I don’t use the hw acceleration is quite simple :

    ff_codec = avcodec_find_encoder(AV_CODEC_ID_H264) ;

    ff_cdctx = avcodec_alloc_context3(ff_codec) ;

    ff_cdctx->width = 1920;
    ff_cdctx->height = 1080;
    ff_cdctx->time_base.num = 1;
    ff_cdctx->time_base.den = 25;
    ff_cdctx->sample_aspect_ratio.num = 16;
    ff_cdctx->sample_aspect_ratio.den = 9;
    ff_cdctx->pix_fmt = AV_PIX_FMT_YUV420P;
    av_dict_set(&param,"profile","main",0);
    av_dict_set(&param,"preset","medium",0);
    av_dict_set(&param,"tune","film",0)<0);
    ff_cdctx->gop_size = 10;
    ff_cdctx->max_b_frames = 1;
    opres = avcodec_open2(ff_cdctx,ff_codec,&param);
    ff_frame = av_frame_alloc();
    ff_frame->format = ff_cdctx->pix_fmt;
    ff_frame->width  = ff_cdctx->width;
    ff_frame->height = ff_cdctx->height;

    opres = av_image_alloc(ff_frame->data, ff_frame->linesize,ff_cdctx->width,ff_cdctx->height,ff_cdctx->pix_fmt, 32);
    ff_frame->linesize[0] = ff_cdctx->width;
    ff_frame->linesize[1] = ff_frame->linesize[2] = ff_cdctx->width>>1;

    ff_frame->sample_aspect_ratio.num = ff_cdctx->sample_aspect_ratio.num;
    ff_frame->sample_aspect_ratio.den = ff_cdctx->sample_aspect_ratio.den;
    av_init_packet(&pkt);
    enc_err = avcodec_encode_video2(ff_cdctx,&pkt,ff_frame,&got_pkt);  }

    And so on for all source frame. Problem arise when I attempt to use hardware
    acceleration. In this case I use :

    ff_codec = avcodec_find_encoder_by_name("h264_qsv") ;
    for gathering the codec. But when I attempt to open it, the result is "invalid parameter" :
    opres = avcodec_open2(ff_cdctx,ff_codec,&param) ;
    if(opres<0)

    if(av_strerror(opres,err_str,256)==0) OutputDebugStringA(err_str) ;
    return -6 ;

    Did anyone have attempted to use QuickSync from code ? In the examples there is only one file (qsvdec.c) and is for decoding, not for encoding.
    regards