Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (56)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (7759)

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

    5 mai 2020, par 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.

  • MP4 Created Using FFmpeg API Can't Be Played in Media Players

    11 avril 2020, par RandyCroucher

    I've been struggling with this issue for days. There are similar issues posted here and around the web, but none of the solutions seem to work for me. They are possibly outdated ?

    



    Here is the current iteration of code I'm using to generate the MP4 file.

    



    It generates a simple 2 second .mp4 file that fails to play in any player I've tried. If I run that mp4 file back through the FFmpeg command line, it will generate a perfectly playable movie out of it. So the data is there.

    



    Also, if you modify the output file name in this code from .mp4 to .avi, this code generates a playable avi file too. So whatever it is, it is tied to the H.264 format.

    



    I'm sure I'm missing something simple, but for the life of me, I can't figure out what that is.

    



    Any help would be greatly appreciated !

    



    Here is a link to the VC++ project. MovieMaker.zip

    



    MovieMaker.h

    



    #pragma once&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;}&#xA;&#xA;class FMovieMaker&#xA;{&#xA;public:&#xA;    ~FMovieMaker();&#xA;&#xA;    bool Initialize(const char* FileName, int Width = 1920, int Height = 1080, int FPS = 30, int BitRate = 2000);&#xA;    bool RecordFrame(uint8_t* BGRAData);&#xA;    bool Finalize();&#xA;&#xA;    bool IsInitialized() const { return bInitialized; }&#xA;    int GetWidth() const { return CodecContext ? CodecContext->width : 0; }&#xA;    int GetHeight() const { return CodecContext ? CodecContext->height : 0; }&#xA;&#xA;private:&#xA;    bool EncodeFrame(bool bFinalize);&#xA;    void Log(const char* fmt, ...);&#xA;&#xA;    AVOutputFormat* OutputFormat = nullptr;&#xA;    AVFormatContext* FormatContext = nullptr;&#xA;    AVCodecContext* CodecContext = nullptr;&#xA;    AVFrame* Frame = nullptr;&#xA;    SwsContext* ColorConverter = nullptr;&#xA;    int64_t RecordedFrames = 0;&#xA;    bool bInitialized = false;&#xA;};&#xA;

    &#xA;&#xA;

    MovieMaker.cpp

    &#xA;&#xA;

    #include "MovieMaker.h"&#xA;&#xA;FMovieMaker::~FMovieMaker()&#xA;{&#xA;    if (IsInitialized())&#xA;        Finalize();&#xA;}&#xA;&#xA;bool FMovieMaker::Initialize(const char* FileName, int Width /*= 1920*/, int Height /*= 1080*/, int FPS /*= 30*/, int BitRate /*= 2000*/)&#xA;{&#xA;    OutputFormat = av_guess_format(nullptr, FileName, nullptr);&#xA;    if (!OutputFormat)&#xA;    {&#xA;        Log("Couldn&#x27;t guess the output format from the filename: %s", FileName);&#xA;        return false;&#xA;    }&#xA;&#xA;    AVCodecID CodecID = OutputFormat->video_codec;&#xA;    if (CodecID == AV_CODEC_ID_NONE)&#xA;    {&#xA;        Log("Could not determine a codec to use");&#xA;        return false;&#xA;    }&#xA;&#xA;    /* allocate the output media context */&#xA;    int ErrorCode = avformat_alloc_output_context2(&amp;FormatContext, OutputFormat, nullptr, FileName);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to allocate format context: %s", Error);&#xA;        return false;&#xA;    }&#xA;    else if (!FormatContext)&#xA;    {&#xA;        Log("Failed to get format from filename: %s", FileName);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* find the video encoder */&#xA;    const AVCodec* Codec = avcodec_find_encoder(CodecID);&#xA;    if (!Codec)&#xA;    {&#xA;        Log("Codec &#x27;%d&#x27; not found", CodecID);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* create the video stream */&#xA;    AVStream* Stream = avformat_new_stream(FormatContext, Codec);&#xA;    if (!Stream)&#xA;    {&#xA;        Log("Failed to allocate stream");&#xA;        return false;&#xA;    }&#xA;&#xA;    /* create the codec context */&#xA;    CodecContext = avcodec_alloc_context3(Codec);&#xA;    if (!CodecContext)&#xA;    {&#xA;        Log("Could not allocate video codec context");&#xA;        return false;&#xA;    }&#xA;&#xA;    Stream->codecpar->codec_id = OutputFormat->video_codec;&#xA;    Stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    Stream->codecpar->width = Width;&#xA;    Stream->codecpar->height = Height;&#xA;    Stream->codecpar->format = AV_PIX_FMT_YUV420P;&#xA;    Stream->codecpar->bit_rate = (int64_t)BitRate * 1000;&#xA;    avcodec_parameters_to_context(CodecContext, Stream->codecpar);&#xA;&#xA;    CodecContext->time_base = { 1, FPS };&#xA;    CodecContext->max_b_frames = 2;&#xA;    CodecContext->gop_size = 12;&#xA;    CodecContext->framerate = { FPS, 1 };&#xA;&#xA;    if (Stream->codecpar->codec_id == AV_CODEC_ID_H264)&#xA;        av_opt_set(CodecContext, "preset", "medium", 0);&#xA;    else if (Stream->codecpar->codec_id == AV_CODEC_ID_H265)&#xA;        av_opt_set(CodecContext, "preset", "medium", 0);&#xA;&#xA;    avcodec_parameters_from_context(Stream->codecpar, CodecContext);&#xA;&#xA;    if (FormatContext->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;        CodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;&#xA;    if ((ErrorCode = avcodec_open2(CodecContext, Codec, NULL)) &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to open codec: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    if (!(OutputFormat->flags &amp; AVFMT_NOFILE))&#xA;    {&#xA;        if ((ErrorCode = avio_open(&amp;FormatContext->pb, FileName, AVIO_FLAG_WRITE)) &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Failed to open file: %s", Error);&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    Stream->time_base = CodecContext->time_base;&#xA;    if ((ErrorCode = avformat_write_header(FormatContext, NULL)) &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Failed to write header: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    CodecContext->time_base = Stream->time_base;&#xA;&#xA;    av_dump_format(FormatContext, 0, FileName, 1);&#xA;&#xA;    // create the frame&#xA;    {&#xA;        Frame = av_frame_alloc();&#xA;        if (!Frame)&#xA;        {&#xA;            Log("Could not allocate video frame");&#xA;            return false;&#xA;        }&#xA;        Frame->format = CodecContext->pix_fmt;&#xA;        Frame->width = CodecContext->width;&#xA;        Frame->height = CodecContext->height;&#xA;&#xA;        ErrorCode = av_frame_get_buffer(Frame, 32);&#xA;        if (ErrorCode &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Could not allocate the video frame data: %s", Error);&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    // create a color converter&#xA;    {&#xA;        ColorConverter = sws_getContext(CodecContext->width, CodecContext->height, AV_PIX_FMT_BGRA,&#xA;                                        CodecContext->width, CodecContext->height, AV_PIX_FMT_YUV420P, 0, 0, 0, 0);&#xA;        if (!ColorConverter)&#xA;        {&#xA;            Log("Could not allocate color converter");&#xA;            return false;&#xA;        }&#xA;    }&#xA;&#xA;    bInitialized = true;&#xA;    return true;&#xA;}&#xA;&#xA;bool FMovieMaker::RecordFrame(uint8_t* BGRAData)&#xA;{&#xA;    if (!bInitialized)&#xA;    {&#xA;        Log("Cannot record frames on an uninitialized Video Recorder");&#xA;        return false;&#xA;    }&#xA;&#xA;    /*make sure the frame data is writable */&#xA;    int ErrorCode = av_frame_make_writable(Frame);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Could not make the frame writable: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    /* convert the bgra bitmap data into yuv frame data */&#xA;    int inLinesize[1] = { 4 * CodecContext->width }; // RGB stride&#xA;    sws_scale(ColorConverter, &amp;BGRAData, inLinesize, 0, CodecContext->height, Frame->data, Frame->linesize);&#xA;&#xA;    //Frame->pts = RecordedFrames&#x2B;&#x2B;;&#xA;    Frame->pts = CodecContext->time_base.den / CodecContext->time_base.num * CodecContext->framerate.den / CodecContext->framerate.num * (RecordedFrames&#x2B;&#x2B;);&#xA;    //The following assumes that codecContext->time_base = (AVRational){1, 1};&#xA;    //Frame->pts = frameduration * (RecordedFrames&#x2B;&#x2B;) * Stream->time_base.den / (Stream->time_base.num * fps);&#xA;    //Frame->pts &#x2B;= av_rescale_q(1, CodecContext->time_base, Stream->time_base);&#xA;&#xA;    return EncodeFrame(false);&#xA;}&#xA;&#xA;bool FMovieMaker::EncodeFrame(bool bFinalize)&#xA;{&#xA;    /* send the frame to the encoder */&#xA;    int ErrorCode = avcodec_send_frame(CodecContext, bFinalize ? nullptr : Frame);&#xA;    if (ErrorCode &lt; 0)&#xA;    {&#xA;        char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;        av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;        Log("Error sending a frame for encoding: %s", Error);&#xA;        return false;&#xA;    }&#xA;&#xA;    AVPacket Packet;&#xA;    av_init_packet(&amp;Packet);&#xA;    Packet.data = NULL;&#xA;    Packet.size = 0;&#xA;    Packet.flags |= AV_PKT_FLAG_KEY;&#xA;    Packet.pts = Frame->pts;&#xA;&#xA;    if (avcodec_receive_packet(CodecContext, &amp;Packet) == 0)&#xA;    {&#xA;        //std::cout &lt;&lt; "pkt key: " &lt;&lt; (Packet.flags &amp; AV_PKT_FLAG_KEY) &lt;&lt; " " &lt;&lt; Packet.size &lt;&lt; " " &lt;&lt; (counter&#x2B;&#x2B;) &lt;&lt; std::endl;&#xA;        uint8_t* size = ((uint8_t*)Packet.data);&#xA;        //std::cout &lt;&lt; "first: " &lt;&lt; (int)size[0] &lt;&lt; " " &lt;&lt; (int)size[1] &lt;&lt; " " &lt;&lt; (int)size[2] &lt;&lt; " " &lt;&lt; (int)size[3] &lt;&lt; " " &lt;&lt; (int)size[4] &lt;&lt; " " &lt;&lt; (int)size[5] &lt;&lt; " " &lt;&lt; (int)size[6] &lt;&lt; " " &lt;&lt; (int)size[7] &lt;&lt; std::endl;&#xA;&#xA;        av_interleaved_write_frame(FormatContext, &amp;Packet);&#xA;        av_packet_unref(&amp;Packet);&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool FMovieMaker::Finalize()&#xA;{&#xA;    if (!bInitialized)&#xA;    {&#xA;        Log("Cannot finalize uninitialized Video Recorder");&#xA;        return false;&#xA;    }&#xA;&#xA;    //DELAYED FRAMES&#xA;    AVPacket Packet;&#xA;    av_init_packet(&amp;Packet);&#xA;    Packet.data = NULL;&#xA;    Packet.size = 0;&#xA;&#xA;    for (;;)&#xA;    {&#xA;        avcodec_send_frame(CodecContext, NULL);&#xA;        if (avcodec_receive_packet(CodecContext, &amp;Packet) == 0)&#xA;        {&#xA;            av_interleaved_write_frame(FormatContext, &amp;Packet);&#xA;            av_packet_unref(&amp;Packet);&#xA;        }&#xA;        else&#xA;            break;&#xA;    }&#xA;&#xA;    av_write_trailer(FormatContext);&#xA;    if (!(OutputFormat->flags &amp; AVFMT_NOFILE))&#xA;    {&#xA;        int ErrorCode = avio_close(FormatContext->pb);&#xA;        if (ErrorCode &lt; 0)&#xA;        {&#xA;            char Error[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(Error, AV_ERROR_MAX_STRING_SIZE, ErrorCode);&#xA;            Log("Failed to close file: %s", Error);&#xA;        }&#xA;    }&#xA;&#xA;    if (Frame)&#xA;    {&#xA;        av_frame_free(&amp;Frame);&#xA;        Frame = nullptr;&#xA;    }&#xA;&#xA;    if (CodecContext)&#xA;    {&#xA;        avcodec_free_context(&amp;CodecContext);&#xA;        CodecContext = nullptr;&#xA;    }&#xA;&#xA;    if (FormatContext)&#xA;    {&#xA;        avformat_free_context(FormatContext);&#xA;        FormatContext = nullptr;&#xA;    }&#xA;&#xA;    if (ColorConverter)&#xA;    {&#xA;        sws_freeContext(ColorConverter);&#xA;        ColorConverter = nullptr;&#xA;    }&#xA;&#xA;    bInitialized = false;&#xA;    return true;&#xA;}&#xA;&#xA;void FMovieMaker::Log(const char* fmt, ...)&#xA;{&#xA;    va_list args;&#xA;    fprintf(stderr, "LOG: ");&#xA;    va_start(args, fmt);&#xA;    vfprintf(stderr, fmt, args);&#xA;    va_end(args);&#xA;    fprintf(stderr, "\n");&#xA;}&#xA;

    &#xA;&#xA;

    Main.cpp

    &#xA;&#xA;

    #include "MovieMaker.h"&#xA;&#xA;uint8_t FtoB(float x)&#xA;{&#xA;    if (x &lt;= 0.0f)&#xA;        return 0;&#xA;    if (x >= 1.0f)&#xA;        return 255;&#xA;    else&#xA;        return (uint8_t)(x * 255.0f);&#xA;}&#xA;&#xA;void SetPixelColor(float X, float Y, float Width, float Height, float t, uint8_t* BGRA)&#xA;{&#xA;    t &#x2B;= 12.0f; // more interesting colors at this time&#xA;&#xA;    float P[2] = { 0.1f * X - 25.0f, 0.1f * Y - 25.0f };&#xA;    float V = sqrtf(P[0] * P[0] &#x2B; P[1] * P[1]);&#xA;    BGRA[0] = FtoB(sinf(V &#x2B; t / 0.78f));&#xA;    BGRA[1] = FtoB(sinf(V &#x2B; t / 10.0f));&#xA;    BGRA[2] = FtoB(sinf(V &#x2B; t / 36e2f));&#xA;    BGRA[3] = 255;&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    FMovieMaker MovieMaker;&#xA;&#xA;    const char* FileName = "C:\\ffmpeg\\MyMovieMakerMovie.mp4";&#xA;    int Width = 640;&#xA;    int Height = 480;&#xA;    int FPS = 30;&#xA;    int BitRateKBS = 2000;&#xA;&#xA;    if (MovieMaker.Initialize(FileName, Width, Height, FPS, BitRateKBS))&#xA;    {&#xA;        int Size = Width * 4 * Height;&#xA;        uint8_t* BGRAData = new uint8_t[Size];&#xA;        memset(BGRAData, 255, Size);&#xA;&#xA;        for (float Frame = 0; Frame &lt; 60; Frame&#x2B;&#x2B;)&#xA;        {&#xA;            // fill the image data with something interesting&#xA;            for (float Y = 0; Y &lt; Height; Y&#x2B;&#x2B;)&#xA;            {&#xA;                for (float X = 0; X &lt; Width; X&#x2B;&#x2B;)&#xA;                {&#xA;                    SetPixelColor(X, Y, (float)Width, (float)Height, Frame / (float)FPS, &amp;BGRAData[(int)(Y * Width &#x2B; X) * 4]);&#xA;                }&#xA;            }&#xA;&#xA;            if (!MovieMaker.RecordFrame(BGRAData))&#xA;                break;&#xA;        }&#xA;&#xA;        delete[] BGRAData;&#xA;&#xA;        MovieMaker.Finalize();&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    If I have the lines that add the AV_CODEC_FLAG_GLOBAL_HEADER flag like shown above, I get all sorts of issues in the output from ffprobe MyMovieMakerMovie.mp4.

    &#xA;&#xA;

    C:\ffmpeg>ffprobe MyMovieMakerMovie.mp4&#xA;ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;[h264 @ 000001d44b795b00] non-existing PPS 0 referenced&#xA;[h264 @ 000001d44b795b00] decode_slice_header error&#xA;[h264 @ 000001d44b795b00] no frame!&#xA;...&#xA;[h264 @ 000001d44b795b00] non-existing PPS 0 referenced&#xA;[h264 @ 000001d44b795b00] decode_slice_header error&#xA;[h264 @ 000001d44b795b00] no frame!&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000001d44b783880] decoding for stream 0 failed&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000001d44b783880] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 640x480, 20528 kb/s): unspecified pixel format&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;MyMovieMakerMovie.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.29.100&#xA;  Duration: 00:00:01.97, start: 0.000000, bitrate: 20529 kb/s&#xA;    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 640x480, 20528 kb/s, 30.51 fps, 30 tbr, 15360 tbn, 30720 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;

    &#xA;&#xA;

    Without adding the AV_CODEC_FLAG_GLOBAL_HEADER flag, I get a clean output from ffprobe, but the video still doesn't play. Notice it thinks the frame rate is 30.51, I'm not sure why.

    &#xA;&#xA;

    C:\ffmpeg>ffprobe MyMovieMakerMovie.mp4&#xA;ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20200122&#xA;  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;MyMovieMakerMovie.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.29.100&#xA;  Duration: 00:00:01.97, start: 0.000000, bitrate: 20530 kb/s&#xA;    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 20528 kb/s, 30.51 fps, 30 tbr, 15360 tbn, 60 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;

    &#xA;

  • when i record video with javacv it comes "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil"

    9 avril 2020, par Pradeep Simba

    I make a video recorder android app with javacv.&#xA;But, when i run this app this error occurs "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil".

    &#xA;&#xA;

    How can I solve this error ?

    &#xA;&#xA;

    gradle.build file

    &#xA;&#xA;

      android {&#xA;   ..............&#xA;    packagingOptions {&#xA;        exclude &#x27;META-INF/services/javax.annotation.processing.Processor&#x27;&#xA;        pickFirst  &#x27;META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties&#x27;&#xA;        pickFirst  &#x27;META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml&#x27;&#xA;        pickFirst  &#x27;META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties&#x27;&#xA;        pickFirst  &#x27;META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml&#x27;&#xA;    }&#xA;}&#xA;&#xA;dependencies {&#xA;&#xA;implementation group: &#x27;org.bytedeco&#x27;, name: &#x27;javacv&#x27;, version: &#x27;1.1&#x27;&#xA;implementation group: &#x27;org.bytedeco.javacpp-presets&#x27;, name: &#x27;opencv&#x27;, version: &#x27;3.0.0-1.1&#x27;, classifier: &#x27;android-arm&#x27;&#xA;implementation group: &#x27;org.bytedeco.javacpp-presets&#x27;, name: &#x27;ffmpeg&#x27;, version: &#x27;2.8.1-1.1&#x27;, classifier: &#x27;android-arm&#x27;&#xA;implementation group: &#x27;org.bytedeco.javacpp-presets&#x27;, name: &#x27;opencv&#x27;, version: &#x27;3.0.0-1.1&#x27;, classifier: &#x27;android-x86&#x27;&#xA;implementation group: &#x27;org.bytedeco.javacpp-presets&#x27;, name: &#x27;ffmpeg&#x27;, version: &#x27;2.8.1-1.1&#x27;, classifier: &#x27;android-x86&#x27;&#xA;&#xA;}&#xA;

    &#xA;&#xA;

    My demo code VideoService which will invoke in MainActivity

    &#xA;&#xA;

    package com.fs.fs.api;&#xA;&#xA;import com.fs.fs.App;&#xA;import com.fs.fs.utils.DateUtils;&#xA;import com.fs.fs.utils.FileUtils;&#xA;&#xA;import org.bytedeco.javacpp.avcodec;&#xA;import org.bytedeco.javacv.FFmpegFrameRecorder;&#xA;import org.bytedeco.javacv.FrameRecorder;&#xA;&#xA;import java.util.Date;&#xA;&#xA;/**&#xA; * Created by wyx on 2017/1/11.&#xA; */&#xA;public class VideoService {&#xA;    private FFmpegFrameRecorder mFrameRecorder;&#xA;    private String path;&#xA;&#xA;    private VideoService() {&#xA;    }&#xA;&#xA;    private static class SingletonHolder {&#xA;        private static final VideoService INSTANCE = new VideoService();&#xA;    }&#xA;&#xA;    public static VideoService getInstance() {&#xA;        return SingletonHolder.INSTANCE;&#xA;    }&#xA;&#xA;    public void startRecordVideo() {&#xA;        String fileName = String.format("%s.%s", DateUtils.date2String(new Date(), "yyyyMMdd_HHmmss"), "mp4");&#xA;        path = FileUtils.getExternalFullPath(App.getInstance(), fileName);&#xA;        mFrameRecorder = new FFmpegFrameRecorder(path, 640, 480, 1);&#xA;        mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);&#xA;        mFrameRecorder.setVideoOption("tune", "zerolatency");&#xA;        mFrameRecorder.setVideoOption("preset", "ultrafast");&#xA;        mFrameRecorder.setVideoOption("crf", "28");&#xA;        mFrameRecorder.setVideoBitrate(300 * 1000);&#xA;        mFrameRecorder.setFormat("mp4");&#xA;&#xA;        mFrameRecorder.setFrameRate(30);&#xA;        mFrameRecorder.setAudioOption("crf", "0");&#xA;        mFrameRecorder.setSampleRate(48 * 1000);&#xA;        mFrameRecorder.setAudioBitrate(960 * 1000);&#xA;        mFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);&#xA;        try {&#xA;            mFrameRecorder.start();&#xA;        } catch (FrameRecorder.Exception e) {&#xA;            e.printStackTrace();&#xA;        }&#xA;    }&#xA;&#xA;    public void stop() {&#xA;        if (mFrameRecorder != null) {&#xA;            try {&#xA;                mFrameRecorder.stop();&#xA;                mFrameRecorder.release();&#xA;            } catch (FrameRecorder.Exception e) {&#xA;                e.printStackTrace();&#xA;            }&#xA;            mFrameRecorder = null;&#xA;        }&#xA;    }&#xA;&#xA;}&#xA;

    &#xA;&#xA;

    MainActivity

    &#xA;&#xA;

    package com.fs.fs.activity;&#xA;&#xA;import android.app.Activity;&#xA;import android.os.Bundle;&#xA;&#xA;import com.fs.fs.R;&#xA;import com.fs.fs.api.VideoService;&#xA;&#xA;import static java.lang.Thread.sleep;&#xA;&#xA;&#xA;public class MainActivity extends Activity {&#xA;&#xA;    @Override&#xA;    protected void onCreate(Bundle savedInstanceState) {&#xA;        super.onCreate(savedInstanceState);&#xA;        setContentView(R.layout.activity_main);&#xA;&#xA;&#xA;        VideoService.getInstance().startRecordVideo();&#xA;        try {&#xA;            sleep(10 * 1000);&#xA;        } catch (InterruptedException e) {&#xA;            e.printStackTrace();&#xA;        }&#xA;        VideoService.getInstance().stop();&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    Error

    &#xA;&#xA;

        E/AndroidRuntime: FATAL EXCEPTION: main&#xA;    Process: com.example.usb, PID: 660&#xA;    java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:590)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA;                   Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.ClassNotFoundException: Didn&#x27;t find class "org.bytedeco.javacpp.avutil" on path: DexPathList[[zip file "/data/app/com.fs.fs-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.fs.fs-2, /vendor/lib, /system/lib, /data/datalib]]&#xA;                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:497)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:457)&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;</init></clinit></init></clinit></init></clinit></init></clinit>

    &#xA;&#xA;

    How can i solve this error ?

    &#xA;&#xA;

    Why error occurs ?

    &#xA;