Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (5)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (3187)

  • Why there is no AVFrame->data[2] data when decode h264 by ffmpeg use "h264_cuvid"

    27 juillet 2017, par Wu NL

    env : ubuntu 16.04 64 bit ; ffmpeg 3.3.2 build whih cuda cuvid libnpp...
    use ffmpeg cmd : ffmpeg -vsync 0 -c:v h264_cuvid -i test.264 -f rawvideo test.yuv works fine, the generated yuv file is ok.
    BUT When I decode this 264 file by my code use ’h264_cuvid’ decoder, something problem happens, this is my code :

    #include

    #define __STDC_CONSTANT_MACROS

    #ifdef _WIN32
    //Windows
    extern "C"
    {
    #include "libavcodec/avcodec.h"
    };
    #else
    //Linux...
    #ifdef __cplusplus
    extern "C"
    {
    #endif
    #include <libavcodec></libavcodec>avcodec.h>
    #ifdef __cplusplus
    };
    #endif
    #endif


    //test different codec
    #define TEST_H264  1
    #define TEST_HEVC  0

    int main(int argc, char* argv[])
    {
       AVCodec *pCodec;
       AVCodecContext *pCodecCtx= NULL;
       AVCodecParserContext *pCodecParserCtx=NULL;

       FILE *fp_in;
       FILE *fp_out;
       AVFrame *pFrame;

       const int in_buffer_size=4096;
       unsigned char in_buffer[in_buffer_size + FF_INPUT_BUFFER_PADDING_SIZE]= {0};
       unsigned char *cur_ptr;
       int cur_size;
       AVPacket packet;
       int ret, got_picture;


    #if TEST_HEVC
       enum AVCodecID codec_id=AV_CODEC_ID_HEVC;
       char filepath_in[]="bigbuckbunny_480x272.hevc";
    #elif TEST_H264
       AVCodecID codec_id=AV_CODEC_ID_H264;
       char filepath_in[]="2_60_265to264.264";
    #else
       AVCodecID codec_id=AV_CODEC_ID_MPEG2VIDEO;
       char filepath_in[]="bigbuckbunny_480x272.m2v";
    #endif

       char filepath_out[]="mainSend.yuv";
       int first_time=1;


       //av_log_set_level(AV_LOG_DEBUG);

       avcodec_register_all();

    //    pCodec = avcodec_find_decoder(codec_id);
       pCodec = avcodec_find_decoder_by_name("h264_cuvid");
       if (!pCodec)
       {
           printf("Codec not found\n");
           return -1;
       }
       pCodecCtx = avcodec_alloc_context3(pCodec);
       if (!pCodecCtx)
       {
           printf("Could not allocate video codec context\n");
           return -1;
       }

       pCodecParserCtx=av_parser_init(pCodec->id);
       if (!pCodecParserCtx)
       {
           printf("Could not allocate video parser context\n");
           return -1;
       }

       if (avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0)
       {
           printf("Could not open codec\n");
           return -1;
       }
       //Input File
       fp_in = fopen(filepath_in, "rb");
       if (!fp_in)
       {
           printf("Could not open input stream\n");
           return -1;
       }
       //Output File
       fp_out = fopen(filepath_out, "wb");
       if (!fp_out)
       {
           printf("Could not open output YUV file\n");
           return -1;
       }

       pFrame = av_frame_alloc();
       av_init_packet(&amp;packet);

       while (1)
       {

           cur_size = fread(in_buffer, 1, in_buffer_size, fp_in);
           if (cur_size == 0)
               break;
           cur_ptr=in_buffer;

           while (cur_size>0)
           {

               int len = av_parser_parse2(
                             pCodecParserCtx, pCodecCtx,
                             &amp;packet.data, &amp;packet.size,
                             cur_ptr, cur_size,
                             AV_NOPTS_VALUE, AV_NOPTS_VALUE, AV_NOPTS_VALUE);

               cur_ptr += len;
               cur_size -= len;

               if(packet.size==0)
                   continue;

               //Some Info from AVCodecParserContext
               printf("[Packet]Size:%6d\t",packet.size);
               switch(pCodecParserCtx->pict_type)
               {
               case AV_PICTURE_TYPE_I:
                   printf("Type:I\tNumber:%4d\n",pCodecParserCtx->output_picture_number);
                   break;
               case AV_PICTURE_TYPE_P:
                   printf("Type:P\t");
                   break;
               case AV_PICTURE_TYPE_B:
                   printf("Type:B\t");
                   break;
               default:
                   printf("Type:Other\t");
                   break;
               }
               printf("Number:%4d\n",pCodecParserCtx->output_picture_number);
               AVFrame* myFrame = av_frame_alloc();
               ret = avcodec_decode_video2(pCodecCtx, myFrame, &amp;got_picture, &amp;packet);
               if (ret &lt; 0)
               {
                   printf("Decode Error.\n");
                   return ret;
               }
               if (got_picture)
               {
                   if(first_time)
                   {
                       printf("\nCodec Full Name:%s\n",pCodecCtx->codec->long_name);
                       printf("width:%d\nheight:%d\n\n",pCodecCtx->width,pCodecCtx->height);
                       first_time=0;
                   }
                   //Y, U, V
                   for(int i=0; iheight; i++)
                   {
                       fwrite(myFrame->data[0]+myFrag-g>linesize[0]*i,1,myFrame->width,fp_out);
                   }
                   for(int i=0; iheight/2; i++)
                   {
                       fwrite(myFrame->data[1]+myFrag-g>linesize[1]*i,1,myFrame->width/2,fp_out);
                   }
                   for(int i=0; iheight/2; i++)
                   {
                       fwrite(myFrame->data[2]+myFrag-g>linesize[2]*i,1,myFrame->width/2,fp_out);
                   }
    //                printf("pframe's width height %d %d\t key frame %d\n",myFrame->width,myFrame->height,myFrame->key_frame);
                   printf("Succeed to decode 1 frame!\n");
                   av_frame_free(&amp;myFrame);
               }
           }

       }

       fclose(fp_in);
       fclose(fp_out);


       av_parser_close(pCodecParserCtx);

       av_frame_free(&amp;pFrame);
       avcodec_close(pCodecCtx);
       av_free(pCodecCtx);

       return 0;
    }

    In this demo code, I call h264_cuvid by vcodec_find_decoder_by_name("h264_cuvid");
    BUT the code crash at fwrite(myFrame->data[2]+myFrag-g>linesize[2]*i,1,myFrame->width/2,fp_out);
    So after debug with codeblocks, I found that there is no data in myFrame->data[2] codeblocks watching window

    Any suggestion ? thanks !

  • Audio out of sync, direct capture device stream (Windows 10)

    3 mai 2020, par user3459555

    Using ffplay, the video stays in sync using this command :

    &#xA;&#xA;

    ffplay -f dshow -rtbufsize 702000k video="Cam Link"&#xA;ffplay version git-2020-05-01-39fb1e9 Copyright (c) 2003-2020 the FFmpeg developers&#xA;  built with gcc 9.3.1 (GCC) 20200328&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 43.100 / 56. 43.100&#xA;  libavcodec     58. 82.100 / 58. 82.100&#xA;  libavformat    58. 42.101 / 58. 42.101&#xA;  libavdevice    58.  9.103 / 58.  9.103&#xA;  libavfilter     7. 80.100 /  7. 80.100&#xA;  libswscale      5.  6.101 /  5.  6.101&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;Input #0, dshow, from &#x27;video=Cam Link&#x27;:vq=    0KB sq=    0B f=0/0&#xA;  Duration: N/A, start: 141954.961000, bitrate: N/A&#xA;    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 59.94 fps, 59.94 tbr, 10000k tbn, 10000k tbc&#xA;142992.53 M-V: -0.001 fd=   3 aq=    0KB vq=    0KB sq=    0B f=0/0&#xA;

    &#xA;&#xA;

    Every controller button press stays in sync.

    &#xA;&#xA;

    The audio however :

    &#xA;&#xA;

    ffplay -f dshow audio="Digital Audio Interface (Cam Link)" -tune zerolatency&#xA;ffplay version git-2020-05-01-39fb1e9 Copyright (c) 2003-2020 the FFmpeg developers&#xA;  built with gcc 9.3.1 (GCC) 20200328&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 43.100 / 56. 43.100&#xA;  libavcodec     58. 82.100 / 58. 82.100&#xA;  libavformat    58. 42.101 / 58. 42.101&#xA;  libavdevice    58.  9.103 / 58.  9.103&#xA;  libavfilter     7. 80.100 /  7. 80.100&#xA;  libswscale      5.  6.101 /  5.  6.101&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;Input #0, dshow, from &#x27;audio=Digital Audio Interface (Cam Link)&#x27;:&#xA;  Duration: N/A, start: 143092.007000, bitrate: 1411 kb/s&#xA;    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s&#xA;143103.21 M-A:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0&#xA;

    &#xA;&#xA;

    Is always behined by about a full second.

    &#xA;&#xA;

    I'm not trying to record this, just trying to directly play from the Elgato Cam Link 1:1 output to my computer screen. When this is played in the Elgato Game Capture software, the video and audio are 1:1, no issues. So I know it's not the console or the capture device.

    &#xA;

  • Knitr Plot Animation - disappearing output files ?

    20 avril 2015, par tcs

    I downloaded the latest ffmpeg (exe version), unzipped the files, renamed the directory to ffmpeg, copied the directory into c :\Program Files. I appended my PATH variable to include c :\Program Files\ffmpeg\bin. Finally, I restarted Rstudio.

    While attempting to run the following code chunk :

    ```{r perf_plot, fig.width=7, fig.height=6, fig.show='animate'}
    library(corrplot)
    corrplot(m, method = "circle")
    m&lt;-sequence_2_matrix(perf_list[[1]])
    corrplot(m)
    for (i in 2:length(perf_list)) {
     m&lt;-(m*(i-1)+sequence_2_matrix(perf_list[[i]]))/i
     corrplot(m,method = "circle")

    }

    I see within the output in in my RMarkdown window that the ffmpeg call seems to be successfully run, but while watching the directory where my code is located the png that is attempted to be created can often disappear, or not appear at all. Strangeness.

    processing file: MarkovRoutinesSim.rmd
     |........                                                         |  13%
     ordinary text without R code

     |...........                                                      |  17%
    label: unnamed-chunk-2
     |..............                                                   |  22%
     ordinary text without R code

     |.................                                                |  26%
    label: unnamed-chunk-3
     |....................                                             |  30%
     ordinary text without R code

     |.......................                                          |  35%
    label: unnamed-chunk-4
     |.........................                                        |  39%
     ordinary text without R code

     |............................                                     |  43%
    label: unnamed-chunk-5
     |...............................                                  |  48%
     ordinary text without R code

     |..................................                               |  52%
    label: unnamed-chunk-6
     |.....................................                            |  57%
     ordinary text without R code

     |........................................                         |  61%
    label: unnamed-chunk-7
     |..........................................                       |  65%
     ordinary text without R code

     |.............................................                    |  70%
    label: perf_plot (with options)
    List of 3
    $ fig.width : num 7
    $ fig.height: num 6
    $ fig.show  : chr "animate"

    executing: ffmpeg -y -r 1 -i MarkovRoutinesSim_files/figure-html/perf_plot-%d.png MarkovRoutinesSim_files/figure-html/perf_plot-.webm
    ffmpeg version N-71515-ga40cee0 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
     libavutil      54. 22.101 / 54. 22.101
     libavcodec     56. 34.100 / 56. 34.100
     libavformat    56. 30.100 / 56. 30.100
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 14.100 /  5. 14.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, image2, from 'MarkovRoutinesSim_files/figure-html/perf_plot-%d.png':
     Duration: 00:00:00.44, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: png, pal8, 1344x1152 [SAR 7559:7559 DAR 7:6], 25 fps, 25 tbr, 25 tbn, 25 tbc
    [libvpx @ 000000000310e720] v1.4.0
    Output #0, webm, to 'MarkovRoutinesSim_files/figure-html/perf_plot-.webm':
     Metadata:
       encoder         : Lavf56.30.100
       Stream #0:0: Video: vp8 (libvpx), yuv420p, 1344x1152 [SAR 1:1 DAR 7:6], q=-1--1, 200 kb/s, 1 fps, 1k tbn, 1 tbc
       Metadata:
         encoder         : Lavc56.34.100 libvpx
    Stream mapping:
     Stream #0:0 -> #0:0 (png (native) -> vp8 (libvpx))
    Press [q] to stop, [?] for help
     |................................................                 |  74%
     ordinary text without R code

     |...................................................              |  78%
    label: unnamed-chunk-8
     |......................................................           |  83%
     ordinary text without R code

     |.........................................................        |  87%
    label: unnamed-chunk-9
    frame=   11 fps=0.0 q=0.0 Lsize=     108kB time=00:00:11.00 bitrate=  80.8kbits/s    
    video:108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.524176%
     |...........................................................      |  91%
     ordinary text without R code

     |..............................................................   |  96%
    label: unnamed-chunk-10
     |.................................................................| 100%
     ordinary text without R code


    "C:/Program Files/RStudio/bin/pandoc/pandoc" MarkovRoutinesSim.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output MarkovRoutinesSim.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\Tim\Documents\R\win-library\3.2\rmarkdown\rmd\h\default.html" --variable "theme:bootstrap" --include-in-header "C:\Users\Tim\AppData\Local\Temp\Rtmpkrtekd\rmarkdown-str7d43d7d5475.html" --mathjax --variable "mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --no-highlight --variable "highlightjs=C:\Users\Tim\Documents\R\win-library\3.2\rmarkdown\rmd\h\highlight"
    output file: MarkovRoutinesSim.knit.md


    Output created: MarkovRoutinesSim.html

    Any ideas on what might be happening ? I’ve tried adding in other graphs, and I see this random behavior of the file folder appearing disappearing, sometimes the file is created, other times not.