Advanced search

Medias (1)

Tag: - Tags -/Rennes

Other articles (50)

  • Mise à jour de la version 0.1 vers 0.2

    24 June 2013, by

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1); Installation des dépendances pour Smush; Installation de MediaInfo et FFprobe pour la récupération des métadonnées; On n’utilise plus ffmpeg2theora; On n’installe plus flvtool2 au profit de flvtool++; On n’installe plus ffmpeg-php qui n’est plus maintenu au profit de (...)

  • Support de tous types de médias

    10 April 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...); audio (MP3, Ogg, Wav et autres...); vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...); contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google (...)

  • Supporting all media types

    13 April 2011, by

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats: images: png, gif, jpg, bmp and more audio: MP3, Ogg, Wav and more video: AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data: OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

On other websites (7275)

  • 12 ways Matomo Analytics helps you to protect your visitor’s privacy

    5 May 2020, by InnoCraft — Analytics Tips, Privacy, Security

    This post was originally published on January 11, 2017, and updated on May, 2020.

    At Matomo we think privacy matters. From the beginning, Matomo has had a strong focus on privacy and ensuring the privacy of your visitors and analytics data. 

    Here are some ways how you can ensure your users and visitors privacy by using Matomo (Piwik).

    1. Owning the data gives you power to protect user privacy

    Whether you host Matomo on-premises yourself, or whether you use Matomo’s cloud, YOU keep control of your data and nobody else. By knowing exactly where your data is stored and having full control over what happens to it, you have the power to protect your user’s privacy. No-one else can claim ownership. 

    2. GDPR compliance

    GDPR is one of the most important privacy laws to have come out in the last few years. As such, Matomo takes GDPR compliance very seriously. There’s even a 12-step checklist for you to follow to ensure your Matomo is GDPR compliant. Not only that Matomo is HIPAA, CCPA, LGPD, and PECR compliant.

    3. Data anonymization

    For better privacy by default, Matomo implements a range of data anonymization techniques. One of the main techniques is not recording the full IP address of your visitors. Some countries even require you to anonymize additional info considered Personally Identifiable Information (PII).

    To change the IP anonymization settings go to “Administration > Privacy”. 

    anonymize ip

    4. Configuring Matomo to not process personal data or personally identifiable information (PII)

    To further protect the privacy of your visitors, you can learn how to not process any personal information or PII

    5. Deleting old visitor logs

    The is important because visitor logs contain information all the collected raw data about every visitor and every action. You can configure Matomo to automatically delete logs from the database. When you delete old logs, only the real time and visitor log reports will no longer work for this old time period, all other aggregated reports will still work.

    For privacy reasons, we highly recommend that you keep the detailed Matomo logs for only 3 to 6 months and delete older log data. This has one other nice side effect: it will free significant database space, which will, in turn, slightly increase performance!

    6. Supporting the Do Not Track preference

    Do Not Track enables users to opt out of any tracking by websites they do not visit, including analytics services, advertising networks, and social platforms. By default, Matomo respects users preference and will not track visitors which have specified “I do not want to be tracked” in their web browsers. Get more information about DoNotTrack.

    To make sure Do Not Track is respected, go to “Administration => Privacy”.

    7. Including an Opt-Out Feature on your website or app

    By embedding the Opt-Out feature in your website, you give your visitors the possibility to opt-out of the tracking. When you go to “Administration > Privacy”, you will be able to copy and paste an HTML Iframe code to embed the opt-out feature for example into your privacy policy page or in your ‘Legal’ page. Your users can then click on a link to opt-out.

    On the Matomo Marketplace there are also some plugins available to customize the Opt-Out experience. For example AjaxOptOut and CustomOptOut.

    8. Disabling Live features

    The Real-Time, Visitor Log and Visitor Profile features give you insights into the tracked raw data by showing you details about every visitor and every action they performed. To protect the privacy of your visitors you may decide to prevent access to such features by disabling the “Live” plugin in “Administration => Plugins”. This way only aggregated reports will be shown in your Matomo.

    9. Disabling fingerprinting across websites

    By default, when one of your visitors visits several of your websites, Matomo will create a fingerprint for this user that will be different across the websites to increase the visitors’ privacy. You can make sure that this feature is disabled by going to “Administration => Config file” and verifying that the value of “enable_fingerprinting_across_websites” is set to zero.

    10. Disabling tracking cookies

    Matomo uses first-party cookies to store some information about visitors between visits. In some countries, the legislation requires websites to provide a way for users to opt-out of all tracking, in particular tracking cookies. You can disable cookies by adding one line in the Matomo Javascript code.

    11. Creating the tool of your dreams by developing your own plugins and getting access to the API

    Matomo is an open platform that lets you extend and customise the tracking; reporting; and user interface to your needs and to protect your visitors’ privacy the way you want or need it. Learn more in the Matomo Developer Zone. You may also have a look at our Matomo Marketplace where you can find several free and premium features to extend your Matomo.

    12. Transparency

    By default, all information and all collected data in your Matomo server are protected and nobody can access it. However, Matomo allows you to optionally make your collected data public and you can export any Matomo report including the whole dashboard to embed it into your website. This way you can show your users exactly which information you track. When you decide to make reports public, we do our best to protect privacy and automatically hide any Personally Identifiable Information such as the Visitor Profile and we make sure to not show any Visitor IP address and the Visitor ID.

    Bonus tip – A privacy policy template for you

    When you use Matomo to track your visitors, we recommend you update your Privacy Policy to explain how Matomo is used and what data it gathers. Here’s a Privacy Policy template for you to copy on your site.

    Continuous privacy improvements

    We are always interested in improving the privacy. If you miss any feature or have an idea on how to improve the privacy, please let us know.

    More information about all the Matomo features

    If you want to learn more about all the features in Matomo, have a look at our User Guides and FAQ entries.

  • cmake installation of x265 for ffmpeg on Cygwin - executable location different from other codecs

    6 May, by bballdave025

    TL;DR (with expected vs. real)

    


    For a Cygwin build of ffmpeg, I'm installing x265, and it seems to me that the executable ends up in the wrong place. I'll show some basic directory structure, then I'll show the tree outputs for expected and real, both before and after the cmake installation. For directories where I think this is important, I'll show the outputs before and after the cmake installation.

    


    My question has two parts. I used the following cmake and make commands,

    


    # pwd => $HOME/programs/ffmpeg/ffmpeg_sources/x265/build/linux
