Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (74)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

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

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

  • Choppy sound when using ffmpeg

    24 novembre 2011, par Kurt

    I suffered some choppy audio when i try to capture audio from a live stream.
    Another essential problem which could explain the problem is that the Wav file created is twice longer than the capture time.

    The audio is perfect when i play the avs input file with ffplay, so the avs is ok, the problem is after whether in the capture or in the Wav writing.

    To capture :

    av_read_frame(pFormatCtx, &packet)

    if(packet.stream_index == mAudioStream)
    {
       int buff_size = sizeof(mAudioBuffer);
       std::cout << "Buff_size " << buff_size << std::endl;
       len = avcodec_decode_audio3(pAudioCodecCtx,(int16_t*)mAudioBuffer, &buff_size,&packet);
       if(len < 0){
           qDebug("Extractor - Audio isEnd = -1;");
           mAudioBufferSize = 0;
           isEnd = ERROR_;
           return isEnd;
       }

       // Set packet result type
       mFrameType = AUDIO_PKT;
       mAudioBufferSize = buff_size;
       //store audio synchronization informations:
       if(packet.pts != AV_NOPTS_VALUE) {
            mAudioPts_ = av_q2d(pFormatCtx->streams[mAudioStream]->time_base);
            mAudioPts_ *= packet.pts;
       }
    }

           // store a copy of current audio frame in _frame
           _frame.audioFrame = new decoded_frame_t::audio_frame_t();
           _frame.audioFrame->sampleRate = mediaInfos.audioSampleRate;
           _frame.audioFrame->sampleSize = mediaInfos.audioSampleSize;
           _frame.audioFrame->nbChannels = mediaInfos.audioNbChannels;
           _frame.audioFrame->nbSamples = mAudioBufferSize / ((mediaInfos.audioSampleSize/8) * mediaInfos.audioNbChannels);
           _frame.audioFrame->buf.resize(mAudioBufferSize);
           memcpy(&_frame.audioFrame->buf[0],mAudioBuffer,mAudioBufferSize);

    Then i store in a Wav File using libsndfile :

    SNDFILE*            fd;
    SF_INFO             sfInf;

    sfInf.frames = 0;
    sfInf.channels = p_capt->ui_nbChannels;
    sfInf.samplerate = p_capt->ui_sampleRate;
    sfInf.format = SF_FORMAT_WAV | SF_FORMAT_PCM_U8;
    sfInf.sections = 0;
    sfInf.seekable = 0;

    if (sf_format_check(&sfInf) == FALSE)
       std::cout << "Format parameter are uncorrect ! Exit saving !" << std::endl;
    else
    {
       fd = sf_open(fileName.toStdString().c_str(), SFM_WRITE, &sfInf);
       if (fd == NULL)
       {
           std::cout << "Unable to open the file " << fileName.toStdString() << std::endl;
           return GRAB_ST_NOK;
       }

       //little trick because v_buf is a uint8_t vector
       sf_count_t l = sf_write_short(fd, (const short *)(&(p_capt->v_buf[0])), p_capt->v_buf.size()/2);

       if (l != p_capt->v_buf.size()/2)
       {
          std::cout << "sf_write didn't write the right amoung of bits " << l << " != " << p_capt->v_buf.size()/2 << std::endl;
          ret = GRAB_ST_NOK;
       }
       else
       {
           sf_write_sync(fd);
           sf_close(fd);
           ret = GRAB_ST_OK;
       }
    }

    I hope it's understandable. Waiting for remarks.

    Kurt

  • How to capture camera devices on Windows using Libav ?

    22 septembre 2011, par Occulta

    Is there any way to capture frames from as many camera types as DirectShow do on Windows platform using Libav ? I need to capture a camera output without using DirectShow filters and I want my application to work with many camera devices types.

    I have searched the Internet about this capability of libav and found that it can be done via libav using special input format "vfwcap". Something like that (don't sure about code correctness - I wrote it by myself) :

    AVFormatParameters formatParams = NULL;
    AVInputFormat* pInfmt = NULL;
    pInFormatCtx*  pInFormatCtx = NULL;

    av_register_all();

    //formatParams.device = NULL; //this was probably deprecated and then removed
    formatParams.channel = 0;
    formatParams.standard = "ntsc"; //deprecated too but still available
    formatParams.width = 640;
    formatParams.height = 480;
    formatParams.time_base.num = 1000;
    formatParams.time_base.den = 30000; //so we want 30000/1000 = 30 frames per second
    formatParams.prealloced_context = 0;


    pInfmt = av_find_input_format("vfwcap");
    if( !pInfmt )
    {
     fprintf(stderr,"Unknown input format\n");
     return -1;
    }

    // Open video file (formatParams can be NULL for autodetecting probably)
    if (av_open_input_file(&pInFormatCtx, 0, pInfmt, 0, formatParams) < 0)
      return -1; // Couldn't open device

    /* Same as video4linux code*/

    So another question is : how many devices are supported by Libav ? All I have found about capture cameras output with libav on windows is advice to use DirectShow for this purpose because libav supports too few devices. Maybe situation has already changed now and it does support enough devices to use it in production applications ?

    If this isn't possible.. Well I hope my question won't be useless and this composed from different sources piece of code will help someone interested in this theme 'coz there are really too few information about it in the whole internet.

  • Recording a mp3 stream with FFMPEG and drop-outs

    14 mars 2013, par Rob Oliver

    I hope someone can give me pointer, I have a php script that runs the command below to record an live radio mp3 stream to create hour long mp3 recordings. It works very well for my purpose. The only issue is occasionally no recording is made. As far as I can tell its because the stream has dropped out and ffmpeg just aborts.

    /usr/local/bin/ffmpeg -i http://www.mystream.com:8000/radiostream.mp3 -t 60:00 -acodec copy /var/www/mydomain/audio/".$recorded_audio_title;

    So my question, is there anyway to tell ffmpeg to continuously record for the 60:00 minutes to make a recording even if their are drop outs ? I'd be happy with a odd bit of silence providing it completed the recording.

    I hope this makes sense and I'd appreciate even a pointer to a FFMPEG option or flag. Having Google'd I havnt seen anything that would fit the bill.

    Many thanks in advance

    rob