Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (97)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (9332)

  • Decoding .mp3 with ffmpeg

    17 juin 2013, par user2492388

    I want to decode an mp3-File with the ffmpeg library.

       #include
       #include <libavutil></libavutil>opt.h>
       #include <libavcodec></libavcodec>avcodec.h>
       #include <libavutil></libavutil>channel_layout.h>
       #include <libavutil></libavutil>common.h>
       #include <libavutil></libavutil>imgutils.h>
       #include <libavutil></libavutil>mathematics.h>
       #include <libavutil></libavutil>samplefmt.h>

       #define INBUF_SIZE 4096
       #define AUDIO_INBUF_SIZE 20480
       #define AUDIO_REFILL_THRESH 4096

       static void audio_decode_example(const char *outfilename, const char *filename)
       {
           AVCodec *codec;
           AVCodecContext *c= NULL;
           int len;
           FILE *f, *outfile;
           uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
           AVPacket avpkt;
           AVFrame *decoded_frame = NULL;

           av_init_packet(&amp;avpkt);

           printf("Decode audio file %s to %s\n", filename, outfilename);

           /* find the mpeg audio decoder */
           codec = avcodec_find_decoder(AV_CODEC_ID_MP3);
           if (!codec) {
               fprintf(stderr, "Codec not found\n");
               exit(1);
           }

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

           /* open it */
           if (avcodec_open2(c, codec, NULL) &lt; 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);
           }
           outfile = fopen(outfilename, "wb");
           if (!outfile) {
               av_free(c);
               exit(1);
           }

           /* decode until eof */
           avpkt.data = inbuf;
           avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);

           while (avpkt.size > 0) {
               int got_frame = 0;

               if (!decoded_frame) {
                   if (!(decoded_frame = avcodec_alloc_frame())) {
                       fprintf(stderr, "Could not allocate audio frame\n");
                       exit(1);
                   }
               } else
                   avcodec_get_frame_defaults(decoded_frame);

               len = avcodec_decode_audio4(c, decoded_frame, &amp;got_frame, &amp;avpkt);
               if (len &lt; 0) {
                   fprintf(stderr, "Error while decoding\n");
                   exit(1);
               }
               if (got_frame) {
                   /* if a frame has been decoded, output it */
                   int data_size = av_samples_get_buffer_size(NULL, c->channels,
                                                              decoded_frame->nb_samples,
                                                              c->sample_fmt, 1);
                   fwrite(decoded_frame->data[0], 1, data_size, outfile);
               }
               avpkt.size -= len;
               avpkt.data += len;
               avpkt.dts =
               avpkt.pts = AV_NOPTS_VALUE;
               if (avpkt.size &lt; AUDIO_REFILL_THRESH) {
                   memmove(inbuf, avpkt.data, avpkt.size);
                   avpkt.data = inbuf;
                   len = fread(avpkt.data + avpkt.size, 1,
                               AUDIO_INBUF_SIZE - avpkt.size, f);
                   if (len > 0)
                       avpkt.size += len;
               }
           }

           fclose(outfile);
           fclose(f);

           avcodec_close(c);
           av_free(c);
           avcodec_free_frame(&amp;decoded_frame);
       }


       int main(int argc, char **argv)
       {
           const char* filename;

           /* register all the codecs */
           avcodec_register_all();

           filename = argv[1];

           audio_decode_example("ausgabe.sw", filename);

           return 0;
       }

    And here is my problem : When i start my program, the decoding from the mp3-File into this raw data file succeed with no problem. But when I play this output file with my Alsa driver I have an distorted sound, its the original sound, but i sounds like the smurfs and its distorted.
    Have anyone here an idea ? The Code is from the original encoding_decoding.c example from ffmpeg. The only thing I changed is the AV_CODEC_ID, because I need .mp3.
    Sorry for my partially bad englisch.

  • Record Webcam as single JPG files [on hold]

    2 décembre 2016, par clic

    I have to record a Windows Directshow Webcam video stream (UHD, 30fps, yuyv422) as single JPG images. Performance is important, so preferably by using NVIDIA GPU acceleration via CUDA or something..

    What is the most simple but powerful solution, without having to buy proprietary software ?

    I had a look at ffmpeg, by recording as MJPEG and then using something like jpegtran to get the JPGs. I tried :

    ffmpeg -f dshow -video_size 1920x1080 -framerate 50 -vcodec mjpeg -i video="XI100DUSB-HDMI Video" out.avi

    But it results in an I/O error saying ’Could not set video options’. Maybe because of the yuyv422 pixel format of my Magewell USB dongles..

    Or is ffmpeg able to record as single JPGs directly somehow ?

    If someone has any other idea/solution besides ffmpeg, please let me know too ! Thanks !

    EDIT :

    I was now able to save JPGs directly, using webcamimg%04d.jpg instead of out.avi. But it’s always claiming about full real-time buffer. Raising the rtbufsize parameter doesn’t really help..

    ffmpeg console output :

    ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-li
    bopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.100 / 57. 64.100
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [dshow @ 0000000001c628a0] Could not set video options
    video=XI100DUSB-HDMI Video: I/O error

    Output of : ffmpeg -list_options true -f dshow -i video="XI100DUSB-HDMI Video"

    [dshow @ 00000000004d71e0] DirectShow video device options (from video devices)
    [dshow @ 00000000004d71e0]  Pin "Capture" (alternative pin name "0")
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1920x1080 fps=15 max s=1920x1080 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1920x1080 fps=15 max s=1920x1080 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=640x360 fps=15 max s=640x360 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=640x360 fps=15 max s=640x360 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=640x480 fps=15 max s=640x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=640x480 fps=15 max s=640x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=720x480 fps=15 max s=720x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=720x480 fps=15 max s=720x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=720x576 fps=15 max s=720x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=720x576 fps=15 max s=720x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=768x576 fps=15 max s=768x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=768x576 fps=15 max s=768x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=800x600 fps=15 max s=800x600 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=800x600 fps=15 max s=800x600 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=856x480 fps=15 max s=856x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=856x480 fps=15 max s=856x480 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=960x540 fps=15 max s=960x540 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=960x540 fps=15 max s=960x540 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1024x576 fps=15 max s=1024x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1024x576 fps=15 max s=1024x576 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1024x768 fps=15 max s=1024x768 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1024x768 fps=15 max s=1024x768 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x720 fps=15 max s=1280x720 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x720 fps=15 max s=1280x720 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x800 fps=15 max s=1280x800 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x800 fps=15 max s=1280x800 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x960 fps=15 max s=1280x960 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x960 fps=15 max s=1280x960 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x1024 fps=15 max s=1280x1024 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1280x1024 fps=15 max s=1280x1024 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1368x768 fps=15 max s=1368x768 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1368x768 fps=15 max s=1368x768 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1440x900 fps=15 max s=1440x900 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1440x900 fps=15 max s=1440x900 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1600x1200 fps=15 max s=1600x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1600x1200 fps=15 max s=1600x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1680x1050 fps=15 max s=1680x1050 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1680x1050 fps=15 max s=1680x1050 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1920x1200 fps=15 max s=1920x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   pixel_format=yuyv422  min s=1920x1200 fps=15 max s=1920x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1920x1080 fps=15 max s=1920x1080 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1920x1080 fps=15 max s=1920x1080 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=640x360 fps=15 max s=640x360 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=640x360 fps=15 max s=640x360 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=640x480 fps=15 max s=640x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=640x480 fps=15 max s=640x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=720x480 fps=15 max s=720x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=720x480 fps=15 max s=720x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=720x576 fps=15 max s=720x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=720x576 fps=15 max s=720x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=768x576 fps=15 max s=768x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=768x576 fps=15 max s=768x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=800x600 fps=15 max s=800x600 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=800x600 fps=15 max s=800x600 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=856x480 fps=15 max s=856x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=856x480 fps=15 max s=856x480 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=960x540 fps=15 max s=960x540 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=960x540 fps=15 max s=960x540 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1024x576 fps=15 max s=1024x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1024x576 fps=15 max s=1024x576 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1024x768 fps=15 max s=1024x768 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1024x768 fps=15 max s=1024x768 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x720 fps=15 max s=1280x720 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x720 fps=15 max s=1280x720 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x800 fps=15 max s=1280x800 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x800 fps=15 max s=1280x800 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x960 fps=15 max s=1280x960 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x960 fps=15 max s=1280x960 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x1024 fps=15 max s=1280x1024 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1280x1024 fps=15 max s=1280x1024 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1368x768 fps=15 max s=1368x768 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1368x768 fps=15 max s=1368x768 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1440x900 fps=15 max s=1440x900 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1440x900 fps=15 max s=1440x900 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1600x1200 fps=15 max s=1600x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1600x1200 fps=15 max s=1600x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1680x1050 fps=15 max s=1680x1050 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1680x1050 fps=15 max s=1680x1050 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1920x1200 fps=15 max s=1920x1200 fps=59.9999
    [dshow @ 00000000004d71e0]   unknown compression type 0xE436EB7D  min s=1920x1200 fps=15 max s=1920x1200 fps=59.9999
    video=XI100DUSB-HDMI Video: Immediate exit requested
  • avcodec/nvenc : Remove aspect-ratio decompensation logic

    23 novembre 2016, par Philip Langdale
    avcodec/nvenc : Remove aspect-ratio decompensation logic
    

    This dubious behaviour in nvenc was finally removed by nvidia, and
    as we refuse to run on anything older than 7.0, we don’t need to
    keep it around for old versions.

    • [DH] libavcodec/nvenc.c