Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (105)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (16061)

  • how to change the frame rate and capturing image size from IP camera

    6 décembre 2015, par rockycai

    Now I have a IP camera and I want to capture image from it through RTSP.I use below code and it works well.But the camera’s frame rate is 25/s.So I got a lot of images per second.I don’t want it.And per image is 6.2MB.I also don’t want need to get high quality image.What can I do to slower the frame rate and smaller the size of image ?

    #ifndef INT64_C
    #define INT64_C(c) (c ## LL)
    #define UINT64_C(c) (c ## ULL)
    #endif

    #ifdef __cplusplus
    extern "C" {
    #endif
       /*Include ffmpeg header file*/
    #include <libavformat></libavformat>avformat.h>
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libswscale></libswscale>swscale.h>
    #include
    #ifdef __cplusplus
    }
    #endif

    #include


    static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame);

    int main (int argc, const char * argv[])
    {
       AVFormatContext *pFormatCtx;
       int             i, videoStream;
       AVCodecContext  *pCodecCtx;
       AVCodec         *pCodec;
       AVFrame         *pFrame;
       AVFrame         *pFrameRGB;
       AVPacket        packet;
       int             frameFinished;
       int             numBytes;
       uint8_t         *buffer;

       // Register all formats and codecs
       av_register_all();
    //  const char *filename="C:\libraries\gfjyp.avi";
       // Open video file
       //AVDictionary *options = NULL;
       //av_dict_set(&amp;options,"rtsp_transport","tcp",0);
       if(av_open_input_file(&amp;pFormatCtx, argv[1], NULL, 0, NULL)!=0)
           return -1; // Couldn't open file

       // Retrieve stream information
       if(av_find_stream_info(pFormatCtx)&lt;0)
           return -1; // Couldn't find stream information

       // Dump information about file onto standard error
       dump_format(pFormatCtx, 0, argv[1], false);

       // Find the first video stream
       videoStream=-1;
       for(i=0; inb_streams; i++)
           if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
           {
               videoStream=i;
               break;
           }
           if(videoStream==-1)
               return -1; // Didn't find a video stream

           // Get a pointer to the codec context for the video stream
           pCodecCtx=pFormatCtx->streams[videoStream]->codec;

           // Find the decoder for the video stream
           pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
           if(pCodec==NULL)
               return -1; // Codec not found

           // Open codec
           if(avcodec_open(pCodecCtx, pCodec)&lt;0)
               return -1; // Could not open codec

           // Hack to correct wrong frame rates that seem to be generated by some codecs

           if(pCodecCtx->time_base.num>1000 &amp;&amp; pCodecCtx->time_base.den==1)
               pCodecCtx->time_base.den=1000;

           //pCodecCtx->time_base.den=1;
           //pCodecCtx->time_base.num=1;
           // Allocate video frame
           pFrame=avcodec_alloc_frame();

           // Allocate an AVFrame structure
           pFrameRGB=avcodec_alloc_frame();
           if(pFrameRGB==NULL)
               return -1;

           // Determine required buffer size and allocate buffer
           numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,
               pCodecCtx->height);

           //buffer=malloc(numBytes);
           buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));

           // Assign appropriate parts of buffer to image planes in pFrameRGB
           avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
               pCodecCtx->width, pCodecCtx->height);

           // Read frames and save first five frames to disk
           i=0;
           while(av_read_frame(pFormatCtx, &amp;packet)>=0)
           {
               // Is this a packet from the video stream?
               if(packet.stream_index==videoStream)
               {
                   // Decode video frame
                   avcodec_decode_video2(pCodecCtx, pFrame, &amp;frameFinished,
                       &amp;packet);

                   // Did we get a video frame?
                   if(frameFinished)
                   {

                       static struct SwsContext *img_convert_ctx;

    #if 0
                       // Older removed code
                       // Convert the image from its native format to RGB swscale
                       img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,
                           (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width,
                           pCodecCtx->height);

                       // function template, for reference
                       int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
                           int srcSliceH, uint8_t* dst[], int dstStride[]);
    #endif
                       // Convert the image into YUV format that SDL uses
                       if(img_convert_ctx == NULL) {
                           int w = pCodecCtx->width;
                           int h = pCodecCtx->height;

                           img_convert_ctx = sws_getContext(w, h,
                               pCodecCtx->pix_fmt,
                               w, h, PIX_FMT_RGB24, SWS_BICUBIC,
                               NULL, NULL, NULL);
                           if(img_convert_ctx == NULL) {
                               fprintf(stderr, "Cannot initialize the conversion context!\n");
                               exit(1);
                           }
                       }
                       int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0,
                           pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
    #if 0
                       // this use to be true, as of 1/2009, but apparently it is no longer true in 3/2009
                       if(ret) {
                           fprintf(stderr, "SWS_Scale failed [%d]!\n", ret);
                           exit(-1);
                       }
    #endif

                       // Save the frame to disk
                       if(i++&lt;=1000)
                           SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);
                   }
               }

               // Free the packet that was allocated by av_read_frame
               av_free_packet(&amp;packet);
               //sleep(1);
           }

           // Free the RGB image
           //free(buffer);
           av_free(buffer);
           av_free(pFrameRGB);

           // Free the YUV frame
           av_free(pFrame);

           // Close the codec
           avcodec_close(pCodecCtx);

           // Close the video file
           av_close_input_file(pFormatCtx);

           return 0;
    }

    static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
    {
       FILE *pFile;
       char szFilename[32];
       int  y;

       // Open file
       sprintf(szFilename, "frame%d.ppm", iFrame);
       pFile=fopen(szFilename, "wb");
       if(pFile==NULL)
           return;

       // Write header
       fprintf(pFile, "P6\n%d %d\n255\n", width, height);

       // Write pixel data
       for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);

       // Close file
       fclose(pFile);
    }
  • How to enable audio of two ffplay windows simultaneously ?(How can I hear audio of the video files at the same time ?)

    9 octobre 2015, par Mitra M

    When more than one ffplay-window is running only the audio of one of them is enable , But I need to hear all of them at the same time.

    For example I run two command-lines separately like this :

    //command line 1
    ffplay -i video1.avi

    //command line 2
    ffplay -i video2.avi

    How can I hear audio of the video files at the same time ?

    I did not find anything about that in the ffplay documents, So I want to change the ffplay source code.

    this is event_loop function (in ffplay.c) :

    static void event_loop(VideoState *cur_stream)
    {
    SDL_Event event;
    double incr, pos, frac;

    for (;;) {
       double x;
       refresh_loop_wait_event(cur_stream, &amp;event);
       switch (event.type) {
       case SDL_KEYDOWN:
           if (exit_on_keydown) {
               do_exit(cur_stream);
               break;
           }
           switch (event.key.keysym.sym) {
           case SDLK_ESCAPE:
           case SDLK_q:
               do_exit(cur_stream);
               break;
           case SDLK_f:
               toggle_full_screen(cur_stream);
               cur_stream->force_refresh = 1;
               break;
           case SDLK_p:
           case SDLK_SPACE:
               toggle_pause(cur_stream);
               break;
           case SDLK_m:
               toggle_mute(cur_stream);
               break;
           case SDLK_KP_MULTIPLY:
           case SDLK_0:
               update_volume(cur_stream, 1, SDL_VOLUME_STEP);
               break;
           case SDLK_KP_DIVIDE:
           case SDLK_9:
               update_volume(cur_stream, -1, SDL_VOLUME_STEP);
               break;
           case SDLK_s: // S: Step to next frame
               step_to_next_frame(cur_stream);
               break;
           case SDLK_a:
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
               break;
           case SDLK_v:
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
               break;
           case SDLK_c:
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
               break;
           case SDLK_t:
               stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
               break;
           case SDLK_w:
       #if CONFIG_AVFILTER
               if (cur_stream->show_mode == SHOW_MODE_VIDEO &amp;&amp; cur_stream->vfilter_idx &lt; nb_vfilters - 1) {
                   if (++cur_stream->vfilter_idx >= nb_vfilters)
                       cur_stream->vfilter_idx = 0;
               } else {
                   cur_stream->vfilter_idx = 0;
                   toggle_audio_display(cur_stream);
               }
        #else
               toggle_audio_display(cur_stream);
        #endif
               break;
           case SDLK_PAGEUP:
               if (cur_stream->ic->nb_chapters &lt;= 1) {
                   incr = 600.0;
                   goto do_seek;
               }
               seek_chapter(cur_stream, 1);
               break;
           case SDLK_PAGEDOWN:
               if (cur_stream->ic->nb_chapters &lt;= 1) {
                   incr = -600.0;
                   goto do_seek;
               }
               seek_chapter(cur_stream, -1);
               break;
           case SDLK_LEFT:
               incr = -10.0;
               goto do_seek;
           case SDLK_RIGHT:
               incr = 10.0;
               goto do_seek;
           case SDLK_UP:
               incr = 60.0;
               goto do_seek;
           case SDLK_DOWN:
               incr = -60.0;
           do_seek:
                   if (seek_by_bytes) {
                       pos = -1;
                       if (pos &lt; 0 &amp;&amp; cur_stream->video_stream >= 0)
                           pos = frame_queue_last_pos(&amp;cur_stream->pictq);
                       if (pos &lt; 0 &amp;&amp; cur_stream->audio_stream >= 0)
                           pos = frame_queue_last_pos(&amp;cur_stream->sampq);
                       if (pos &lt; 0)
                           pos = avio_tell(cur_stream->ic->pb);
                       if (cur_stream->ic->bit_rate)
                           incr *= cur_stream->ic->bit_rate / 8.0;
                       else
                           incr *= 180000.0;
                       pos += incr;
                       stream_seek(cur_stream, pos, incr, 1);
                   } else {
                       pos = get_master_clock(cur_stream);
                       if (isnan(pos))
                           pos = (double)cur_stream->seek_pos / AV_TIME_BASE;
                       pos += incr;
                       if (cur_stream->ic->start_time != AV_NOPTS_VALUE &amp;&amp; pos &lt; cur_stream->ic->start_time / (double)AV_TIME_BASE)
                           pos = cur_stream->ic->start_time / (double)AV_TIME_BASE;
                       stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
                   }
               break;
           default:
               break;
           }
           break;
       case SDL_VIDEOEXPOSE:
           cur_stream->force_refresh = 1;
           break;
       case SDL_MOUSEBUTTONDOWN:
           if (exit_on_mousedown) {
               do_exit(cur_stream);
               break;
           }
       case SDL_MOUSEMOTION:
           if (cursor_hidden) {
               SDL_ShowCursor(1);
               cursor_hidden = 0;
           }
           cursor_last_shown = av_gettime_relative();
           if (event.type == SDL_MOUSEBUTTONDOWN) {
               x = event.button.x;
           } else {
               if (event.motion.state != SDL_PRESSED)
                   break;
               x = event.motion.x;
           }
               if (seek_by_bytes || cur_stream->ic->duration &lt;= 0) {
                   uint64_t size =  avio_size(cur_stream->ic->pb);
                   stream_seek(cur_stream, size*x/cur_stream->width, 0, 1);
               } else {
                   int64_t ts;
                   int ns, hh, mm, ss;
                   int tns, thh, tmm, tss;
                   tns  = cur_stream->ic->duration / 1000000LL;
                   thh  = tns / 3600;
                   tmm  = (tns % 3600) / 60;
                   tss  = (tns % 60);
                   frac = x / cur_stream->width;
                   ns   = frac * tns;
                   hh   = ns / 3600;
                   mm   = (ns % 3600) / 60;
                   ss   = (ns % 60);
                   av_log(NULL, AV_LOG_INFO,
                          "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d)       \n", frac*100,
                           hh, mm, ss, thh, tmm, tss);
                   ts = frac * cur_stream->ic->duration;
                   if (cur_stream->ic->start_time != AV_NOPTS_VALUE)
                       ts += cur_stream->ic->start_time;
                   stream_seek(cur_stream, ts, 0, 0);
               }
           break;
       case SDL_VIDEORESIZE:
               screen = SDL_SetVideoMode(FFMIN(16383, event.resize.w), event.resize.h, 0,
                                         SDL_HWSURFACE|(is_full_screen?SDL_FULLSCREEN:SDL_RESIZABLE)|SDL_ASYNCBLIT|SDL_HWACCEL);
               if (!screen) {
                   av_log(NULL, AV_LOG_FATAL, "Failed to set video mode\n");
                   do_exit(cur_stream);
               }
               screen_width  = cur_stream->width  = screen->w;
               screen_height = cur_stream->height = screen->h;
               cur_stream->force_refresh = 1;
           break;
       case SDL_QUIT:
       case FF_QUIT_EVENT:
           do_exit(cur_stream);
           break;
       case FF_ALLOC_EVENT:
           alloc_picture(event.user.data1);
           break;
       default:
           break;
       }
    }

    }

    But I can not find the command that cause disable audio when change active window or lost focus in event_loop function.

  • A *hot* Piwik Community Meetup 2015 !

    10 août 2015, par André Bräkling — Community

    Last weekend I arrived in Germany to attend the Piwik Community Meetup 2015 and now I am in Poland.

    The meetup was HOT in every sense ! Berlin temperatures reached 35 degrees (celsius), as I finally meet in person several long-time, dedicated Piwik community contributors.

    Meetup preparation in Berlin, photo by M. Zawadziński, licensed under CC-BY-SA 4.0

    Pictures from the meetup preparation sessions

    In the first leg of my trip I was in Berlin to meet Piwik community members to prepare for the 2015 annual Piwik community meetup. These are my notes taken during the meeting at the request of one of my colleagues. I also relayed live on Framasphère, Twitter and IRC.

    Community discussion at the meetup, photo by D.Czajka, licensed under CC-BY-SA 4.0

    More pictures from the Piwik meetup

    This was harder than I expected, as I took notes with my laptop, pictures with my phone, wrote live to social media (using the Android Diaspora Native Web App), and used my laptop to relay on IRC. Going forward this requires better preparation, I was glad I had a few links and pictures ready before hand but it really requires intense focus to achieve this. I am glad presenters were patient when I requested repeating some of the ideas they shared. I am also a bit disappointed not much happened in IRC.

    Two day preparation sessions

    The discussions and session we had during the two days prior to the meetup are available here.

    We gathered in rented apartments in Berlin, this reminded me very much of similar community gatherings and perhaps of BarCamp and, at a much smaller scale, UDS sessions.

    Piwik Pizza !, photo by F. Rodríguez, licensed under CC-BY-SA 4.0

    A list of ideas of topics was initially submitted, we then proceeded to have scheduled sessions for open discussion. Several people shared their concern there was no possible remote participation which led to making public the Trello boards used/linked here.

    Note : The Trello links below still have action items and notes that are pending bug report / feature requests filing which should happen over the coming weeks. Most importantly, many action items will need identifying leads for different community team including Translations and Documentation, and better coordination of coming community engagement.

    Monday sessions consisted of the following subjects :

    On Tuesday we met again to discuss the following subjects :

    Some more details about individual preparation sessions

    What are Piwik values & how to communicate them ?

    The main subjects in this session were important changes proposed in the project mission and values. This was edited directly on on the wiki page on GitHub, some of the changes can be seen by comparing revisions.

    Piwik mission statement (bug #7376)

    “To create the leading Free and open source analytics platform, and to support global organisations and communities to keep full control over their data.”

    Our values

    • Openness
    • Freedom
    • Transparency
    • Data ownership
    • Privacy
    • Kaizen (改善) : continuous improvement

    This was also presented by Matthieu Aubry at the meetup and is published in the Roadmap page. Bringing more visibility and perhaps having a top page for Mission and Values was also brought up.

    Meetup agenda and notes

    The official agenda is available here.

    Many Piwik PRO employees stayed in Berlin for the meetup, and we had good participation although less than last year in Munich as my colleagues told me. Some were consultants, others staff from public organizations, universities, etc. In retrospect considering the very hot weather and summer holidays the attendance was good. I was very happy to arrive at the beautiful Kulturbrauerei and enter the air-conditioned Soda Club. T-Shirts were waiting for all attendees and free drinks (non-alcohol !) were welcome