Recherche avancée

Médias (91)

Autres articles (35)

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

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Liste des distributions compatibles

    26 avril 2011, par

    Le tableau ci-dessous correspond à la liste des distributions Linux compatible avec le script d’installation automatique de MediaSPIP. Nom de la distributionNom de la versionNuméro de version Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    Si vous souhaitez nous aider à améliorer cette liste, vous pouvez nous fournir un accès à une machine dont la distribution n’est pas citée ci-dessus ou nous envoyer le (...)

Sur d’autres sites (4257)

  • 5 Key Benefits of Using a Tag Manager

    12 décembre 2021, par erin — Analytics Tips, Marketing

    Websites today have become very complex to manage, and as you continue to look for ways to optimise your website, you’ll want to consider using a Tag Manager

    A Tag Manager will help your marketing team seamlessly track how your visitors are engaging with your website’s elements. Without a Tag Manager, you are missing out on business-altering insights.

    In this blog, we’ll cover :

    Tag Manager overview 

    A Tag Manager (AKA Tag Management System or TMS) is a centralised system for implementing, managing and tracking events. A tag is just another word for a piece of code on a website that tracks a specific event. 

    An example of a tag tracking code might be Facebook pixels, ad conversions and other website activities such as signing up to a newsletter or PDF download. 

    Triggers are the actual actions that website visitors take that activate the tag. Examples of triggers are things like : 

    • A thank you page view to show that a visitor has completed a conversion action
    • Clicking a download or sign up button 
    • Scroll depth or how far down users are scrolling on your webpage 

    Each of these will give you insights into how your website is performing and how your users are engaging with your content. Going back to the scroll depth trigger example, this would be particularly helpful for validating bounce rate and finding out where users are dropping off on a page. Discover other ways to take advantage of tags and event tracking

    Tag Manager

    5 key benefits of a Tag Manager

    1. Removes the risks of website downtime 

    Tags are powerful for in-depth web analytics. However, tagging opens up the potential for non-technical team members to break the front-end of your website in a couple of clicks. 

    A Tag Manager reduces that risk. For example, Matomo Tag Manager lets you preview tags to see if they are firing before pushing them live. You can also give specific users restricted access so you can approve any tagging before it goes live. 

    Tag Managers protect the functionality of your website and ensure that there is no downtime.

    2. Your website will load faster 

    When it comes to the success of your website, page speed is one of the most important factors. 

    Each time you add a tag to your site, you run the risk of slowing down the page speed. This can quickly build up to a poor performing site and frustrate your visitors.

    You can’t track tags if visitors won’t even stay long enough for your site to load. In fact, 1 in 4 visitors would abandon a website that takes more than 4 seconds to load. According to Deloitte, just a 0.1 second difference in loading speed can affect every step of your customer journey. 

    A Tag Manager, on the other hand, is a lightweight option only requiring one single tag. Using a Tag Manager to track events can make all the difference to your website’s performance and user experience.

    3. Greater efficiency for marketing

    Time is critical in marketing. The longer it takes for a campaign to launch, the greater the chances are that you’re missing out on sales opportunities.

    Waiting for the IT team to tag a thank you page before setting an ad live is inefficient and impacts your bottom line.

    Equipping marketing with a Tag Manager means that they’ll be able to launch campaigns faster and more effectively.

    Check out our Marketer’s Guide to Successful Website Event Tracking for more.

    4. Control all of your tracking and marketing tags in one place 

    Keeping track of what tags are on your site and where they’re located is a complicated task if you aren’t using a Tag Manager. Unmanaged tags can quickly pile up and result in errors with your analytics, like counting conversions twice. 

    Using a Tag Manager to centralise your tags in one easy to manage place reduces the chances of human errors. Instead, your team will be able to quickly see what tags are already in place so they aren’t doubling up on tracking.

    5. Reduce work for the IT team 

    Let’s face it, the IT team has more critical tasks at hand than adding tags to the website. Freeing up your IT team to focus on higher priority tasks should always be a goal.

    Tagging, while crucial for marketing, has the potential to create a lot of extra work for your website developers. Inserting code for each individual tag is time-consuming and means you aren’t collecting data in the meantime.

    Rather than overloading your IT team, empower your marketing team with the ability to add tags with a few clicks. 

    How to choose a Tag Management System

    There are many tools to choose from and the default option tends to be Google Tag Manager (GTM). But before you implement GTM or any other Tag Management Solution, we highly recommend asking these questions :

    1. What are my goals for a Tag Manager ? Before purchasing a Tag Manager, or any tool for that matter, understanding your goals upfront is best practice.
    2. Does the solution offer Tag Manager training resources ? If online Tag Manager training and educational resources are available for the tool, then you’ll be able to hit the ground running and start to see an ROI instantly.
    3. Can I get online support ? In case you need any help with the tool, having access to online support is a big bonus. 
    4. Is it compliant with privacy regulations ? If your business is already compliant, in the process of becoming compliant or future-proofing your tech stack for looming privacy regulations, then researching this is crucial. 
    5. How much does it cost ? If it’s “free”, find out how and why. In most cases, free solutions are just vehicles for collecting data to advertise to your users. 
    6. What do others think about the Tag Manager ? Check out reviews on sites like Capterra or G2 to find out how other businesses rate the tool. 

    Google Tag Manager alternative

    As privacy becomes a greater concern globally for end-users and governments, many businesses are looking for alternatives to the world’s largest advertising company – Google.

    Matomo Tag Manager is more than a Google Tag Manager alternative. With Matomo Tag Manager, you get a GDPR, HIPAA, CCPA and PECR compliant, open source Tag Manager and your data is 100% yours to own.

    Plus, with Matomo Tag Manager you only need one single tracking code for all of your website and tag analytics. No matter what you are tracking (scrolls, clicks, downloads, Heatmaps, visits, etc.), you will only ever need one piece of code on your website and one tool to manage it all. 

    The takeaway 

    Tagging is powerful but can quickly become complicated, risky and time-consuming. Tag Managers reduce these obstacles allowing you to set tags and triggers effortlessly. It empowers marketing teams, streamlines processes and removes the reliance on IT.

    Ready to try Matomo Tag Manager ? Start your 21-day free trial now – no credit card required. 

  • 7 Reasons to Migrate from Google Analytics to Matomo Now

    15 mai 2022, par Erin

    The release of Google Analytics 4 (GA4), and the subsequent depreciation of Universal Analytics, has caused a stir amongst webmasters, SEO experts, marketers and the likes.

    Google’s Universal Analytics is the most widely used web analytics platform in the world, but from 1 July 2023, it will no longer process any new data. Google is now pushing users to set up GA4 tracking imminently.

    If you’re like many and wondering if you should upgrade to Google Analytics 4, there are two key reasons why this might be a risk :

    1. GDPR violations : recent rulings have deemed Google Analytics illegal in France and Austria, and it’s likely that this trend will continue across the EU.
    2. Data loss : users switching to Google Analytics 4 can’t migrate their data from Universal Analytics.

    To mitigate these risks, many organisations are looking to switch to a Google Analytics alternative like Matomo. This is an ideal option for organisations that want to take ownership of their data, get compliant with privacy regulations and save themselves the stress of Google deprecating the software they rely on.

    Whilst there are two major reasons to steer clear of Google Analytics 4, there are 7 reasons why migrating to Matomo instead could save your business time, money and peace of mind.

    If you want to avoid the pitfalls of GA4 and are thinking about migrating from Universal Analytics to Matomo, here’s why you should make the switch now.

    1. Keep your historical Universal Analytics data

    Users switching to Google Analytics 4 will be disappointed to find out that GA4 does not accept data imports from Universal Analytics. On top of that, Google also announced that after Universal Analytics stops processing new data (1 July 2023), users will only be able to access this data for “at least six months”. 

    Years of valuable insights will be completely wiped and organisations will not be able to report on year over year results.

    Fortunately, any organisation using Universal Analytics can import this data into Matomo using our Google Analytics Importer plugin. So you can reduce business disruptions and retain years of valuable web analytics data when you switch to Matomo.

    Our comprehensive migration documentation features a handy video, written guides and FAQs to ensure a smooth migration process.

    2. Ease of use

    Web analytics is complicated enough without having to navigate confusing platform user interfaces (UIs). One of GA4’s biggest drawbacks is the “awful and unusable” interface which has received an overwhelming amount of negative backlash online. 

    Matomo’s intuitive UI contains many of the familiar features that made Universal Analytics so well-liked. You’ll find the same popular features like Visitors, Behaviour, and Acquisition to name a few.

    Behaviour User Flow in Matomo

    User Flow in Matomo

    When you switch to Matomo you can get up to speed quickly and spend more time focusing on high-value tasks, rather than learning about everything new in GA4.

    3. 100% accurate unsampled data

    GA4 implements data sampling and machine learning to fill gaps. Often what you are basing critical business decisions on is actually an estimate of activity. 

    Matomo does not use data sampling, so this guarantees you will always see the full picture.

    “My primary reason to use Matomo is to get the unsampled data, [...] if your website gets lots of traffic and you can’t afford an enterprise level tool like GA premium [GA360] then Matomo is your best choice.”

    Himanshu Sharma, Digital Marketing Consultant & Founder at Optimize Smart.

    With Matomo you can be confident your data-driven decisions are being made with real data.

    4. Privacy by design

    Built-in privacy has always been at the core of Matomo. One key method we use to achieve this, is by giving you 100% data ownership of your web analytics data. You don’t ever have to worry about the data landing in the wrong hands or being used in unethical ways – like unsolicited advertising. 

    On the contrary, Google Analytics is regularly under fire for controversial uses of data. While Google has made changes to make GA4 more privacy-focused, it’s all just smoke and mirrors. The data collected from Google Analytics accounts is used by Google to create digital profiles on internet users, which is then used for advertising. 

    Consumers are becoming increasingly concerned about how businesses are using their data. Businesses that develop privacy strategies, utilise privacy-focused tools will gain a competitive advantage and a loyal customer-base. 

    Prioritise the protection of your user data by switching to a privacy-by-design analytics solution.

    5. Compliance with global privacy laws

    To date, Google Analytics has been deemed illegal to use in France and Austria due to data transfers to the US. Upgrading to GA4 doesn’t make this problem go away either since data is still transferred to the US. 

    Matomo is easily configured to follow even the strictest of privacy laws like GDPR, HIPAA, CCPA, LGPD and PECR. Here’s how :

    Matomo can also be used without cookie consent banners (unlike with Google Analytics, which will always need user consent to track). Matomo has been approved by the French Data Protection Authority (CNIL) as one of the select few web analytics tools that can be used to collect data without tracking consent.

    Every year more countries are drafting legislation that mirrors the European Union’s GDPR (like the Brazilian LGPD). Matomo is designed to stay data-privacy law compliant, and always will be.

    Stay on top of global privacy laws and reduce the time you spend on compliance by switching to a privacy-compliant solution. 

    6. All-in-one web analytics

    Matomo gives you easy access to Heatmaps, Session Recordings, A/B testing, Funnels analytics, and more right out of the box. This means that digital marketing, UX and procurement teams won’t need to set up and manage multiple tools for behavioural analytics – it’s all in one place.

    Learn more about your audience, save money and reduce complexity by switching to an all-in-one analytics solution.

    Check out Matomo’s extensive product features.

    Heatmaps in Matomo

    Page Scroll Depth in Matomo

    7. Tag Manager built-in

    Unlike GA4, the Matomo Tag Manager comes built-in for an efficient and consistent user experience. Matomo Tag Manager offers a pain-free solution for embedding tracking codes on your website without needing help from a web developer or someone with technical knowledge.

    Help your Marketing team track more website actions and give time back to your web developer by switching to Matomo Tag Manager.

    Final Thoughts

    Google Analytics is free to use, but the surrounding legal issues with the platform and implications of switching to GA4 will make migrating a tough choice for many businesses. 

    Now is the chance for organisations to step away from the advertising tech giant, take ownership of web analytics data and get compliant. Switch to the leading Google Analytics alternative and see why over 1 million websites choose Matomo for their web analytics.

    Ready to get started with your own Google Analytics to Matomo migration ? Try Matomo free for 21 days now – no credit card required. 

  • FFMPEG audio transcoding using libav* libraries

    25 mai 2022, par vinvinod

    I am writing an audio transcoding application using ffmpeg libraries. 
