Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (21)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

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

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (3372)

  • Wrap audio data of the pcm_alaw type into an MKA audio file using the ffmpeg API

    19 septembre 2020, par bbdd

    Imagine that in my project, I receive RTP packets with the payload type-8, for later saving this load as the Nth part of the audio track. I extract this load from the RTP packet and save it to a temporary buffer :

    


    ...

while ((rtp = receiveRtpPackets()).withoutErrors()) {
   payloadData.push(rtp.getPayloadData());
}

audioGenerator.setPayloadData(payloadData);
audioGenerator.recordToFile();

...


    


    After filling a temporary buffer of a certain size with this payload, I process this buffer, namely, extract the entire payload and encode it using ffmpeg for further saving to an audio file in Matroska format. But I have a problem. Since the payload of the RTP packet is type 8, I have to save the raw audio data of the pcm_alaw format to mka audio format. But when saving raw data pcm_alaw to an audio file, I get these messages from the library :

    


    ...

[libopus @ 0x18eff60] Queue input is backward in time
[libopus @ 0x18eff60] Queue input is backward in time
[libopus @ 0x18eff60] Queue input is backward in time
[libopus @ 0x18eff60] Queue input is backward in time

...


    


    When you open an audio file in vlc, nothing is played (the audio track timestamp is missing).

    


    The task of my project is to simply take pcm_alaw data and pack it in a container, in mka format. The best way to determine the codec is to use the av_guess_codec() function, which in turn automatically selects the desired codec ID. But how do I pack the raw data into the container correctly, I do not know.

    


    It is important to note that I can get as raw data any format of this data (audio formats only) defined by the RTP packet type (All types of RTP packet payload). All I know is that in any case, I have to pack the audio data in an mka container.

    


    I also attach the code (borrowed from this resource) that I use :

    


    audiogenerater.h

    


    extern "C"
{
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libswresample/swresample.h"
}

class AudioGenerater
{
public:

    AudioGenerater();
   ~AudioGenerater() = default;

    void generateAudioFileWithOptions(
            QString        fileName,
            QByteArray     pcmData,
            int            channel,
            int            bitRate,
            int            sampleRate,
            AVSampleFormat format);
            
private:

    // init Format
    bool initFormat(QString audioFileName);

private:

    AVCodec         *m_AudioCodec        = nullptr;
    AVCodecContext  *m_AudioCodecContext = nullptr;
    AVFormatContext *m_FormatContext     = nullptr;
    AVOutputFormat  *m_OutputFormat      = nullptr;
};


    


    audiogenerater.cpp

    


    AudioGenerater::AudioGenerater()
{
    av_register_all();
    avcodec_register_all();
}

AudioGenerater::~AudioGenerater()
{
    // ... 
}

bool AudioGenerater::initFormat(QString audioFileName)
{
    // Create an output Format context
    int result = avformat_alloc_output_context2(&m_FormatContext, nullptr, nullptr, audioFileName.toLocal8Bit().data());
    if (result < 0) {
        return false;
    }

    m_OutputFormat = m_FormatContext->oformat;

    // Create an audio stream
    AVStream* audioStream = avformat_new_stream(m_FormatContext, m_AudioCodec);
    if (audioStream == nullptr) {
        avformat_free_context(m_FormatContext);
        return false;
    }

    // Set the parameters in the stream
    audioStream->id = m_FormatContext->nb_streams - 1;
    audioStream->time_base = { 1, 8000 };
    result = avcodec_parameters_from_context(audioStream->codecpar, m_AudioCodecContext);
    if (result < 0) {
        avformat_free_context(m_FormatContext);
        return false;
    }

    // Print FormatContext information
    av_dump_format(m_FormatContext, 0, audioFileName.toLocal8Bit().data(), 1);

    // Open file IO
    if (!(m_OutputFormat->flags & AVFMT_NOFILE)) {
        result = avio_open(&m_FormatContext->pb, audioFileName.toLocal8Bit().data(), AVIO_FLAG_WRITE);
        if (result < 0) {
            avformat_free_context(m_FormatContext);
            return false;
        }
    }

    return true;
}

