Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (76)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (8141)

  • ffmpeg created timelapse won't play on other players than VLC

    27 février 2019, par theFeiter

    I am creating a Timelapse Video with the following ffmpeg command :

    ffmpeg -r 24 -start_number 7754 -i IMG_%d.JPG -pix_fmt yuv420p -s 1920x1080 Output.mp4

    This works without errors, but when I try to play the .mp4 on my Android Phone it shows an Error : "Unable to play file. Not enough resources"

    With the VLC App : "Currently unable to play this video. Stop the other video and try again"

    When I put the Video through Handbrake It plays fine on all players.

    I tried out changing some ffmpeg options, but nothing helped.

    When I compare the output of ffmpeg -i Output.mp4 from the original with the output from the video out of handbrake it differs only in the video bitrate.

    Are there any other options I can try to change ?

    This is the ffmpeg output :

    ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
     configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libavresample   3.  7.  0 /  3.  7.  0
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100
    Input #0, image2, from 'PIC_%d.jpg':
     Duration: 00:00:02.24, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 720x1280 [SAR 1:1 DAR 9:16], 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    [swscaler @ 0x56059fe911a0] deprecated pixel format used, make sure you did set range correctly
    [libx264 @ 0x56059f9b4180] using SAR=1/1
    [libx264 @ 0x56059f9b4180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0x56059f9b4180] profile High, level 3.1
    [libx264 @ 0x56059f9b4180] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=2 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'ttyffmpeg.mp4':
     Metadata:
       encoder         : Lavf57.83.100
       Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], q=-1--1, 2 fps, 16384 tbn, 2 tbc
       Metadata:
         encoder         : Lavc57.107.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame=   56 fps= 11 q=-1.0 Lsize=    5242kB time=00:00:26.50 bitrate=1620.4kbits/s speed=5.38x    
    video:5241kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.025511%
    [libx264 @ 0x56059f9b4180] frame I:9     Avg QP:14.75  size:111662
    [libx264 @ 0x56059f9b4180] frame P:35    Avg QP:17.14  size: 90885
    [libx264 @ 0x56059f9b4180] frame B:12    Avg QP:17.74  size: 98312
    [libx264 @ 0x56059f9b4180] consecutive B-frames: 62.5% 21.4% 16.1%  0.0%
    [libx264 @ 0x56059f9b4180] mb I  I16..4:  2.6% 96.8%  0.6%
    [libx264 @ 0x56059f9b4180] mb P  I16..4:  1.0% 93.5%  1.2%  P16..4:  1.6%  1.1%  0.4%  0.0%  0.0%    skip: 1.1%
    [libx264 @ 0x56059f9b4180] mb B  I16..4:  0.6% 66.7%  2.1%  B16..8: 10.1% 10.6%  3.0%  direct: 4.8%  skip: 2.0%  L0:35.3% L1:34.6% BI:30.0%
    [libx264 @ 0x56059f9b4180] 8x8 transform intra:97.3% inter:91.2%
    [libx264 @ 0x56059f9b4180] coded y,uvDC,uvAC intra: 94.3% 79.0% 44.3% inter: 77.2% 76.9% 31.3%
    [libx264 @ 0x56059f9b4180] i16 v,h,dc,p: 59% 25% 14%  2%
    [libx264 @ 0x56059f9b4180] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 42%  3%  2%  2%  4%  4%  6%
    [libx264 @ 0x56059f9b4180] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 27% 10%  3%  5%  5%  8%  5%  7%
    [libx264 @ 0x56059f9b4180] i8c dc,h,v,p: 40% 24% 29%  7%
    [libx264 @ 0x56059f9b4180] Weighted P-Frames: Y:8.6% UV:5.7%
    [libx264 @ 0x56059f9b4180] ref P L0: 67.0% 15.7% 14.0%  3.2%  0.1%
    [libx264 @ 0x56059f9b4180] ref B L0: 88.0% 11.4%  0.6%
    [libx264 @ 0x56059f9b4180] kb/s:1533.05
  • Get two consecutive frames

    27 mars 2019, par Wizix

    I’m trying to compare two frames of a video using libav of FFmpeg, I followed this tutorial. This is what I have done for the moment :

    int response = 0;
    int packetsToProcess = 500;

    while (av_read_frame(pFormatCtx, pPacket) >= 0) {
       if (pPacket->stream_index == videoStreamIndex) {
           response = decode_packet(pPacket, pCodecCtx, pFrame);

           if (response < 0) break;
           if (--packetsToProcess <= 0) break;
       }

       av_packet_unref(pPacket);
    }

    static int decode_packet(AVPacket *pPacket, AVCodecContext *pCodecContext, AVFrame *pFrame)
    {
       int response = avcodec_send_packet(pCodecContext, pPacket);
       while (response >= 0) {
           response = avcodec_receive_frame(pCodecContext, pFrame);
           if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) break;
           if (response >= 0)
               printf("Frame %d pts %ld.\n", pCodecContext->frame_number, pFrame->pts);
           av_frame_unref(pFrame);
       }
       return 0;
    }

    static int diff_frames(AVFrame *f, AVFrame *n)
    {
       if (f->height != n->height || f->width != n->width) {
           printf("Frames don't have the same size.\n");
           return -1;
       }

       int pixelDiff = 0;

       for (int y = 0; y < f->height; ++y) {
           for (int x = 0; x < f->width; ++x) {
               int fp = f->data[0][y * f->linesize[0] + x];
               int np = n->data[0][y * n->linesize[0] + x];

               if (fp != np) {
                   ++pixelDiff;
               }
           }
       }

       printf("Diff between %ld and %ld: %d", f->pts, n->pts, pixelDiff / (f->height * f->width));

       return 0;
    }

    My function diff_frames needs two frames to compare and my issue is : how can I have the frame and the next frame to send to it ?

  • FFmpeg overwrite an AVPacket

    26 janvier 2019, par Alejandro Ramírez

    Hello guys I am working with video. I wan to encrypt the I-frames of one video compressed in H.264. So I get the AVPacket from the video and compare if (AVPacket.flags & AV_PKT_FLAG_KEY) to know if the packet has an I frame, but when I try to print the AVPacket.data I don’t have any information to encrypt.
    Where can I get the information regarding to I-frame. ahead a put my code, thank you.

    #include <iostream>
    extern "C" {
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libswscale></libswscale>swscale.h>
    #include <libavutil></libavutil>avutil.h>
    }
    #define INBUF_SIZE 4096
    //#define AV_INPUT_BUFFER_PADDING_SIZE 32
    int main (int argc, char * argv[])
    {
       //av_register_all();//omit
       //revisar el número de argumentos en el video
       AVFormatContext *pFormatCtx = NULL;
       AVCodec *dec = NULL;
       AVCodecContext *pCodecCtx = NULL;
       AVStream *st = NULL;
       AVDictionary *opts = NULL;
       AVFrame *frame;
       AVPacket avpkt;
       uint8_t inbuf [INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
       FILE *f;
       int frame_count;
       int video_stream_index = -1;

       //av_init_packet (&amp;avpkt);

       memset (inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
       if (avformat_open_input (&amp;pFormatCtx, argv[1], NULL, NULL) != 0)
           return -1;
       if (avformat_find_stream_info (pFormatCtx, NULL) &lt; 0)
           return -1;
       //video_stream_index = av_find_best_stream (pFormatCtx,AVMEDIA_TYPE_VIDEO, -1, -1, &amp;dec,0);
       video_stream_index = av_find_best_stream (pFormatCtx,AVMEDIA_TYPE_VIDEO, -1, -1, &amp;dec,0);
       if ( video_stream_index &lt; 0)
           return -1;
       std::cout &lt;&lt; "video_stream; " &lt;&lt; video_stream_index &lt;&lt; "\n";
       st = pFormatCtx -> streams [video_stream_index];
       std::cout &lt;&lt; "number of frames " &lt;&lt; st -> nb_frames &lt;&lt; "\n";
       std::cout &lt;&lt; "event_flags " &lt;&lt; st -> event_flags &lt;&lt; "\n";
       //pCodecCtx = st -> codec;//deprecated

       dec = avcodec_find_decoder (st -> codecpar -> codec_id);
       std::cout &lt;&lt; "codec_id: " &lt;&lt; st -> codecpar -> codec_id &lt;&lt; "\n";
       std::cout &lt;&lt; "AV_CODEC_ID_H264: " &lt;&lt; AV_CODEC_ID_H264 &lt;&lt; "\n";
       if (!dec)
           return -1;
       pCodecCtx = avcodec_alloc_context3 (dec);
       if (!pCodecCtx)
           return -1;
       //av_dict_set (&amp;opts, "refcounted_frames", "0", 0);
       avcodec_parameters_to_context (pCodecCtx, st -> codecpar);


       std::cout &lt;&lt; "todo bien \n";    
       if (avcodec_open2 (pCodecCtx, dec, &amp;opts) &lt; 0)
           return -1;
       /*************hasta aqui buen codigo*********************************************/
       frame = av_frame_alloc ();
       if (!frame)
           return -1;
       av_init_packet (&amp;avpkt);
       avpkt.data = NULL;
       avpkt.size = 0;
       f = fopen (argv[1], "r");
       int times = 1;
       while (av_read_frame (pFormatCtx, &amp;avpkt) >= 0){
           AVPacket oripkt = avpkt;
           if (oripkt.stream_index == video_stream_index){
               if (oripkt.flags &amp; AV_PKT_FLAG_KEY){
                   std::cout &lt;&lt; "times: " &lt;&lt; times ++ &lt;&lt; "\n";
                   std::cout &lt;&lt; "avpkt.flags: " &lt;&lt; oripkt.flags &lt;&lt; "\n";
                   std::cout &lt;&lt; "tam avpkt.data: " &lt;&lt; sizeof(oripkt.data) &lt;&lt; "\n";
                   std::cout &lt;&lt; "tam avpkt.data: " &lt;&lt; oripkt.data &lt;&lt; "\n";
                   std::cout &lt;&lt; "oripkt.size: " &lt;&lt; oripkt.size &lt;&lt; "\n";
                   std::cout &lt;&lt; "oripkt.side_date_eme: " &lt;&lt; oripkt.side_data_elems &lt;&lt; "\n";
                   if (!oripkt.data)
                       std::cout &lt;&lt; "no tengo dinero \n";
               }
           }
       }

       std::cout &lt;&lt; "Fin del programa " &lt;&lt; "\n";
    }
    </iostream>