Here is my code

    



        /*&#xA;     * File:   main.cpp&#xA;     * Author: vinod&#xA;     * Compile with "g&#x2B;&#x2B; -std=c&#x2B;&#x2B;11 -o audiotranscode main.cpp -lavformat -lavcodec -lavutil -lavfilter"&#xA;     * &#xA;     */&#xA;&#xA;&#xA;    #if !defined PRId64 || PRI_MACROS_BROKEN&#xA;    #undef PRId64&#xA;    #define PRId64 "lld"&#xA;    #endif&#xA;&#xA;    #define __STDC_FORMAT_MACROS&#xA;&#xA;    #ifdef   __cplusplus&#xA;    extern "C" {&#xA;    #endif&#xA;&#xA;    #include &#xA;    #include &#xA;    #include <sys></sys>types.h>&#xA;    #include &#xA;    #include <libavutil></libavutil>imgutils.h>&#xA;    #include <libavutil></libavutil>samplefmt.h>&#xA;    #include <libavutil></libavutil>frame.h>&#xA;    #include <libavutil></libavutil>timestamp.h>&#xA;    #include <libavformat></libavformat>avformat.h>&#xA;    #include <libavfilter></libavfilter>avfilter.h>&#xA;    #include <libavfilter></libavfilter>buffersrc.h>&#xA;    #include <libavfilter></libavfilter>buffersink.h>&#xA;    #include <libswscale></libswscale>swscale.h>&#xA;    #include <libavutil></libavutil>opt.h>&#xA;&#xA;    #ifdef   __cplusplus&#xA;    }&#xA;    #endif&#xA;&#xA;    #include <iostream>&#xA;    using namespace std;&#xA;&#xA;    int select_stream, got_frame, got_packet;&#xA;&#xA;    AVFormatContext *in_fmt_ctx = NULL, *out_fmt_ctx = NULL;&#xA;    AVCodec *dec_codec = NULL, * enc_codec = NULL;&#xA;    AVStream *audio_st = NULL;&#xA;    AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL;&#xA;&#xA;    AVFrame *pFrame = NULL, * pFrameFiltered = NULL;&#xA;&#xA;    AVFilterGraph *filter_graph = NULL;&#xA;    AVFilterContext *buffersrc_ctx = NULL;&#xA;    AVFilterContext *buffersink_ctx = NULL;&#xA;&#xA;    AVPacket packet;&#xA;&#xA;    string inFileName = "/home/vinod/vinod/Media/univac.webm";&#xA;    string outFileName = "audio_extracted.m4a";&#xA;&#xA;    int target_bit_rate = 128000,&#xA;        sample_rate = 22050,&#xA;        channels = 1;&#xA;    AVSampleFormat sample_fmt = AV_SAMPLE_FMT_S16;&#xA;    string filter_description = "aresample=22050,aformat=sample_fmts=s16:channel_layouts=mono";&#xA;&#xA;    int log_averror(int errcode)&#xA;    {&#xA;            char *errbuf = (char *) calloc(AV_ERROR_MAX_STRING_SIZE, sizeof(char));&#xA;            av_strerror(errcode, errbuf, AV_ERROR_MAX_STRING_SIZE);&#xA;            std::cout &lt;&lt; "Error - " &lt;&lt; errbuf &lt;&lt; std::endl;&#xA;            delete [] errbuf;&#xA;            return -1;&#xA;    }&#xA;&#xA;    /**&#xA;     * Initialize conversion filter */&#xA;    int initialize_audio_filter()&#xA;    {&#xA;            char args[512];&#xA;            int ret;&#xA;            AVFilter *buffersrc = avfilter_get_by_name("abuffer");&#xA;            AVFilter *buffersink = avfilter_get_by_name("abuffersink");&#xA;            AVFilterInOut *outputs = avfilter_inout_alloc();&#xA;            AVFilterInOut *inputs = avfilter_inout_alloc();&#xA;            filter_graph = avfilter_graph_alloc();&#xA;            const enum AVSampleFormat out_sample_fmts[] = {sample_fmt, AV_SAMPLE_FMT_NONE};&#xA;            const int64_t out_channel_layouts[] = {av_get_default_channel_layout(out_fmt_ctx -> streams[0] -> codec -> channels), -1};&#xA;            const int out_sample_rates[] = {out_fmt_ctx -> streams[0] -> codec -> sample_rate, -1};&#xA;&#xA;            if (!dec_ctx->channel_layout)&#xA;                    dec_ctx->channel_layout = av_get_default_channel_layout(dec_ctx->channels);&#xA;&#xA;            snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%" PRIx64,&#xA;                     in_fmt_ctx -> streams[select_stream] -> time_base.num, in_fmt_ctx -> streams[select_stream] -> time_base.den,&#xA;                     dec_ctx->sample_rate,&#xA;                     av_get_sample_fmt_name(dec_ctx->sample_fmt),&#xA;                     dec_ctx->channel_layout);&#xA;            ret = avfilter_graph_create_filter(&amp;buffersrc_ctx, buffersrc, "in", args, NULL, filter_graph);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");&#xA;                    return -1;&#xA;            }&#xA;&#xA;            ret = avfilter_graph_create_filter(&amp;buffersink_ctx, buffersink, "out", NULL, NULL, filter_graph);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");&#xA;                    return ret;&#xA;            }&#xA;&#xA;            ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1,&#xA;                                      AV_OPT_SEARCH_CHILDREN);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n");&#xA;                    return ret;&#xA;            }&#xA;&#xA;            ret = av_opt_set_int_list(buffersink_ctx, "channel_layouts", out_channel_layouts, -1,&#xA;                                      AV_OPT_SEARCH_CHILDREN);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");&#xA;                    return ret;&#xA;            }&#xA;&#xA;            ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1,&#xA;                                      AV_OPT_SEARCH_CHILDREN);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");&#xA;                    return ret;&#xA;            }&#xA;&#xA;            /* Endpoints for the filter graph. */&#xA;            outputs -> name = av_strdup("in");&#xA;            outputs -> filter_ctx = buffersrc_ctx;&#xA;            outputs -> pad_idx = 0;&#xA;            outputs -> next = NULL;&#xA;            /* Endpoints for the filter graph. */&#xA;            inputs -> name = av_strdup("out");&#xA;            inputs -> filter_ctx = buffersink_ctx;&#xA;            inputs -> pad_idx = 0;&#xA;            inputs -> next = NULL;&#xA;            string filter_desc = filter_description;&#xA;&#xA;            if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_desc.c_str(), &amp;inputs, &amp;outputs, NULL)) &lt; 0) {&#xA;                    log_averror(ret);&#xA;                    exit(1);&#xA;            }&#xA;&#xA;            if ((ret = avfilter_graph_config(filter_graph, NULL)) &lt; 0) {&#xA;                    log_averror(ret);&#xA;                    exit(1);&#xA;            }&#xA;&#xA;            /* Print summary of the sink buffer&#xA;             * Note: args buffer is reused to store channel layout string */&#xA;            AVFilterLink *outlink = buffersink_ctx->inputs[0];&#xA;            av_get_channel_layout_string(args, sizeof(args), -1, outlink->channel_layout);&#xA;            av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n",&#xA;                   (int) outlink->sample_rate,&#xA;                   (char *) av_x_if_null(av_get_sample_fmt_name((AVSampleFormat) outlink->format), "?"),&#xA;                   args);&#xA;            return 0;&#xA;    }&#xA;&#xA;    /*&#xA;     *&#xA;     */&#xA;    int main(int argc, char **argv)&#xA;    {&#xA;            int ret;&#xA;            cout &lt;&lt; "Hello World" &lt;&lt; endl;&#xA;            printf("abcd");&#xA;            avcodec_register_all();&#xA;            av_register_all();&#xA;            avfilter_register_all();&#xA;&#xA;            /* open input file, and allocate format context */&#xA;            if (avformat_open_input(&amp;in_fmt_ctx, inFileName.c_str(), NULL, NULL) &lt; 0) {&#xA;                    std::cout &lt;&lt; "error opening input file - " &lt;&lt; inFileName &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            /* retrieve stream information */&#xA;            if (avformat_find_stream_info(in_fmt_ctx, NULL) &lt; 0) {&#xA;                    std::cerr &lt;&lt; "Could not find stream information in the input file " &lt;&lt; inFileName &lt;&lt; std::endl;&#xA;            }&#xA;&#xA;            /* Dump format details */&#xA;            printf("\n ---------------------------------------------------------------------- \n");&#xA;            av_dump_format(in_fmt_ctx, 0, inFileName.c_str(), 0);&#xA;            printf("\n ---------------------------------------------------------------------- \n");&#xA;            /* Choose a audio stream */&#xA;            select_stream = av_find_best_stream(in_fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &amp;dec_codec, 0);&#xA;&#xA;            if (select_stream == AVERROR_STREAM_NOT_FOUND) {&#xA;                    std::cerr &lt;&lt; "No audio stream found" &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            if (select_stream == AVERROR_DECODER_NOT_FOUND) {&#xA;                    std::cerr &lt;&lt; "No suitable decoder found" &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            dec_ctx = in_fmt_ctx -> streams[ select_stream] -> codec;&#xA;            av_opt_set_int(dec_ctx, "refcounted_frames", 1, 0);&#xA;&#xA;            /* init the audio decoder */&#xA;            if ((ret = avcodec_open2(dec_ctx, dec_codec, NULL)) &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n");&#xA;                    return ret;&#xA;            }&#xA;&#xA;            /* allocate output context */&#xA;            ret = avformat_alloc_output_context2(&amp;out_fmt_ctx, NULL, NULL,&#xA;                                                 outFileName.c_str());&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    std::cerr &lt;&lt; "Could not create output context for the file " &lt;&lt; outFileName &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            /* find the encoder */&#xA;            enum AVCodecID codec_id = out_fmt_ctx -> oformat -> audio_codec;&#xA;            enc_codec = avcodec_find_encoder(codec_id);&#xA;&#xA;            if (!(enc_codec)) {&#xA;                    std::cerr &lt;&lt; "Could not find encoder for - " &lt;&lt; avcodec_get_name(codec_id) &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            /* add a new stream */&#xA;            audio_st = avformat_new_stream(out_fmt_ctx, enc_codec);&#xA;&#xA;            if (!audio_st) {&#xA;                    std::cerr &lt;&lt; "Could not add audio stream - " &lt;&lt; std::endl;&#xA;            }&#xA;&#xA;            /* Initialise audio codec */&#xA;            audio_st -> id = out_fmt_ctx -> nb_streams - 1;&#xA;            enc_ctx = audio_st -> codec;&#xA;            enc_ctx -> codec_id = codec_id;&#xA;            enc_ctx -> codec_type = AVMEDIA_TYPE_AUDIO;&#xA;            enc_ctx -> bit_rate = target_bit_rate;&#xA;            enc_ctx -> sample_rate = sample_rate;&#xA;            enc_ctx -> sample_fmt = sample_fmt;&#xA;            enc_ctx -> channels = channels;&#xA;            enc_ctx -> channel_layout = av_get_default_channel_layout(enc_ctx -> channels);&#xA;&#xA;            /* Some formats want stream headers to be separate. */&#xA;            if (out_fmt_ctx -> oformat -> flags &amp; AVFMT_GLOBALHEADER) {&#xA;                    enc_ctx -> flags |= CODEC_FLAG_GLOBAL_HEADER;&#xA;            }&#xA;&#xA;            ret = avcodec_open2(out_fmt_ctx -> streams[0] -> codec, enc_codec, NULL);&#xA;&#xA;            if (ret &lt; 0) {&#xA;                    std::cerr &lt;&lt; "Could not create codec context for the file " &lt;&lt; outFileName &lt;&lt; std::endl;&#xA;                    return -1;&#xA;            }&#xA;&#xA;            /* Initialize filter */&#xA;            initialize_audio_filter();&#xA;&#xA;            if (!(out_fmt_ctx -> oformat -> flags &amp; AVFMT_NOFILE)) {&#xA;                    int ret = avio_open(&amp; out_fmt_ctx -> pb, outFileName.c_str(),&#xA;                                        AVIO_FLAG_WRITE);&#xA;&#xA;                    if (ret &lt; 0) {&#xA;                            log_averror(ret);&#xA;                            return -1;&#xA;                    }&#xA;            }&#xA;&#xA;            /* Write header */&#xA;            if (avformat_write_header(out_fmt_ctx, NULL) &lt; 0) {&#xA;                    if (ret &lt; 0) {&#xA;                            log_averror(ret);&#xA;                            return -1;&#xA;                    }&#xA;            }&#xA;&#xA;            /* Allocate frame */&#xA;            pFrame = av_frame_alloc();&#xA;&#xA;            if (!pFrame) {&#xA;                    std::cerr &lt;&lt; "Could not allocate frame\n";&#xA;                    return -1;&#xA;            }&#xA;&#xA;            pFrameFiltered = av_frame_alloc();&#xA;&#xA;            if (!pFrameFiltered) {&#xA;                    std::cerr &lt;&lt; "Could not allocate frame\n";&#xA;                    return -1;&#xA;            }&#xA;&#xA;            av_init_packet(&amp;packet);&#xA;            packet.data = NULL;&#xA;            packet.size = 0;&#xA;&#xA;            /* Read packet from the stream */&#xA;            while (av_read_frame(in_fmt_ctx, &amp;packet) >= 0) {&#xA;                    if (packet.stream_index == select_stream) {&#xA;                            avcodec_get_frame_defaults(pFrame);&#xA;                            ret = avcodec_decode_audio4(dec_ctx, pFrame, &amp;got_frame, &amp;packet);&#xA;&#xA;                            if (ret &lt; 0) {&#xA;                                    log_averror(ret);&#xA;                                    return ret;&#xA;                            }&#xA;&#xA;                            printf("Decoded packet pts : %ld ", packet.pts);&#xA;                            printf("Frame Best Effor pts : %ld \n", pFrame->best_effort_timestamp);&#xA;                            /* Set frame pts */&#xA;                            pFrame -> pts = av_frame_get_best_effort_timestamp(pFrame);&#xA;&#xA;                            if (got_frame) {&#xA;                                    /* push the decoded frame into the filtergraph */&#xA;                                    ret = av_buffersrc_add_frame_flags(buffersrc_ctx, pFrame, AV_BUFFERSRC_FLAG_KEEP_REF);&#xA;&#xA;                                    if (ret &lt; 0) {&#xA;                                            log_averror(ret);&#xA;                                            return ret;&#xA;                                    }&#xA;&#xA;                                    /* pull filtered frames from the filtergraph */&#xA;                                    while (1) {&#xA;                                            ret = av_buffersink_get_frame(buffersink_ctx, pFrameFiltered);&#xA;&#xA;                                            if ((ret == AVERROR(EAGAIN)) || (ret == AVERROR_EOF)) {&#xA;                                                    break;&#xA;                                            }&#xA;&#xA;                                            if (ret &lt; 0) {&#xA;                                                    printf("Error while getting filtered frames from filtergraph\n");&#xA;                                                    log_averror(ret);&#xA;                                                    return -1;&#xA;                                            }&#xA;&#xA;                                            /* Initialize the packets */&#xA;                                            AVPacket encodedPacket = {0};&#xA;                                            av_init_packet(&amp;encodedPacket);&#xA;                                            ret = avcodec_encode_audio2(out_fmt_ctx -> streams[0] -> codec, &amp;encodedPacket, pFrameFiltered, &amp;got_packet);&#xA;&#xA;                                            if (!ret &amp;&amp; got_packet &amp;&amp; encodedPacket.size) {&#xA;                                                    /* Set correct pts and dts */&#xA;                                                    if (encodedPacket.pts != AV_NOPTS_VALUE) {&#xA;                                                            encodedPacket.pts = av_rescale_q(encodedPacket.pts, buffersink_ctx -> inputs[0] -> time_base,&#xA;                                                                                             out_fmt_ctx -> streams[0] -> time_base);&#xA;                                                    }&#xA;&#xA;                                                    if (encodedPacket.dts != AV_NOPTS_VALUE) {&#xA;                                                            encodedPacket.dts = av_rescale_q(encodedPacket.dts, buffersink_ctx -> inputs[0] -> time_base,&#xA;                                                                                             out_fmt_ctx -> streams[0] -> time_base);&#xA;                                                    }&#xA;&#xA;                                                    printf("Encoded packet pts %ld\n", encodedPacket.pts);&#xA;                                                    /* Write the compressed frame to the media file. */&#xA;                                                    ret = av_interleaved_write_frame(out_fmt_ctx, &amp;encodedPacket);&#xA;&#xA;                                                    if (ret &lt; 0) {&#xA;                                                            log_averror(ret);&#xA;                                                            return -1;&#xA;                                                    }&#xA;                                            } else if (ret &lt; 0) {&#xA;                                                    log_averror(ret);&#xA;                                                    return -1;&#xA;                                            }&#xA;&#xA;                                            av_frame_unref(pFrameFiltered);&#xA;                                    }&#xA;&#xA;                                    av_frame_unref(pFrame);&#xA;                            }&#xA;                    }&#xA;            }&#xA;&#xA;            /* Flush delayed frames from encoder*/&#xA;            got_packet=1;&#xA;            while (got_packet) {&#xA;                    AVPacket encodedPacket = {0};&#xA;                    av_init_packet(&amp;encodedPacket);&#xA;                    ret = avcodec_encode_audio2(out_fmt_ctx -> streams[0] -> codec, &amp;encodedPacket, NULL, &amp;got_packet);&#xA;&#xA;                    if (!ret &amp;&amp; got_packet &amp;&amp; encodedPacket.size) {&#xA;                            /* Set correct pts and dts */&#xA;                            if (encodedPacket.pts != AV_NOPTS_VALUE) {&#xA;                                    encodedPacket.pts = av_rescale_q(encodedPacket.pts, buffersink_ctx -> inputs[0] -> time_base,&#xA;                                                                     out_fmt_ctx -> streams[0] -> time_base);&#xA;                            }&#xA;&#xA;                            if (encodedPacket.dts != AV_NOPTS_VALUE) {&#xA;                                    encodedPacket.dts = av_rescale_q(encodedPacket.dts, buffersink_ctx -> inputs[0] -> time_base,&#xA;                                                                     out_fmt_ctx -> streams[0] -> time_base);&#xA;                            }&#xA;&#xA;                            printf("Encoded packet pts %ld\n", encodedPacket.pts);&#xA;                            /* Write the compressed frame to the media file. */&#xA;                            ret = av_interleaved_write_frame(out_fmt_ctx, &amp;encodedPacket);&#xA;&#xA;                            if (ret &lt; 0) {&#xA;                                    log_averror(ret);&#xA;                                    return -1;&#xA;                            }&#xA;                    } else if (ret &lt; 0) {&#xA;                            log_averror(ret);&#xA;                            return -1;&#xA;                    }&#xA;            }&#xA;&#xA;            /* Write Trailer */&#xA;            av_write_trailer(out_fmt_ctx);&#xA;            avfilter_graph_free(&amp;filter_graph);&#xA;&#xA;            if (dec_ctx)&#xA;                    avcodec_close(dec_ctx);&#xA;&#xA;            avformat_close_input(&amp;in_fmt_ctx);&#xA;            av_frame_free(&amp;pFrame);&#xA;            av_frame_free(&amp;pFrameFiltered);&#xA;&#xA;            if (!(out_fmt_ctx -> oformat -> flags &amp; AVFMT_NOFILE))&#xA;                    avio_close(out_fmt_ctx -> pb);&#xA;            avcodec_close(out_fmt_ctx->streams[0]->codec);&#xA;            avformat_free_context(out_fmt_ctx);&#xA;            return 0;&#xA;    }&#xA;</iostream>

    &#xA;&#xA;

    The audio file after transcoding is same duration as the input. But its completely noisy. Can somebody tell me what I am doing wrong here !

    &#xA;