void AudioGenerater::generateAudioFileWithOptions(
    QString _fileName,
    QByteArray _pcmData,
    int _channel,
    int _bitRate,
    int _sampleRate,
    AVSampleFormat _format)
{
    AVFormatContext* oc;
    if (avformat_alloc_output_context2(
            &oc, nullptr, nullptr, _fileName.toStdString().c_str())
        < 0) {
        qDebug() << "Error in line: " << __LINE__;
        return;
    }
    if (!oc) {
        printf("Could not deduce output format from file extension: using mka.\n");
        avformat_alloc_output_context2(
            &oc, nullptr, "mka", _fileName.toStdString().c_str());
    }
    if (!oc) {
        qDebug() << "Error in line: " << __LINE__;
        return;
    }
    AVOutputFormat* fmt = oc->oformat;
    if (fmt->audio_codec == AV_CODEC_ID_NONE) {
        qDebug() << "Error in line: " << __LINE__;
        return;
    }

    AVCodecID codecID = av_guess_codec(
        fmt, nullptr, _fileName.toStdString().c_str(), nullptr, AVMEDIA_TYPE_AUDIO);
    // Find Codec
    m_AudioCodec = avcodec_find_encoder(codecID);
    if (m_AudioCodec == nullptr) {
        qDebug() << "Error in line: " << __LINE__;
        return;
    }
    // Create an encoder context
    m_AudioCodecContext = avcodec_alloc_context3(m_AudioCodec);
    if (m_AudioCodecContext == nullptr) {
        qDebug() << "Error in line: " << __LINE__;
        return;
    }

    // Setting parameters
    m_AudioCodecContext->bit_rate = _bitRate;
    m_AudioCodecContext->sample_rate = _sampleRate;
    m_AudioCodecContext->sample_fmt = _format;
    m_AudioCodecContext->channels = _channel;

    m_AudioCodecContext->channel_layout = av_get_default_channel_layout(_channel);
    m_AudioCodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

    // Turn on the encoder
    int result = avcodec_open2(m_AudioCodecContext, m_AudioCodec, nullptr);
    if (result < 0) {
        avcodec_free_context(&m_AudioCodecContext);
        if (m_FormatContext != nullptr)
            avformat_free_context(m_FormatContext);
        return;
    }

    // Create a package
    if (!initFormat(_fileName)) {
        avcodec_free_context(&m_AudioCodecContext);
        if (m_FormatContext != nullptr)
            avformat_free_context(m_FormatContext);
        return;
    }

    // write to the file header
    result = avformat_write_header(m_FormatContext, nullptr);
    if (result < 0) {
        avcodec_free_context(&m_AudioCodecContext);
        if (m_FormatContext != nullptr)
            avformat_free_context(m_FormatContext);
        return;
    }

    // Create Frame
    AVFrame* frame = av_frame_alloc();
    if (frame == nullptr) {
        avcodec_free_context(&m_AudioCodecContext);
        if (m_FormatContext != nullptr)
            avformat_free_context(m_FormatContext);
        return;
    }

    int nb_samples = 0;
    if (m_AudioCodecContext->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) {
        nb_samples = 10000;
    }
    else {
        nb_samples = m_AudioCodecContext->frame_size;
    }

    // Set the parameters of the Frame
    frame->nb_samples = nb_samples;
    frame->format = m_AudioCodecContext->sample_fmt;
    frame->channel_layout = m_AudioCodecContext->channel_layout;

    // Apply for data memory
    result = av_frame_get_buffer(frame, 0);
    if (result < 0) {
        av_frame_free(&frame);
        {
            avcodec_free_context(&m_AudioCodecContext);
            if (m_FormatContext != nullptr)
                avformat_free_context(m_FormatContext);
            return;
        }
    }

    // Set the Frame to be writable
    result = av_frame_make_writable(frame);
    if (result < 0) {
        av_frame_free(&frame);
        {
            avcodec_free_context(&m_AudioCodecContext);
            if (m_FormatContext != nullptr)
                avformat_free_context(m_FormatContext);
            return;
        }
    }

    int perFrameDataSize = frame->linesize[0];
    int count = _pcmData.size() / perFrameDataSize;
    bool needAddOne = false;
    if (_pcmData.size() % perFrameDataSize != 0) {
        count++;
        needAddOne = true;
    }

    int frameCount = 0;
    for (int i = 0; i < count; ++i) {
        // Create a Packet
        AVPacket* pkt = av_packet_alloc();
        if (pkt == nullptr) {
            avcodec_free_context(&m_AudioCodecContext);
            if (m_FormatContext != nullptr)
                avformat_free_context(m_FormatContext);
            return;
        }
        av_init_packet(pkt);

        if (i == count - 1)
            perFrameDataSize = _pcmData.size() % perFrameDataSize;

        // Synthesize WAV files
        memset(frame->data[0], 0, perFrameDataSize);
        memcpy(frame->data[0], &(_pcmData.data()[perFrameDataSize * i]), perFrameDataSize);

        frame->pts = frameCount++;
        // send Frame
        result = avcodec_send_frame(m_AudioCodecContext, frame);
        if (result < 0)
            continue;

        // Receive the encoded Packet
        result = avcodec_receive_packet(m_AudioCodecContext, pkt);
        if (result < 0) {
            av_packet_free(&pkt);
            continue;
        }

        // write to file
        av_packet_rescale_ts(pkt, m_AudioCodecContext->time_base, m_FormatContext->streams[0]->time_base);
        pkt->stream_index = 0;
        result = av_interleaved_write_frame(m_FormatContext, pkt);
        if (result < 0)
            continue;

        av_packet_free(&pkt);
    }

    // write to the end of the file
    av_write_trailer(m_FormatContext);
    // Close file IO
    avio_closep(&m_FormatContext->pb);
    // Release Frame memory
    av_frame_free(&frame);

    avcodec_free_context(&m_AudioCodecContext);
    if (m_FormatContext != nullptr)
        avformat_free_context(m_FormatContext);
}


    


    main.cpp

    


    int main(int argc, char **argv)
{
    av_log_set_level(AV_LOG_TRACE);

    QFile file("rawDataOfPcmAlawType.bin");
    if (!file.open(QIODevice::ReadOnly)) {
        return EXIT_FAILURE;
    }
    QByteArray rawData(file.readAll());

    AudioGenerater generator;
    generator.generateAudioFileWithOptions(
               "test.mka",
               rawData,
               1, 
               64000, 
               8000,
               AV_SAMPLE_FMT_S16);

    return 0;
}


    


    It is IMPORTANT you help me find the most appropriate way to record pcm_alaw or a different data format in an MKA audio file.

    


    I ask everyone who knows anything to help (there is too little time left to implement this project)

    


  • Blog series part 1 : How to use Matomo to increase customer acquisitions for your business

    2 septembre 2020, par Joselyn Khor — Analytics Tips, Marketing

    Are you investing time and money into marketing your business and unsure if it’s paying off ? Web analytics provides the tools and insights to help you know which marketing channels to target and focus on. Without it you might be going in blind and missing opportunities that might’ve been easily found in your metrics.

    Increasing acquisition cheat sheet

    To increase customer acquisition on your website you need to first attract the right visitors to your website. Then capturing their attention and engaging them in your content. Finally you’ll want to convert by driving them through a streamlined funnel/buyer’s journey on your website all backed up by data.

    So, how do you attract audiences to your site with a web analytics tool like Matomo ?

    1. Figure out who your audience is through the Visitor Profiles feature. 
    2. Calculate the Cost of Customer Acquisition (CAC) to plan for growth. To grow and make your business/website sustainable, you’ll need to earn more money from a customer than you spend on acquiring them. How to calculate : Divide marketing spend by the number of customers acquired. 
    3. Figure out which marketing channels e.g., social media, PPC, SEO, content marketing, etc., you should invest more in and which of those you should focus less on.

    How to increase acquisitions with Matomo

    1. Use the Acquisitions feature
    2. Use funnels
    3. Study Visitor Profiles
    4. Focus on SEO efforts
    5. Look at the Multi Attribution feature
    6. Set goals
    7. Set Advanced eCommerce reporting

    1. Use the Acquisitions feature

    Matomo Analytics has a dedicated Acquisition feature to help with some of the heavy-lifting, making it easy for you to formulate targeted acquisition plans.

    Acquisitions feature

    This feature helps you learn who your potential customers are and figure out what marketing channels are converting the best for these visitors.

    • Learn what traffic you get from external websites : Knowing who’s helping you succeed from external websites is a crucial step to be able to focus your attention. Paid sponsorships, guest blog posts or even spending more on advertising on the particular website could result in greater traffic.
    • Social Networks : See which social media channels are connecting with the audiences you want. Take the guesswork out by using only the ones you need. By finding out which social channels your ideal audience prefers, you can generate shareable, convincing and engaging content to drive shares and traffic through to your site.
    • Campaigns : Your marketing team may have spent precious time and resource coming up with campaigns that are designed to succeed, but how can you be so sure ? With Campaigns you can understand what marketing campaigns are working, what aren’t, and shift your marketing efforts accordingly to gain more visitors, more effectively, with less costs. Keep track of every ad and content piece you display across internal and external channels to see which is having the biggest impact on your business objectives. Learn more

    Watch this video to learn about the Acquisitions feature

    2. Use funnels

    Creating conversion funnels gives you the big picture on whether your acquisition plans are paying off and where they may be falling short.

    Funnels feature

    If the ultimate goal of your site is to drive conversions, then each funnel can tell you how effectively you’re driving traffic through to your desired outcome.

    By integrating this with Visitor Profiles, you can view historic visitor profiles of any individual user at any stage of the conversion funnel. You see the full user journey at an individual level, including where they entered the funnel from and where they exited. Learn more

    How to amplify acquisition strategies with Funnels : Use conversion funnels to guide acquisition as you can tell which entry point is bringing the most success and which one needs more attention. Tailor your strategies to zone in on areas that have the most potential. You can identify where your visitors are encountering obstacles from the start, that are stopping them from progressing through their journey on your site.

    3. Study Visitor Profiles

    Visitor Profiles helps you understand visitors on a user-by-user basis, detailing each visitors’ history into a profile which summarises every visit, action and purchase made.

    Visitor Profiles feature

    Better understand :

    • Why your visitors viewed your website.

    • Why your returning visitors continue to view your website.

    • What specifically your visitors are looking for and whether they found it on your website.

    The benefit is being able to see how a combination of acquisition channels play a part in a single buyer’s journey.

    How Visitor Profiles helps with acquisition : By understanding the full behavioural patterns of any individual user coming through from external channels, you’ll see the path that led them to take action, where they may have gotten lost, and how engaged they are with your business over time. This gives you an indication of what kinds of visitors you’re attracting and helps you craft a buyer persona that more accurately reflects the audience most interested in you.

    4. Focus on SEO efforts

    Every acquisition plan needs a focus on maximising your Search Engine Optimization (SEO) efforts. When it comes to getting conclusive search engine referrer metrics, you need to be sure you’re getting ALL the insights to drive your SEO strategy.

    Integrate Google, Bing and Yahoo search consoles directly into your Matomo Analytics. This helps kickstart your acquisition goals as you rank highly for keywords that get the most traffic to your website.

    As another major SEO benefit, you can see how the most important search keywords to your business increased and decreased in ranking over time. 

    How to amplify acquisitions strategies with search engines and keywords : By staying on top of your competitors across ALL search engines, you may uncover traffic converting highly from one search engine, or find you could be losing traffic and business opportunities to your competitors across others.

    5. Look at the Multi Attribution feature

    Multi Attribution lets you measure the success of every touchpoint in the customer journey.

    Multi Attribution feature

    Accurately measure (and assign value to) channels where visitors first engaged with your business, where they came from after that, as well as the final channel they came from before purchasing your product or service.

    No longer falsely over-estimate any marketing channel and make smarter decisions when determining acquisition spend to accurately calculate the Customer Acquisition Cost (CAC). Learn more

    6. Set your Goals

    What are the acquisition goals you want to achieve the most ? The Goals feature lets you measure the most important metrics you need to grow your business.

    Goals feature

    Goals are crucial for building your marketing strategy and acquiring new customers. The more goals you track, the more you can learn about behavioural changes as you implement and modify paths that impact acquisition and conversions over time. You’ll understand which channels are converting the best for your business, which cities/countries are most popular, what devices will attract the most visitors and how engaged your visitors are before converting.

    This way you can see if your campaigns (SEO, PPC, signups, blogs etc.) or optimising efforts (A/B Testing, Funnels) have made an impact with the time and investment you have put in. Learn more

    7. Set Advanced Ecommence reporting

    If your website’s overall purpose is to generate revenue whether it be from an online store, asking for donations or from an online paid membership site ; the Ecommerce feature gives you comprehensive insights into your customers’ purchasing behaviours.

    Ecommerce feature

    When you use Ecommerce analytics, you heavily reduce risk when marketing your products to potential customers because you will understand who to target, what to target them with and where further opportunities exist to have the greatest impact for your business. Learn more

    Key takeaway

    Having the tools to ensure you’re creating a well planned acquisition strategy is key to attracting and capturing the attention of potential visitors/leads, and then driving them through a funnel/buyer’s journey on your website. Because of Matomo’s reputation as a trusted analytics platform, the features above can be used to assist you in making smarter data-driven decisions. You can pursue different acquisition avenues with confidence and create a strategy that’s agile and ready for success, all while respecting user privacy.

    Want to learn how to increase engagement with Matomo ? Look out for part 2 ! We’ll go through how you can boost engagement on your website via web analytics.

  • Can someone help me to install the netflix's VMAF library in Ubuntu

    20 février 2023, par peter12

    First of all, I have to say that I am not very experienced in ubuntu.
I would like to install this library to use with FFMPEG.

    



    I am following these steps, but I can manage to install it well...

    



    https://github.com/Netflix/vmaf/blob/master/resource/doc/VMAF_Python_library.md

    



    Could someone tell me what are the exact steps (commands) that I have to follow.

    



    On the other hand, someone knows if there are other metrics that can ffmpeg calculates directly (apart from PSNR or SSIM) ?

    



    Many thanks