Recherche avancée

Médias (0)

Mot : - Tags -/gis

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (95)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (9856)

  • Data Privacy Day 2020

    27 janvier 2020, par Matthieu Aubry — Privacy

    It’s January 28th which means it’s Data Privacy Day !

    Today is an important day for the Matomo team as we reflect on our mission and our goals for 2020. This year I wanted to send a video message to all Matomo users, community members and customers. 

    Check it out (full transcript below)

    A video message from Matomo founder, Matthieu Aubry

    Privacy-friendly alternatives

    Video transcript

    Hey everyone,

    Matthieu here, Founder of Matomo.

    Today is one of the most significant days of the year for the Matomo team – it’s Data Privacy Day. And so I wanted to quickly reflect on our mission and the significance of this day. 

    In today’s busy online world where data is king, this day is an important reminder of being vigilant in protecting our personal information online.

    Matomo began 12 years ago as an open-source alternative to Google Analytics – the goal was, and still is to give full control of data back to users. 

    In 2020, we are determined to see through this commitment. We will keep building a powerful and ethical web analytics platform that focuses on privacy protection, data ownership, and provides value to all Matomo users and customers.

    And what’s fantastic is to see the rise of other quality software companies offering privacy-friendly alternatives for web browsers, search engines, file sharing, email providers, all with a similar mission. And with these products now widely available, we encourage you to take back control of all your online activities and begin this new decade with a resolution to stay safe online.

    I’ll provide you with some links below the video to check out these privacy-friendly alternatives. If you have a website and want to gain valuable insights on the visitors while owning your data, join us ! 

    Matomo Analytics On-Premise is and always will be free to download and install on your own servers and on your own terms.

    Also feel free to join our active community or spread the word to your friends and network about the importance of data privacy.

    Thank you all and wishing you a great 2020 !

    For more information on how Matomo protects the privacy of your users, visit : https://matomo.org/privacy/

    Do you have privacy concerns ?

    What better day than today to speak up ! What privacy concerns have you experienced ?

  • Merge multi channel audio buffers into one CMSampleBuffer

    26 avril 2020, par Darkwonder

    I am using FFmpeg to access an RTSP stream in my macOS app.

    



    REACHED GOALS : I have created a tone generator which creates single channel audio and returns a CMSampleBuffer. The tone generator is used to test my audio pipeline when the video's fps and audio sample rates are changed.

    



    GOAL : The goal is to merge multi-channel audio buffers into a single CMSampleBuffer.

    



    Audio data lifecyle :

    



    AVCodecContext* audioContext = self.rtspStreamProvider.audioCodecContext;&#xA;        if (!audioContext) { return; }&#xA;&#xA;        // Getting audio settings from FFmpegs audio context (AVCodecContext).&#xA;        int samplesPerChannel = audioContext->frame_size;&#xA;        int frameNumber = audioContext->frame_number;&#xA;        int sampleRate = audioContext->sample_rate;&#xA;        int fps = [self.rtspStreamProvider fps];&#xA;&#xA;        int calculatedSampleRate = sampleRate / fps;&#xA;&#xA;        // NSLog(@"\nSamples per channel = %i, frames = %i.\nSample rate = %i, fps = %i.\ncalculatedSampleRate = %i.", samplesPerChannel, frameNumber, sampleRate, fps, calculatedSampleRate);&#xA;&#xA;        // Decoding the audio data from a encoded AVPacket into a AVFrame.&#xA;        AVFrame* audioFrame = [self.rtspStreamProvider readDecodedAudioFrame];&#xA;        if (!audioFrame) { return; }&#xA;&#xA;        // Extracting my audio buffers from FFmpegs AVFrame.&#xA;        uint8_t* leftChannelAudioBufRef = audioFrame->data[0];&#xA;        uint8_t* rightChannelAudioBufRef = audioFrame->data[1];&#xA;&#xA;        // Creating the CMSampleBuffer with audio data.&#xA;        CMSampleBufferRef leftSampleBuffer = [CMSampleBufferFactory createAudioSampleBufferUsingData:leftChannelAudioBufRef channelCount:1 framesCount:samplesPerChannel sampleRate:sampleRate];&#xA;//      CMSampleBufferRef rightSampleBuffer = [CMSampleBufferFactory createAudioSampleBufferUsingData:packet->data[1] channelCount:1 framesCount:samplesPerChannel sampleRate:sampleRate];&#xA;&#xA;        if (!leftSampleBuffer) { return; }&#xA;        if (!self.audioQueue) { return; }&#xA;        if (!self.audioDelegates) { return; }&#xA;&#xA;        // All audio consumers will receive audio samples via delegation. &#xA;        dispatch_sync(self.audioQueue, ^{&#xA;            NSHashTable *audioDelegates = self.audioDelegates;&#xA;            for (id<audiodataproviderdelegate> audioDelegate in audioDelegates)&#xA;            {&#xA;                [audioDelegate provider:self didOutputAudioSampleBuffer:leftSampleBuffer];&#xA;                // [audioDelegate provider:self didOutputAudioSampleBuffer:rightSampleBuffer];&#xA;            }&#xA;        });&#xA;</audiodataproviderdelegate>

    &#xA;&#xA;

    CMSampleBuffer containing audio data creation :

    &#xA;&#xA;

    import Foundation&#xA;import CoreMedia&#xA;&#xA;@objc class CMSampleBufferFactory: NSObject&#xA;{&#xA;&#xA;    @objc static func createAudioSampleBufferUsing(data: UnsafeMutablePointer<uint8> ,&#xA;                                             channelCount: UInt32,&#xA;                                             framesCount: CMItemCount,&#xA;                                             sampleRate: Double) -> CMSampleBuffer? {&#xA;&#xA;        /* Prepare for sample Buffer creation */&#xA;        var sampleBuffer: CMSampleBuffer! = nil&#xA;        var osStatus: OSStatus = -1&#xA;        var audioFormatDescription: CMFormatDescription! = nil&#xA;&#xA;        var absd: AudioStreamBasicDescription! = nil&#xA;        let sampleDuration = CMTimeMake(value: 1, timescale: Int32(sampleRate))&#xA;        let presentationTimeStamp = CMTimeMake(value: 0, timescale: Int32(sampleRate))&#xA;&#xA;        // NOTE: Change bytesPerFrame if you change the block buffer value types. Currently we are using double.&#xA;        let bytesPerFrame: UInt32 = UInt32(MemoryLayout<float32>.size) * channelCount&#xA;        let memoryBlockByteLength = framesCount * Int(bytesPerFrame)&#xA;&#xA;//      var acl = AudioChannelLayout()&#xA;//      acl.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo&#xA;&#xA;        /* Sample Buffer Block buffer creation */&#xA;        var blockBuffer: CMBlockBuffer?&#xA;&#xA;        osStatus = CMBlockBufferCreateWithMemoryBlock(&#xA;            allocator: kCFAllocatorDefault,&#xA;            memoryBlock: nil,&#xA;            blockLength: memoryBlockByteLength,&#xA;            blockAllocator: nil,&#xA;            customBlockSource: nil,&#xA;            offsetToData: 0,&#xA;            dataLength: memoryBlockByteLength,&#xA;            flags: 0,&#xA;            blockBufferOut: &amp;blockBuffer&#xA;        )&#xA;&#xA;        assert(osStatus == kCMBlockBufferNoErr)&#xA;&#xA;        guard let eBlock = blockBuffer else { return nil }&#xA;&#xA;        osStatus = CMBlockBufferFillDataBytes(with: 0, blockBuffer: eBlock, offsetIntoDestination: 0, dataLength: memoryBlockByteLength)&#xA;        assert(osStatus == kCMBlockBufferNoErr)&#xA;&#xA;        TVBlockBufferHelper.fillAudioBlockBuffer(blockBuffer,&#xA;                                                 audioData: data,&#xA;                                                 frames: Int32(framesCount))&#xA;        /* Audio description creations */&#xA;&#xA;        absd = AudioStreamBasicDescription(&#xA;            mSampleRate: sampleRate,&#xA;            mFormatID: kAudioFormatLinearPCM,&#xA;            mFormatFlags: kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsFloat,&#xA;            mBytesPerPacket: bytesPerFrame,&#xA;            mFramesPerPacket: 1,&#xA;            mBytesPerFrame: bytesPerFrame,&#xA;            mChannelsPerFrame: channelCount,&#xA;            mBitsPerChannel: 32,&#xA;            mReserved: 0&#xA;        )&#xA;&#xA;        guard absd != nil else {&#xA;            print("\nCreating AudioStreamBasicDescription Failed.")&#xA;            return nil&#xA;        }&#xA;&#xA;        osStatus = CMAudioFormatDescriptionCreate(allocator: kCFAllocatorDefault,&#xA;                                                  asbd: &amp;absd,&#xA;                                                  layoutSize: 0,&#xA;                                                  layout: nil,&#xA;//                                                layoutSize: MemoryLayout<audiochannellayout>.size,&#xA;//                                                layout: &amp;acl,&#xA;                                                  magicCookieSize: 0,&#xA;                                                  magicCookie: nil,&#xA;                                                  extensions: nil,&#xA;                                                  formatDescriptionOut: &amp;audioFormatDescription)&#xA;&#xA;        guard osStatus == noErr else {&#xA;            print("\nCreating CMFormatDescription Failed.")&#xA;            return nil&#xA;        }&#xA;&#xA;        /* Create sample Buffer */&#xA;        var timmingInfo = CMSampleTimingInfo(duration: sampleDuration, presentationTimeStamp: presentationTimeStamp, decodeTimeStamp: .invalid)&#xA;&#xA;        osStatus = CMSampleBufferCreate(allocator: kCFAllocatorDefault,&#xA;                                        dataBuffer: eBlock,&#xA;                                        dataReady: true,&#xA;                                        makeDataReadyCallback: nil,&#xA;                                        refcon: nil,&#xA;                                        formatDescription: audioFormatDescription,&#xA;                                        sampleCount: framesCount,&#xA;                                        sampleTimingEntryCount: 1,&#xA;                                        sampleTimingArray: &amp;timmingInfo,&#xA;                                        sampleSizeEntryCount: 0, // Must be 0, 1, or numSamples.&#xA;            sampleSizeArray: nil, // Pointer ot Int. Don&#x27;t know the size. Don&#x27;t know if its bytes or bits?&#xA;            sampleBufferOut: &amp;sampleBuffer)&#xA;        return sampleBuffer&#xA;    }&#xA;&#xA;}&#xA;</audiochannellayout></float32></uint8>

    &#xA;&#xA;

    CMSampleBuffer gets filled with raw audio data from FFmpeg's data :

    &#xA;&#xA;

    @import Foundation;&#xA;@import CoreMedia;&#xA;&#xA;@interface BlockBufferHelper : NSObject&#xA;&#xA;&#x2B;(void)fillAudioBlockBuffer:(CMBlockBufferRef)blockBuffer&#xA;                  audioData:(uint8_t *)data&#xA;                     frames:(int)framesCount;&#xA;&#xA;&#xA;&#xA;@end&#xA;&#xA;#import "TVBlockBufferHelper.h"&#xA;&#xA;@implementation BlockBufferHelper&#xA;&#xA;&#x2B;(void)fillAudioBlockBuffer:(CMBlockBufferRef)blockBuffer&#xA;                  audioData:(uint8_t *)data&#xA;                     frames:(int)framesCount&#xA;{&#xA;    // Possibly dev error.&#xA;    if (framesCount == 0) {&#xA;        NSAssert(false, @"\nfillAudioBlockBuffer/audioData/frames will not be able to fill an blockBuffer which has no frames.");&#xA;        return;&#xA;    }&#xA;&#xA;    char *rawBuffer = NULL;&#xA;&#xA;    size_t size = 0;&#xA;&#xA;    OSStatus status = CMBlockBufferGetDataPointer(blockBuffer, 0, &amp;size, NULL, &amp;rawBuffer);&#xA;    if(status != noErr)&#xA;    {&#xA;        return;&#xA;    }&#xA;&#xA;    memcpy(rawBuffer, data, framesCount);&#xA;}&#xA;&#xA;@end&#xA;

    &#xA;&#xA;

    The LEARNING Core Audio book from Chris Adamson/Kevin Avila points me toward a multi channel mixer. &#xA;The multi channel mixer should have 2-n inputs and 1 output. I assume the output could be a buffer or something that could be put into a CMSampleBuffer for further consumption.

    &#xA;&#xA;

    This direction should lead me to AudioUnits, AUGraph and the AudioToolbox. I don't understand all of these classes and how they work together. I have found some code snippets on SO which could help me but most of them use AudioToolBox classes and don't use CMSampleBuffers as much as I need.

    &#xA;&#xA;

    Is there another way to merge audio buffers into a new one ?

    &#xA;&#xA;

    Is creating a multi channel mixer using AudioToolBox the right direction ?

    &#xA;

  • ffmpeg : Combine/merge multiple mp4 videos - not working

    9 juin 2016, par dtbaker

    Here is the command I am using to combine multiple videos :

    ffmpeg -i 75_540_38HQ2.mp4 -i 76_70_20.mp4 -i 76_173_80.mp4 -i 81_186_35.mp4 -vcodec copy -acodec copy Mux1.mp4

    The resulting Mux1.mp4 does not contain all videos. Only the first video (75_540_38HQ2.mp4). The file size of the source and resulting video is below (as you can see, resulting video is slightly larger than first vid) :

    $ ls -lh
    
    - rw-r—r— 1 dbaker dbaker 42M 2011-03-24 11:59 75_540_38HQ2.mp4
    - rw-r—r— 1 dbaker dbaker 236M 2011-03-24 12:09 76_173_80.mp4
    - rw-r—r— 1 dbaker dbaker 26M 2011-03-24 12:05 76_70_20.mp4
    - rw-r—r— 1 dbaker dbaker 54M 2011-03-24 12:15 81_186_35.mp4
    - rw-r—r— 1 dbaker dbaker 44M 2011-03-24 14:48 Mux1.mp4

    Here is the output of the ffmpeg command. To me it looks ok, showing the multiple source inputs and the single output.

    FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
      built on Mar 21 2011 18:05:32 with gcc 4.4.5
      configuration : —enable-gpl —enable-version3 —enable-nonfree —enable-postproc —enable-libfaac —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libxvid —enable-x11grab
      libavutil     50.36. 0 / 50.36. 0
      libavcore      0.16. 1 /  0.16. 1
      libavcodec    52.108. 0 / 52.108. 0
      libavformat   52.93. 0 / 52.93. 0
      libavdevice   52. 2. 3 / 52. 2. 3
      libavfilter    1.74. 0 /  1.74. 0
      libswscale     0.12. 0 /  0.12. 0
      libpostproc   51. 2. 0 / 51. 2. 0
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ’75_540_38HQ2.mp4’ :
      Metadata :
        major_brand : isom
        minor_version : 512
        compatible_brands : isomiso2avc1mp41
        creation_time : 1970-01-01 00:00:00
        encoder : Lavf52.93.0
      Duration : 00:00:29.99, start : 0.000000, bitrate : 11517 kb/s
        Stream #0.0(eng) : Video : h264, yuv420p, 1280x960 [PAR 1:1 DAR 4:3], 11575 kb/s, 29.94 fps, 29.97 tbr, 30k tbn, 59.94 tbc
        Metadata :
          creation_time : 1970-01-01 00:00:00
        Stream #0.1(eng) : Audio : aac, 48000 Hz, stereo, s16, 127 kb/s
        Metadata :
          creation_time : 1970-01-01 00:00:00
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from ’76_70_20.mp4’ :
      Metadata :
        major_brand : isom
        minor_version : 512
        compatible_brands : isomiso2avc1mp41
        creation_time : 1970-01-01 00:00:00
        encoder : Lavf52.93.0
      Duration : 00:00:19.98, start : 0.000000, bitrate : 10901 kb/s
        Stream #1.0(eng) : Video : h264, yuv420p, 1280x960 [PAR 1:1 DAR 4:3], 10804 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
        Metadata :
          creation_time : 1970-01-01 00:00:00
        Stream #1.1(eng) : Audio : aac, 48000 Hz, stereo, s16, 128 kb/s
        Metadata :
          creation_time : 1970-01-01 00:00:00
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from ’76_173_80.mp4’ :
      Metadata :
        major_brand : isom
        minor_version : 512
        compatible_brands : isomiso2avc1mp41
        creation_time : 1970-01-01 00:00:00
        encoder : Lavf52.93.0
      Duration : 00:03:09.99, start : 0.000000, bitrate : 10393 kb/s
        Stream #2.0(eng) : Video : h264, yuv420p, 1280x960 [PAR 1:1 DAR 4:3], 10321 kb/s, 29.96 fps, 29.97 tbr, 30k tbn, 59.94 tbc
        Metadata :
          creation_time : 1970-01-01 00:00:00
        Stream #2.1(eng) : Audio : aac, 48000 Hz, stereo, s16, 128 kb/s
        Metadata :
          creation_time : 1970-01-01 00:00:00
    

    Seems stream 0 codec frame rate differs from container frame rate : 119.88 (120000/1001) -> 30000.00 (30000/1)
    Input #3, mov,mp4,m4a,3gp,3g2,mj2, from ’81_186_35.mp4’ :
    Metadata :
    major_brand : isom
    minor_version : 512
    compatible_brands : isomiso2avc1mp41
    creation_time : 1970-01-01 00:00:00
    encoder : Lavf52.93.0
    Duration : 00:00:35.00, start : 0.000000, bitrate : 12700 kb/s
    Stream #3.0(eng) : Video : h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 12620 kb/s, 59.91 fps, 30k tbr, 60k tbn, 119.88 tbc
    Metadata :
    creation_time : 1970-01-01 00:00:00
    Stream #3.1(eng) : Audio : aac, 48000 Hz, stereo, s16, 128 kb/s
    Metadata :
    creation_time : 1970-01-01 00:00:00
    Output #0, mp4, to ’Mux1.mp4’ :
    Metadata :
    major_brand : isom
    minor_version : 512
    compatible_brands : isomiso2avc1mp41
    creation_time : 1970-01-01 00:00:00
    encoder : Lavf52.93.0
    Stream #0.0(eng) : Video : libx264, yuv420p, 1280x960 [PAR 1:1 DAR 4:3], q=2-31, 11575 kb/s, 30k tbn, 29.97 tbc
    Metadata :
    creation_time : 1970-01-01 00:00:00
    Stream #0.1(eng) : Audio : libfaac, 48000 Hz, stereo, 128 kb/s
    Metadata :
    creation_time : 1970-01-01 00:00:00
    Stream mapping :
    Stream #0.0 -> #0.0
    Stream #2.1 -> #0.1
    Press [q] to stop encoding
    frame= 883 fps=632 q=-1.0 Lsize= 44730kB time=29.40 bitrate=12465.1kbits/s
    video:41678kB audio:2969kB global headers:0kB muxing overhead 0.184548%

    Am I doing something blindingly stupid here ?

    The source videos came from a video camera, and are small snippets taken with ffmpeg -i bigfile.mp4 -ss 20 -t 10 -vcodec copy etc..

    Thanks heaps !!
    Dave


    Edit : couldn’t solve it so I just use avidemux GUI tool. It seemed to append the MP4’s just fine.

    Must be a problem with MP4’s or just the ones that come off a gopro camera.