PATH="$HOME/programs/ffmpeg/bin:$PATH" \
  cmake -G "Unix Makefiles" \
        -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \
        -DENABLE_SHARED=OFF \
        -DCMAKE_EXE_LINKER_FLAGS="-static" 
            ../../source
PATH="$HOME/programs/ffmpeg/bin:$PATH" make -j $(nproc)
make install


    


    The result is below, with my real vs. expected, and there is a more detailed, more explicit, and hopefully more clear file with the info. at pastebin.com/86wHrtxR.

    


    Edit: I've made a copy of the detailed/explicit/clear file on my GitHub as a gist. This should be more secure. (The Pastebin version still exists, in case that is your preference.)

    


    Now, for my two-part question:

    


      

    1. How can I change my cmake command so that my x265.exe file ends up in $HOME/programs/ffmpeg/bin with the proper linking, rather than $HOME/programs/ffmpeg/ffmpeg_build/bin?

      


    2. 


    3. Would the build/linker/whatever figure things out for the ffmpeg build?

      


    4. 


    


    I want to know the answer to question number 1 regardless of the answer to question number 2. I haven't used cmake with the -DVAR=var flags before, and I'd like to take this opportunity to learn.

    


    For the result:

    


    Things surrounded by double curly brackets are {{ expected }}.

    


    Things surrounded by double angle brackets are << real >>, i.e. they exist after the installation is done.

    


    If real matches expected, and the file/directory is new, I've surrounded it by double parentheses, i.e. double round brackets. (( match ))

    


    If something is not new (and thus has the same before and after) I haven't marked it.

    


       me@MACHINE ~/programs/ffmpeg&#xA;   $ tree --charset=ascii bin&#xA;   bin&#xA;   |-- lame.exe&#xA;   |-- mp3rtp.exe&#xA;   |-- mp3x.exe&#xA;   `-- x264.exe&#xA;{{ `-- x265.exe                     }} ## Expected, not Exists&#xA;&#xA;   me@MACHINE ~/programs/ffmpeg&#xA;   $ tree --charset=ascii \&#xA;                   ffmpeg_build&#xA;   ffmpeg_build&#xA;&lt;&lt; |-- bin                          >> ## Not expected, Exists&#xA;&lt;&lt; |   `-- x265.exe                 >> ## Not expected, Exists&#xA;   |-- include&#xA;   |   |-- fdk-aac&#xA;   |   |   |-- aacdecoder_lib.h&#xA;   |   |   |-- aacenc_lib.h&#xA;   |   |   `-- ... <more files="files">&#xA;   |   |-- lame&#xA;   |   |   `-- lame.h&#xA;   |   |-- x264.h&#xA;   |   `-- x264_config.h&#xA;(( |   |-- x265.h                   )) ## Expected and Exists&#xA;(( |   `-- x265_config.h            )) ## Expected and Exists&#xA;   |-- lib&#xA;   |   |-- libfdk-aac.a&#xA;   |   |-- libfdk-aac.la&#xA;   |   |-- libmp3lame.a&#xA;   |   |-- libmp3lame.la&#xA;(( |   |-- libx265.a                )) ## Expected and Exists&#xA;   |   `-- pkgconfig&#xA;   |       |-- fdk-aac.pc&#xA;   |       `-- x264.pc&#xA;(( |       `-- x265.pc              )) ## Expected and Exists&#xA;   `-- share&#xA;       |-- doc&#xA;       |   ... <only lame="lame">&#xA;       `-- man&#xA;           ... <only lame="lame">&#xA;</only></only></more>

    &#xA;

    Other, possibly useful information about the build directory structure.

    &#xA;

    me@MACHINE ~/programs/ffmpeg&#xA;$ tree --charset=ascii -L 1 .&#xA;.&#xA;|-- bin&#xA;|-- ffmpeg_build&#xA;`-- ffmpeg_sources&#xA;&#xA;3 directories, 0 files&#xA;

    &#xA;

    For this next, ffmpeg_sources dir, I'm showing the after (which is both expected and real/exists) surrounded by double parentheses, i.e. double round brackets, (( <after> ))</after>.

    &#xA;

       me@MACHINE ~/programs/ffmpeg&#xA;   $ tree --charset=ascii -L 1 ffmpeg_sources&#xA;   ffmpeg_sources&#xA;   |-- fdk-aac.zip&#xA;   |-- lame-svn&#xA;   |-- mstorsjo-fdk-aac-e7d8591&#xA;   |-- x264-snapshot-20191217-2245&#xA;   |-- x264-snapshot-20191217-2245.tar.bz2&#xA;   `-- x264-snapshot-20191218-README.txt&#xA;(( `-- x265                         ))&#xA;&#xA;   3 directories, 3 files&#xA;(( 4 directories, 3 files ))&#xA;

    &#xA;


    &#xA;

    NOW, FOR SOME MORE DETAIL

    &#xA;


    &#xA;

    What I'm Doing

    &#xA;

    I am working on a Cygwin build (vs. a Windows/mingw build) of ffmpeg. I am following an older guide by koohiimaster (archived). That guide says,

    &#xA;

    &#xA;

    [W]e are not cross-compiling for windows; we are compiling for Cygwin.

    &#xA;

    &#xA;

    This 2014 guide doesn't have all of the codecs I want - I want as complete a build as possible - so I've also been referring to this ffmpeg-for-Ubuntu guide (archived), which I hope is kept up-to-date. It's referred to by koohiimaster.

    &#xA;

    Also, as a way of checking that I'm getting all the codecs I want, I've been looking at this FFmpeg for Windows guide from SuperUser

    &#xA;

    I'll give the basics of my steps below. More details, as well as all the output is at pastebin.com/suL1nU6Z.

    &#xA;

    Edit: I've put the log of terminal input/output for all my steps into a gist at my GitHub as this seems safer than Pastebin.

    &#xA;

    A look at directory structure for the build

    &#xA;

    me@MACHINE ~/programs/ffmpeg&#xA;$ cd $HOME/programs/ffmpeg&#xA;&#xA;me@MACHINE ~/programs/ffmpeg&#xA;$ tree --charset=ascii -d -L 1&#xA;.&#xA;|-- bin&#xA;|-- ffmpeg_build&#xA;`-- ffmpeg_sources&#xA;&#xA;3 directories&#xA;

    &#xA;

    Getting the source. Note that I had to apt-cyg install mercurial, though (with my Cygwin setup GUI/EXE in my Cygwin root directory, i.e. C:\cygwin64\setup-x86_64.exe), I could also have done /setup-x86_64.exe install -q -P mercurial.

    &#xA;

    cd ffmpeg_sources&#xA;hg clone https://bitbucket.org/multicoreware/x265&#xA;

    &#xA;

    Running the cmake and make commands

    &#xA;

    cd x265/build/linux&#xA;PATH="$HOME/programs/ffmpeg/bin:$PATH" \&#xA;  cmake -G "Unix Makefiles" \&#xA;        -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \&#xA;        -DENABLE_SHARED=OFF \&#xA;        -DCMAKE_EXE_LINKER_FLAGS="-static" \&#xA;            ../../source&#xA;PATH="$HOME/programs/ffmpeg/bin:$PATH" make -j $(nproc)&#xA;make install&#xA;

    &#xA;

    It was the last part (actually the very last line) of the make install output that worried me. Here is the whole output - it's not very long.

    &#xA;

    make[1]: Entering directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;make[2]: Entering directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;make[2]: Leaving directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;[ 20%] Built target encoder&#xA;make[2]: Entering directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;make[2]: Leaving directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;[ 83%] Built target common&#xA;make[2]: Entering directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;make[2]: Leaving directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;[ 84%] Built target x265-static&#xA;make[2]: Entering directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;make[2]: Leaving directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;[100%] Built target cli&#xA;make[1]: Leaving directory &#x27;/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux&#x27;&#xA;Install the project...&#xA;-- Install configuration: "Release"&#xA;-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/lib/libx265.a&#xA;-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/include/x265.h&#xA;-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/include/x265_config.h&#xA;-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/lib/pkgconfig/x265.pc&#xA;-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/bin/x265.exe&#xA;

    &#xA;

    As discussed in the TL;DR section, I expected to see x265.exe at

    &#xA;

    home/me/programs/ffmpeg/bin/x265.exe

    &#xA;

    rather than the path given on the last line of output,

    &#xA;

    /home/me/programs/ffmpeg/ffmpeg_build/bin/x265.exe

    &#xA;

    This worries me especially because the first part of the ffmpeg install command that my instructions inform me to run is

    &#xA;

    PATH="$HOME/programs/ffmpeg/bin:$PATH" \&#xA;PKG_CONFIG_PATH="$HOME/programs/ffmpeg/ffmpeg_build/lib/pkgconfig" \&#xA;  ./configure \&#xA;    --prefix="$HOME/programs/ffmpeg/ffmpeg_build" \&#xA;    --extra-cflags="-I$HOME/programs/ffmpeg/ffmpeg_build/include" \&#xA;    --extra-ldflags="-L$HOME/programs/ffmpeg/ffmpeg_build/lib" \&#xA;    --bindir="$HOME/programs/ffmpeg/bin" \&#xA;

    &#xA;

       ... and on it goes ...

    &#xA;

    It would seem to me that the .configure script for ffmpeg won't find the x265 executable, since it's not in the bindir.

    &#xA;

    I'll repeat my two-part question from before:

    &#xA;

      &#xA;
    1. How can I change my cmake command so that my x265.exe file ends up in $HOME/programs/ffmpeg/bin with the proper linking, rather than $HOME/programs/ffmpeg/ffmpeg_build/bin?
    2. &#xA;

    &#xA;

    What I'm looking for here is something akin to the --bindir flag from make's ./confiure.

    &#xA;

      &#xA;
    1. Would the build/linker/whatever figure things out for the ffmpeg build?
    2. &#xA;

    &#xA;

    I want to know the answer to question number 1 regardless of the answer to question number 2. I haven't used cmake with the -DVAR=var flags before, and I'd like to take this opportunity to learn.

    &#xA;


    &#xA;

    Where I've Looked & What I've Tried

    &#xA;

    I first started with the man page and the --help for cmake. That was scary. I was hoping that I'd find something useful around the CMAKE_INSTALL_PREFIX stuff, but I wasn't sure what to make of it.

    &#xA;

    I tried greping through cmake --help-full (with 50 lines before and after whatever I was searching for), but got tripped up by the complexity. I've only used basic cmake stuff, before, and I got more than a little lost.

    &#xA;

    Even with the --help, I don't know if I need to look at the help-manual, the help-command, the help-module, the help-policy, the help-variable, or something else.

    &#xA;

    It seemed to me, in reading, that a "binary directory" is the top of the "build", whereas I thought it would be the dir named bin ... I couldn't tell what things were meant to be used by the person creating the package rather than by me, who am trying to make/build the package from the command line.

    &#xA;

    I looked through what seemed to be a cmake wiki's Useful Variables page (archived), as well as at this thread at cmake.org (archived), which, along with this SO source and this and this and this and this SO sources, seemed to suggest using the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable (since the EXECUTABLE_OUTPUT-DIRECTORY variable has been superseded by it). By the way, I couldn't tell which things should be used by the creator of the package vs. the consumer of the package - the consumer being me. I tried with

    &#xA;

    PATH="$HOME/programs/ffmpeg/bin:$PATH" \&#xA;  cmake -G "Unix Makefiles" \&#xA;        -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \&#xA;        -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="$HOME/programs/ffmpeg/bin" \&#xA;        -DENABLE_SHARED=OFF \&#xA;        -DCMAKE_EXE_LINKER_FLAGS="-static" &#xA;            ../../source&#xA;PATH="$HOME/&#xA;

    &#xA;

    and have thought about fifty-or-so other -DVAR variables, but with any I have tried, I still get the same result. I still get the executable in what seems to be the wrong place.

    &#xA;


    &#xA;

    System Details

    &#xA;

    $ date &amp;&amp; date &#x2B;&#x27;%s&#x27;&#xA;Tue, May  5, 2020 11:14:40 AM&#xA;1588698880&#xA;$ uname -a&#xA;CYGWIN_NT-10.0 MACHINE 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin&#xA;$ cmake --version&#xA;cmake version 3.14.5&#xA;&#xA;CMake suite maintained and supported by Kitware (kitware.com/cmake).&#xA;$ bash --version | head -n 1&#xA;GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)&#xA;$ gcc --version | head -n 1&#xA;gcc (GCC) 9.3.0&#xA;$ g&#x2B;&#x2B; --version | head -n 1&#xA;g&#x2B;&#x2B; (GCC) 9.3.0&#xA;$ make --version | head -n 2&#xA;GNU Make 4.3&#xA;Built for x86_64-pc-cygwin&#xA;

    &#xA;

  • FFmpeg Opus choppy sound UPDATED DESCRIPTION

    2 June 2020, by easy_breezy

    I'm using FFmpeg and try to encode and decode a raw PCM sound to Opus using a built-in FFmpeg "opus" codec. My input samples are raw PCM 8000 Hz 16 bit mono, in AV_SAMPLE_FMT_S16 format. Since Opus requires sample format AV_SAMPLE_FMT_FLTP and sample rate 48000 Hz only, so I resample my samples before encode them.

    &#xA;&#xA;

    I have two instances of ResamplerAudio class that does the work of resampling audio samples and has a member of SwrContext, I use the first instance of ResamplerAudio for resampling a raw PCM input audio before encoding and the second for resampling decoded audio to get it's format and sample rate the same as source values of input raw audio.

    &#xA;&#xA;

    ResamplerAudio class has a function that init it's SwrContext member like this:

    &#xA;&#xA;

    void ResamplerAudio::init(AVCodecContext *codecContext, int inSampleRate, int outSampleRate, AVSampleFormat inSampleFmt, AVSampleFormat outSampleFmt)&#xA;{&#xA;    swrContext = swr_alloc();&#xA;    if (!swrContext)&#xA;    {&#xA;        LOGE(TAG, "[init] Couldn&#x27;t allocate swr context");&#xA;        return;&#xA;    }&#xA;&#xA;    av_opt_set_int(swrContext, "in_channel_layout", (int64_t) codecContext->channel_layout, 0);&#xA;    av_opt_set_int(swrContext, "out_channel_layout", (int64_t) codecContext->channel_layout,  0);&#xA;&#xA;    av_opt_set_int(swrContext, "in_channel_count", codecContext->channels, 0);&#xA;    av_opt_set_int(swrContext, "out_channel_count", codecContext->channels, 0);&#xA;&#xA;    av_opt_set_int(swrContext, "in_sample_rate", inSampleRate, 0);&#xA;    av_opt_set_int(swrContext, "out_sample_rate", outSampleRate, 0);&#xA;&#xA;    av_opt_set_sample_fmt(swrContext, "in_sample_fmt", inSampleFmt, 0);&#xA;    av_opt_set_sample_fmt(swrContext, "out_sample_fmt", outSampleFmt,  0);&#xA;&#xA;    int ret = swr_init(swrContext);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        LOGE(TAG, "[init] swr_init error: %s", av_err2str(ret));&#xA;        return;&#xA;    }&#xA;&#xA;    LOGD(TAG, "[init] success codecContext->channel_layout: %d; inSampleRate: %d; outSampleRate: %d; inSampleFmt: %d; outSampleFmt: %d", (int) codecContext->channel_layout, inSampleRate, outSampleRate, inSampleFmt, outSampleFmt);&#xA;}&#xA;

    &#xA;&#xA;

    And I call ResamplerAudio::init function for the first instance of ResamplerAudio (this instance do resamping a raw PCM input audio before encoding and I called it resamplerEncoder) with the following args:

    &#xA;&#xA;

    resamplerEncoder->init(contextEncoder, 8000, 48000, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP);&#xA;

    &#xA;&#xA;

    The second instance of ResamplerAudio (this instance do resamping after decoding audio from Opus and I called it resamplerDecoder) I init with the following args:

    &#xA;&#xA;

    resamplerDecoder->init(contextDecoder, 48000, 8000, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16);&#xA;

    &#xA;&#xA;

    The function of ResamplerAudio that does resampling looks like this:

    &#xA;&#xA;

    std::vector ResamplerAudio::convert(uint8_t **inData, int inSamplesCount, int outChannels, int outFormat)&#xA;{&#xA;    std::vector result;&#xA;    uint8_t *dstData = NULL;&#xA;    const int dstNbSamples = swr_get_out_samples(swrContext, inSamplesCount);&#xA;    av_samples_alloc(&amp;dstData, NULL, outChannels, dstNbSamples, AVSampleFormat(outFormat), 1);&#xA;    int resampledSize = swr_convert(swrContext, &amp;dstData, dstNbSamples, (const uint8_t **)inData, inSamplesCount);&#xA;    int dstBufSize = av_samples_get_buffer_size(NULL, outChannels, resampledSize, AVSampleFormat(outFormat), 1);&#xA;&#xA;    if (dstBufSize &lt;= 0) return result;&#xA;&#xA;    std::copy(&amp;dstData[0], &amp;dstData[dstBufSize], std::back_inserter(result));&#xA;&#xA;    return result;&#xA;}&#xA;

    &#xA;&#xA;

    And I call ResamplerAudio::convert function before encoding with the following args:

    &#xA;&#xA;

    // data - an array of raw pcm audio&#xA;// dataLength - the length of data array&#xA;// getSamplesCount() - function that calculates samples count&#xA;// frameEncode - AVFrame that using for encode audio&#xA;std::vector resampledData = resamplerEncoder->convert(&amp;data, getSamplesCount(dataLength, frameEncode->channels, AV_SAMPLE_FMT_S16), frameEncode->channels, frameEncode->format);&#xA;

    &#xA;&#xA;

    getSamplesCount() function looks like this:

    &#xA;&#xA;

    getSamplesCount(int bytesCount, int channels, AVSampleFormat format)&#xA;{&#xA;    return bytesCount / av_get_bytes_per_sample(format) / channels;&#xA;}&#xA;

    &#xA;&#xA;

    After that I fill my frameEncode with resampled samples:

    &#xA;&#xA;

    memcpy(&amp;frame->data[0][0], &amp;resampledData[0], sizeof(uint8_t) * resampledDataLength);&#xA;

    &#xA;&#xA;

    And pass frameEncode to encoding like this encodeFrame(resampledDataLength):

    &#xA;&#xA;

    void encodeFrame(int dataLength)&#xA;{&#xA;    /* send the frame for encoding */&#xA;    int ret = avcodec_send_frame(contextEncoder, frameEncode);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        LOGE(TAG, "[encodeFrame] avcodec_send_frame error: %s", av_err2str(ret));&#xA;        return;&#xA;    }&#xA;&#xA;    /* read all the available output packets (in general there may be any number of them */&#xA;    while (ret >= 0)&#xA;    {&#xA;        ret = avcodec_receive_packet(contextEncoder, packetEncode);&#xA;        if (ret &lt; 0 &amp;&amp; ret != AVERROR(EAGAIN)) LOGE(TAG, "[encodeFrame] error in avcodec_receive_packet: %s", av_err2str(ret));&#xA;        if (ret &lt; 0) break;&#xA;&#xA;        // encodedData - std::vector that stores encoded data&#xA;        std::copy(&amp;packetEncode->data[0], &amp;packetEncode->data[dataLength], std::back_inserter(encodedData));&#xA;        av_packet_unref(packetEncode);&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    Then I decode my encoded samples and do resampling to get back them in source sample format and sample rate so I call ResamplerAudio::convert function for resamplerDecoder with the following args:

    &#xA;&#xA;

    // frameDecode - AVFrame that holds decoded audio&#xA;std::vector resampledData = resamplerDecoder->convert(frameDecode->data, frameDecode->nb_samples, frameDecode->channels, AV_SAMPLE_FMT_S16);&#xA;

    &#xA;&#xA;

    And result sound is choppy and I also noticed that the decoded array size is bigger than the source array size with raw pcm audio.

    &#xA;&#xA;

    Please any ideas what I'm doing wrong?

    &#xA;&#xA;

    UPD 18.05.2020

    &#xA;&#xA;

    I tested my resampling logic, I did resampling of raw pcm sound without any encoding and decoding routines. First I tried to convert the sample rate of input sound from 8000 Hz to 48000 Hz than I took resampled samples from step above and convert it's sample rate from 48000 Hz to 8000 Hz and the result sound is perfect and clean, also I did the same steps but I converted not a sample rate but a sample format from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLTP and vice versa and again the result sound is perfect and clean, also I got the same result when I coverted both a sample rate and a sample format.&#xA;So I assume that the problem of distorted and choppy sound is in my encoding or decoding routine, I think most likely in decoding routine because after decoding I ALWAYS get AVFrame with 960 nb_samples despite what was the size of input sound.

    &#xA;&#xA;

    My decoding routine looks like this:

    &#xA;&#xA;

    std::vector decode(uint8_t *data, unsigned int dataLength)&#xA;{&#xA;    decodedData.clear();&#xA;&#xA;    int dataSize = dataLength;&#xA;&#xA;    while (dataSize > 0)&#xA;    {&#xA;        if (!frameDecode)&#xA;        {&#xA;            frameDecode = av_frame_alloc();&#xA;            if (!frameDecode)&#xA;            {&#xA;                LOGE(TAG, "[decode] Couldn&#x27;t allocate the frame");&#xA;                return EMPTY_DATA;&#xA;            }&#xA;        }&#xA;&#xA;        ret = av_parser_parse2(parser, contextDecoder, &amp;packetDecode->data, &amp;packetDecode->size, &amp;data[0], dataSize, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);&#xA;        if (ret &lt; 0) {&#xA;            LOGE(TAG, "[decode] av_parser_parse2 error: %s", av_err2str(ret));&#xA;            return EMPTY_DATA;&#xA;        }&#xA;&#xA;        data &#x2B;= ret;&#xA;        dataSize -= ret;&#xA;&#xA;        doDecode();&#xA;    }&#xA;    return decodedData;&#xA;}&#xA;&#xA;void doDecode()&#xA;{&#xA;    if (packetDecode->size) {&#xA;        /* send the packet with the compressed data to the decoder */&#xA;        int ret = avcodec_send_packet(contextDecoder, packetDecode);&#xA;        if (ret &lt; 0) LOGE(TAG, "[decode] avcodec_send_packet error: %s", av_err2str(ret));&#xA;&#xA;        /* read all the output frames (in general there may be any number of them */&#xA;        while (ret >= 0)&#xA;        {&#xA;            ret = avcodec_receive_frame(contextDecoder, frameDecode);&#xA;            if (ret &lt; 0 &amp;&amp; ret != AVERROR(EAGAIN) &amp;&amp; ret != AVERROR_EOF) LOGE(TAG, "[decode] avcodec_receive_frame error: %s", av_err2str(ret));&#xA;            if (ret &lt; 0) break;&#xA;&#xA;            std::vector resampledData = resamplerDecoder->convert(frameDecode->data, frameDecode->nb_samples, frameDecode->channels, AV_SAMPLE_FMT_S16);&#xA;            if (!resampledData.size()) continue;&#xA;            std::copy(&amp;resampledData.data()[0], &amp;resampledData.data()[resampledData.size()], std::back_inserter(decodedData));&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    UPD 30.05.2020

    &#xA;&#xA;

    I decided to refuse to use FFmpeg in my project and use libopus 1.3.1 instead, so I made a wrapper around it and it works fine.

    &#xA;