Recherche avancée

Médias (91)

Autres articles (66)

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

  • Decode H264 video using libavcodec, C

    10 janvier 2015, par deadman

    I’m trying to decode a raw h264 file with ffmpeg/libavcodec, but can’t get it to work properly. Output should be a raw YUV-File for now. It’s possible to compile the code with GCC

    gcc -o decoder decoder.c -L./lib/ -llibavcodec -llibavutil

    avcodec.dll, avutil.dll and swresample.dll must be placed in the directory for the .exe to start. Output in the CMD looks like this (only part of it, but its always like this) :

    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65562
    [h264 @ 00a80f20] error while decoding MB 80 54, bytestream -10
    [h264 @ 00a80f20] concealing 1649 DC, 1649 AC, 1649 MV errors in B frame
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] Missing reference picture, default is 65566
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65568
    [h264 @ 00a80f20] reference picture missing during reorder
    [h264 @ 00a80f20] Missing reference picture, default is 65570
    [h264 @ 00a80f20] reference picture missing during reorder

    Heres my code

    #include
    #include

    #ifdef HAVE_AV_CONFIG_H
    #undef HAVE_AV_CONFIG_H
    #endif

    #include "libavcodec/avcodec.h"
    //#include "libavcodec/libavutil/mathematics.h"

    #define INBUF_SIZE 4096

    void video_decode(char *outfilename, char *filename)
    {
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int frame, got_picture, len;
       FILE *f, *outf;
       AVFrame *picture;
       uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
       AVPacket avpkt;
       int i;

       av_init_packet(&avpkt);

       memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);

       codec = avcodec_find_decoder(AV_CODEC_ID_H264);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }

       c = avcodec_alloc_context3(codec);
       picture = av_frame_alloc();

       if((codec->capabilities)&CODEC_CAP_TRUNCATED)
           (c->flags) |= CODEC_FLAG_TRUNCATED;

       c->height = 1080;
       c->width = 1920;

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

       f = fopen(filename, "rb");
       if (!f) {
           fprintf(stderr, "could not open %s\n", filename);
           exit(1);
       }

       outf = fopen(outfilename,"w");
       if(!outf){
           fprintf(stderr, "could not open %s\n", filename);
           exit(1);
       }
       frame = 0;
       for(;;) {
           avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
           if (avpkt.size == 0)
               break;

           avpkt.data = inbuf;
           while (avpkt.size > 0) {

               len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);

               if (len < 0) {
                   fprintf(stderr, "Error while decoding frame %d\n", frame);
                   exit(1);
               }
               if (got_picture) {
                   printf("saving frame %3d\n", frame);
                   fflush(stdout);
                   for(i=0; iheight; i++)
                       fwrite(picture->data[0] + i * picture->linesize[0], 1, c->width, outf  );
                   for(i=0; iheight/2; i++)
                       fwrite(picture->data[1] + i * picture->linesize[1], 1, c->width/2, outf );
                   for(i=0; iheight/2; i++)
                       fwrite(picture->data[2] + i * picture->linesize[2], 1, c->width/2, outf );
                   frame++;
               }
               avpkt.size -= len;
               avpkt.data += len;
           }
       }

       avpkt.data = NULL;
       avpkt.size = 0;
       len = avcodec_decode_video2(c,picture, &got_picture, &avpkt);
       if(got_picture) {
           printf("saving last frame %d\n",frame);
           fflush(stdout);
           for(i=0; iheight; i++)
               fwrite(picture->data[0] + i * picture->linesize[0], 1, c->width, outf );
           for(i=0; iheight/2; i++)
               fwrite(picture->data[1] + i * picture->linesize[1], 1, c->width/2, outf );
           for(i=0; iheight/2; i++)
               fwrite(picture->data[2] + i * picture->linesize[2], 1, c->width/2, outf );
           frame++;
       }

       fclose(f);
       fclose(outf);

       avcodec_close(c);
       av_free(c);
       av_frame_free(&picture);
       printf("\n");
    }

    int main(int argc, char **argv){
       avcodec_register_all();
       video_decode("test", "trailer.264");

       return 0;
    }

    I also tried different videos in different formats (of course i changed the codec in the code in this case) like MPEG1, H263, H265, but none of those was working properly either.
    I hope someone can help me with this and tell me what I’m doing wrong here. Thanks

  • ffmpeg select frames using between

    17 décembre 2014, par skyuuka

    I use the following command to select the 18 to 22 frames of an video :

    ffmpeg -i input_video.avi -vf "select=between(n\,18\,22)" -f image2 frames_%3d.png

    But I get the following errors :

    Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       creation_time   : 2013-01-04 21:17:15
       encoder         : 6.0.1
       encoder-eng     : 6.0.1
       date            : 2013-01-04T13:17:15-0800
       date-eng        : 2013-01-04T13:17:15-0800
     Duration: 00:00:09.17, start: 0.000000, bitrate: 20766 kb/s
       Stream #0.0(und): Video: h264 (Baseline), yuv420p, 1920x1080, 20765 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
       Metadata:
         creation_time   : 2013-01-04 21:17:15
       Stream #0.1(und): Audio: aac, 44100 Hz, mono, s16, 61 kb/s
       Metadata:
         creation_time   : 2013-01-04 21:17:15
    Incompatible pixel format 'yuv420p' for codec 'png', auto-selecting format 'rgb24'
    [buffer @ 0x2589ac0] w:1920 h:1080 pixfmt:yuv420p
    [select @ 0x259da00] [Eval @ 0x7fff7a38e940] Missing ')' or too many args in 'between(n,18,22)'
    [select @ 0x259da00] Error while parsing expression 'between(n,18,22)'
    Error initializing filter 'select' with args 'between(n,18,22)'
    Error opening filters!
  • ffmpeg change video stream resolution

    10 décembre 2014, par skorpionet

    I have an MKV with a video stream with wrong resolution of 1920x800, but the inside film is 1920x1080 so my main video player, an LG Smart TV, shows a flattened image. I can easily change resolution in container metadata but LG TV ignores this data and read only video stream data.

    First question : only way to change video stream resolution data is scale the video ?

    To scale with ffmpeg I used this command :

    ffmpeg -i input.mkv -map 0 -c:a copy -c:s copy -c:v libx264 -preset slow -crf 17 -vf scale=1920:1080,setdar=16/9 output.mkv

    Now the mkv is fine, my LG TV read it, looks awesome but..... size went from 3,3Gb to 12Gb !!
    Overall bit rate of 3,3Gb video is 2.704 Kbps, 12Gb is 9.829 Kbps. I think that 7000Kbps more are useless, in original video there aren’t info to raise quality.

    Second question : Why this huge size change ? What is my mistake ?

    Best Regards