Recherche avancée

Médias (3)

Mot : - Tags -/plugin

Autres articles (90)

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (11324)

  • How to read audio from numpy array with ffmpeg

    26 décembre 2018, par Phạm Văn Tuân

    I’m trying to read an audio from numpy array by using ffmpeg in Python. I just find only way to do that :

    os.system("ffmpeg -i  " + input + " -ac 1 -ar 16000 " + output)

    How to read audio directly from numpy array and return a numpy array ?

  • How to concatenate two AAC files smoothly ?

    15 août 2013, par James Deng

    To save time, I want to segment and transcode a large video file on multiple computers.

    I use ffmpeg to transcode the segments of the large video file with :

    ffmpeg -i large_movie.mp4 -ss 00:00:00 -t 00:01:00 -acodec libfaac seg0.flv
    ffmpeg -i large_movie.mp4 -ss 00:01:00 -t 00:01:00 -acodec libfaac seg1.flv
    ...

    And concatenate the segments with :

    ffmpeg -i concat.conf -vcodec copy -acodec copy result.flv

    The content of the concat.conf :

    ffsconcat version 1.0
    file seg0.flv
    file seg1.flv
    ...

    Now we get a result FLV file result.flv content all the segments. But when I play this file, I found the segment boundary audio may be momentarily interrupted ! I'm sure those segments is closely associated, and the timestamp is right.

    When I decode the AAC sample in segment file to a wave format, and open the wave with CoolEdit, I found at the front and the end of the file, the value of audio sample is very small (mute ?) ! At the front of the file, there is about 21ms 'mute' sample. And at the end of the file, there is about 3ms 'mute' sample.

    Is the mute samples result the momentarily interrupt ? How to concatenate media file containing AAC smoothly ?


    After further testing, I found if you split a wave file to small wave files, then encode this small wave files to small aac file use faac :

    faac -P -R 48000 -B 16 -C 2 -X -o 1.aac 1.wav
    faac -P -R 48000 -B 16 -C 2 -X -o 2.aac 2.wav
    faac -P -R 48000 -B 16 -C 2 -X -o 3.aac 3.wav
    faac -P -R 48000 -B 16 -C 2 -X -o 4.aac 4.wav
    faac -P -R 48000 -B 16 -C 2 -X -o 5.aac 5.wav

    The console output like this :

    [hugeice@fedora19 trans]$ faac -P -R 48000 -B 16 -C 2 -X -o 5.aac 5.wav
    Freeware Advanced Audio Coder
    FAAC 1.28

    Quantization quality: 100
    Bandwidth: 16000 Hz
    Object type: Low Complexity(MPEG-2) + M/S
    Container format: Transport Stream (ADTS)
    Encoding 5.wav to 5.aac
      frame          | bitrate | elapsed/estim | play/CPU | ETA

    And concatenate this small aac files to a big aac files use :

    cat 1.aac 2.aac 3.aac 4.aac 5.aac > big.aac

    Now, if you play the big.aac, there is a momeniary interrupt at the segment boundary !

    The question becomes how segment coding and concatenate aac files smoothly ?

  • 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, &lengthAtOffset, &totalLength, (char **)(&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, &pkt, aframe, &got_packet);
       if (ret < 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 '%s'\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;