Recherche avancée

Médias (91)

Autres articles (103)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • La gestion des forums

    3 novembre 2011, par

    Si les forums sont activés sur le site, les administrateurs ont la possibilité de les gérer depuis l’interface d’administration ou depuis l’article même dans le bloc de modification de l’article qui se trouve dans la navigation de la page.
    Accès à l’interface de modération des messages
    Lorsqu’il est identifié sur le site, l’administrateur peut procéder de deux manières pour gérer les forums.
    S’il souhaite modifier (modérer, déclarer comme SPAM un message) les forums d’un article particulier, il a à sa (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8189)

  • checkasm : af_afir : Use a dynamic tolerance depending on values

    11 décembre 2019, par Martin Storsjö
    checkasm : af_afir : Use a dynamic tolerance depending on values
    

    As the values generated by av_bmg_get can be arbitrarily large
    (only the stddev is specified), we can't use a fixed tolerance.
    Calculate a dynamic tolerance (like in float_dsp from 38f966b2222db),
    based on the individual steps of the calculation.

    This fixes running this test with certain seeds, when built with
    clang for mingw/x86_32.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] tests/checkasm/af_afir.c
  • How to fill audio AVFrame (ffmpeg) with the data obtained from CMSampleBufferRef (AVFoundation) ?

    24 mai 2013, par Aleksei2414904

    I am writing program for streaming live audio and video from webcamera to rtmp-server. I work in MacOS X 10.8, so I use AVFoundation framework for obtaining audio and video frames from input devices. This frames come into delegate :

    -(void) captureOutput:(AVCaptureOutput*)captureOutput didOutputSampleBuffer:    (CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection ,

    where sampleBuffer contains audio or video data.

    When I recieve audio data in the sampleBuffer, I'm trying to convert this data into AVFrame and encode AVFramewith libavcodec :

       aframe = avcodec_alloc_frame();  //AVFrame *aframe;
       int got_packet, ret;
       CMItemCount numSamples = CMSampleBufferGetNumSamples(sampleBuffer); //CMSampleBufferRef

       NSUInteger channelIndex = 0;

       CMBlockBufferRef audioBlockBuffer = CMSampleBufferGetDataBuffer(sampleBuffer);

       size_t audioBlockBufferOffset = (channelIndex * numSamples * sizeof(SInt16));

       size_t lengthAtOffset = 0;

       size_t totalLength = 0;

       SInt16 *samples = NULL;

       CMBlockBufferGetDataPointer(audioBlockBuffer, audioBlockBufferOffset, &amp;lengthAtOffset, &amp;totalLength, (char **)(&amp;samples));

               const AudioStreamBasicDescription *audioDescription = CMAudioFormatDescriptionGetStreamBasicDescription(CMSampleBufferGetFormatDescription(sampleBuffer));

       aframe->nb_samples =(int) numSamples;

       aframe->channels=audioDescription->mChannelsPerFrame;

       aframe->sample_rate=(int)audioDescription->mSampleRate;

        //my webCamera configured to produce 16bit 16kHz LPCM mono, so sample format hardcoded here, and seems to be correct
       avcodec_fill_audio_frame(aframe, aframe->channels, AV_SAMPLE_FMT_S16,

                                (uint8_t *)samples,

                                 aframe->nb_samples *

                                av_get_bytes_per_sample(AV_SAMPLE_FMT_S16) *

                                aframe->channels, 0);  
       //encoding audio
       ret = avcodec_encode_audio2(c, &amp;pkt, aframe, &amp;got_packet);
       if (ret &lt; 0) {
           fprintf(stderr, "Error encoding audio frame: %s\n", av_err2str(ret));
           exit(1);
       }

    The problem is that when I get so formed frames, I can hear the wanted sound, but it is slowing down and discontinuous (as if after each data frame comes the same frame of silence). It seems that something is wrong in the transformation from CMSampleBuffer to AVFrame , because the preview from the microphone created with AVFoundation from the same sample buffers played normally.

    I would be grateful for your help.

    UPD : Creating and initializing the AVCodceContext structure
     

       audio_codec= avcodec_find_encoder(AV_CODEC_ID_AAC);
       if (!(audio_codec)) {
           fprintf(stderr, "Could not find encoder for &#39;%s&#39;\n",
                   avcodec_get_name(AV_CODEC_ID_AAC));
           exit(1);
       }
       audio_st = avformat_new_stream(oc, audio_codec);  //AVFormatContext *oc;
       if (!audio_st) {
           fprintf(stderr, "Could not allocate stream\n");
           exit(1);
       }

         audio_st->id=1;
         audio_st->codec->sample_fmt= AV_SAMPLE_FMT_S16;
         audio_st->codec->bit_rate = 64000;
         audio_st->codec->sample_rate= 16000;
         audio_st->codec->channels=1;
         audio_st->codec->codec_type= AVMEDIA_TYPE_AUDIO;
  • avformat/movenc : use enum values directly for colr atom

    31 mars 2020, par Michael Bradshaw
    avformat/movenc : use enum values directly for colr atom
    

    The switch cases were missing :

    - Primaries : bt470m, film, smpte428, and ebu3213.
    - TRCs : gamma22, gamma28, linear, log, log_sqrt, iec61966_2_4, bt1361,
    iec61966_2_1, bt2020_10bit, and bt2020_12bit.
    - Space : rgb, fcc, ycgco, bt2020_cl, smpte2085, chroma-derived-nc,
    chroma-derived-c, and ictcp.

    They also annoyingly remapped the following (which are functionally
    equivalent but can be treated differently by clients) :

    - smpte240m primaries to smpte170m.
    - smpte170m TRC to bt709.
    - bt470bg color space to smpte170m.

    The enum values in FFmpeg are the same values as ITU-T H.273 and
    ISO/IEC 23001-8 so we can just use them directly, which is both simpler
    and preserves the user intent.

    Signed-off-by : Michael Bradshaw <mjbshaw@google.com>

    • [DH] libavformat/movenc.c