Recherche avancée

Médias (91)

Autres articles (51)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (8969)

  • Révision 18776 : ecrire/exec/aide_index.php : protéger les caractères spéciaux des titres de para...

    7 décembre 2011, par denisb -
  • Your Essential SOC 2 Compliance Checklist

    11 mars, par Daniel Crough — Privacy, Security

    With cloud-hosted applications becoming the norm, organisations face increasing data security and compliance challenges. SOC 2 (System and Organisation Controls 2) provides a structured framework for addressing these challenges. Established by the American Institute of Certified Public Accountants (AICPA), SOC 2 has become a critical standard for demonstrating trustworthiness to clients and partners.

    A well-structured SOC 2 compliance checklist serves as your roadmap to successful audits and effective security practices. In this post, we’ll walk through the essential steps to achieve SOC 2 compliance and explain how proper analytics practices play a crucial role in maintaining this important certification.

    Five trust service criteria of SOC2 compliance

    What is SOC 2 compliance ?

    SOC 2 compliance applies to service organisations that handle sensitive customer data. While not mandatory, this certification builds significant trust with customers and partners.

    According to the AICPA, “SOC 2 reports are intended to meet the needs of a broad range of users that need detailed information and assurance about the controls at a service organisation relevant to security, availability, and processing integrity of the systems the service organisation uses to process users’ data and the confidentiality and privacy of the information processed by these systems.

    At its core, SOC 2 helps organisations protect customer data through five fundamental principles : security, availability, processing integrity, confidentiality, and privacy.

    Think of it as a seal of approval that tells customers, “We take data protection seriously, and here’s the evidence.”

    Companies undergo SOC 2 audits to evaluate their compliance with these standards. During these audits, independent auditors assess internal controls over data security, availability, processing integrity, confidentiality, and privacy.

    What is a SOC 2 compliance checklist ?

    A SOC 2 compliance checklist is a comprehensive guide that outlines all the necessary steps and controls an organisation needs to implement to achieve SOC 2 certification. It covers essential areas including :

    • Security policies and procedures
    • Access control measures
    • Risk assessment protocols
    • Incident response plans
    • Disaster recovery procedures
    • Vendor management practices
    • Data encryption standards
    • Network security controls

    SOC 2 compliance checklist benefits

    A structured SOC 2 compliance checklist offers several significant advantages :

    Preparedness

    Preparing for a SOC 2 examination involves many complex elements. A checklist provides a clear, structured path, breaking the process into manageable tasks that ensure nothing is overlooked.

    Resource optimisation

    A comprehensive checklist reduces time spent identifying requirements, minimises costly mistakes and oversights, and enables more precise budget planning for the compliance process.

    Better team alignment

    A SOC 2 checklist establishes clear responsibilities for team members and maintains consistent understanding across all departments, helping align internal processes with industry standards.

    Risk reduction

    Following a SOC 2 compliance checklist significantly reduces the risk of compliance violations. Systematically reviewing internal controls provides opportunities to catch security gaps early, mitigating the risk of data breaches and unauthorised access.

    Audit readiness

    A well-maintained checklist simplifies audit preparation, reduces stress during the audit process, and accelerates the certification timeline.

    Business growth

    A successful SOC 2 audit demonstrates your organisation’s commitment to data security, which can be decisive in winning new business, especially with enterprise clients who require this certification from their vendors.

    Challenges in implementing SOC 2

    Implementing SOC 2 presents several significant challenges :

    Time-intensive documentation

    Maintaining accurate records throughout the SOC 2 compliance process requires diligence and attention to detail. Many organisations struggle to compile comprehensive documentation of all controls, policies and procedures, leading to delays and increased costs.

    Incorrect scoping of the audit

    Misjudging the scope can result in unnecessary expenses and extended timelines. Including too many systems complicates the process and diverts resources from critical areas.

    Maintaining ongoing compliance

    After achieving initial compliance, continuous monitoring becomes essential but is often neglected. Regular internal control audits can be overwhelming, especially for smaller organisations without dedicated compliance teams.

    Resource constraints

    Many organisations lack sufficient resources to dedicate to compliance efforts. This limitation can lead to staff burnout or reliance on expensive external consultants.

    Employee resistance

    Staff members may view new security protocols as unnecessary hurdles. Employees who aren’t adequately trained on SOC 2 requirements might inadvertently compromise compliance efforts through improper data handling.

    Analytics and SOC 2 compliance : A critical relationship

    One often overlooked aspect of SOC 2 compliance is the handling of analytics data. User behaviour data collection directly impacts multiple Trust Service Criteria, particularly privacy and confidentiality.

    Why analytics matters for SOC 2

    Standard analytics platforms often collect significant amounts of personal data, creating potential compliance risks :

    1. Privacy concerns : Many analytics tools collect personal information without proper consent mechanisms
    2. Data ownership issues : When analytics data is processed on third-party servers, maintaining control becomes challenging
    3. Confidentiality risks : Analytics data might be shared with advertising networks or other third parties
    4. Processing integrity questions : When data is transformed or aggregated by third parties, verification becomes difficult

    How Matomo supports SOC 2 compliance

    A screenshot of Matomo's Do Not Track preference centre.

    Matomo’s privacy-first analytics approach directly addresses these concerns :

    1. Complete data ownership : With Matomo, all analytics data remains under your control, either on your own servers or in a dedicated cloud instance
    2. Consent management : Built-in tools for managing user consent align with privacy requirements
    3. Data minimisation : Configurable anonymisation features help reduce collection of sensitive personal data
    4. Transparency : Clear documentation of data flows supports audit requirements
    5. Configurable data retention : Set automated data deletion schedules to comply with your policies

    By implementing Matomo as part of your SOC 2 compliance strategy, you address key requirements while maintaining the valuable insights your organisation needs for growth.

    Conclusion

    A SOC 2 compliance checklist helps organisations meet critical security and privacy standards. By taking a methodical approach to compliance and implementing privacy-respecting analytics, you can build trust with customers while protecting sensitive data.

    Start your 21-day free trial — no credit card needed.

  • libswresample : Why does swr_init() change |in_ch_layout| order so it no longer matches my decoded AVFrames, causing resampling to fail ?

    20 novembre 2023, par CheekyChips

    I am trying to write some code that resamples an audio file to 16kHz and 1 channel and then encodes it to PCM, but I am having an issue with channel layouts.

    


    In a nutshell :

    


    My AVCodecContext and the frames I get from the stream via avcodec_receive_frame() have a channel layout order of AV_CHANNEL_ORDER_UNSPEC. But when I call swr_init() it changes the in_ch_layout order to AV_CHANNEL_ORDER_NATIVE. Then when I call swr_convert_frame() with my AVFrames, because the channel layout orders don't match, the resampling fails because it thinks the input changed.

    


    More details :

    


    I create an AVCodecContext from my audio stream's codec, and it has a channel layout of AV_CHANNEL_ORDER_UNSPEC with 2 channels, and any frames I decode from the stream via avcodec_receive_frame() also have a channel layout order of AV_CHANNEL_ORDER_UNSPEC.

    


    I set SwrContext's |in_ch_layout| to the sample channel layout from the codec context :

    


        AVChannelLayout in_ch_layout = in_codec_context->ch_layout,
    ...
    int ret = swr_alloc_set_opts2(&swr_ctx, ...
                      &in_ch_layout,
                      ...);


    


    But SwrContext->init() changes its internal in_ch_layout from AV_CHANNEL_ORDER_UNSPEC to AV_CHANNEL_ORDER_NATIVE meaning it fails the next time I call swr_convert_frame() because the input frame has a different channel layout to the SwrContext. When swr_init() is called (in my case indirectly by swr_convert_frame(), but also if I alternatively call it directly) the SwrContext->used_ch_layout and SwrContext->in_ch_layout are updated to have channel layout order of AV_CHANNEL_ORDER_NATIVE :

    


        // swresample.c
    av_cold int swr_init(struct SwrContext *s){
        ...
        if (!av_channel_layout_check(&s->used_ch_layout))       <-- This hits if I don't set anything for used_ch_layout
            av_channel_layout_default(&s->used_ch_layout, s->in.ch_count);      <-- default is AV_CHANNEL_ORDER_NATIVE
        ...
        if (s->used_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) <-- This hits if I do set used_ch_layout
            av_channel_layout_default(&s->used_ch_layout, s->used_ch_layout.nb_channels);   <-- default is AV_CHANNEL_ORDER_NATIVE


    


    Then when I next call swr_convert_frame(), because the frame has the same layout as the audio stream's codec (AV_CHANNEL_ORDER_UNSPEC), and this is different to SwrContext->in_ch_layout (AV_CHANNEL_ORDER_NATIVE), it early exits with ret |= AVERROR_INPUT_CHANGED.

    


    // swresample_frame.c
    int swr_convert_frame(SwrContext *s,
                      AVFrame *out, const AVFrame *in)
    {
        ...
        if ((ret = config_changed(s, out, in)))
            return ret;
        ...


    


        static int config_changed(SwrContext *s,
                            const AVFrame *out, const AVFrame *in)
    {
        ...
        if ((err = av_channel_layout_copy(&ch_layout, &in->ch_layout)) < 0)
            ...
        if (av_channel_layout_compare(&s->in_ch_layout, &ch_layout) || ...) {   <-- This hits the next time I call swr_convert_frame()
            ret |= AVERROR_INPUT_CHANGED;
        }


    


        // channel_layout.c
    int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
    {
        ...
        // if only one is unspecified -> not equal
        if ((chl->order  == AV_CHANNEL_ORDER_UNSPEC) !=
            (chl1->order == AV_CHANNEL_ORDER_UNSPEC))
            return 1;


    


    If I hardcode the channel layout order of each input AVFrame to AV_CHANNEL_ORDER_NATIVE before resampling, then the resampling and subsequent encoding works, but this feels like a really bad idea and of course wouldn't work as soon as I resample an audio file with a different channel layout.

    


        avcodec_receive_frame(in_codec_context, input_frame);

    AVChannelLayout input_frame_ch_layout;
    av_channel_layout_default(&input_frame_ch_layout, 2 /* = nb_channels*/);
    input_frame->ch_layout = input_frame_ch_layout;
    // Bad idea - but "fixes" my issue!


    


    My questions

    


    What do I need to do to the resampler OR/AND the decoded audio frame to make sure they have the same channel layout order and the resampling works ?

    


    How can I make the channel order of the AVFrames that I get from avcodec_receive_frame() match the input channel order of SwrContext so the resampling works ? My understanding is that the decoded frames should be 'correct' already and I shouldn't need to change any of their values, only values of the output (resampled) frames that I create.

    


    Is there something I need to set on the AVFrame before I resample it ?

    


    Why does the SwrContext choose to change the channel order to AV_CHANNEL_ORDER_NATIVE ?

    


    Note :
A workaround could be to use swr_convert() with the raw data buffer instead of swr_convert_frame(), since it looks like it bypasses this check (since there are no frames involved). I haven't tried this but this shouldn't be necessary and I would like to use swr_convert_frame() as I am working with input and output frames.

    


    Unfortunately I can't find example code using swr_convert_frame() (not even the ffmpeg code seems to ever call it).

    


    My full c++ source code
(error handling omitted for readability) :

    


    std::string fileToUse = "/home/projects/audioFileProject/Audio files/14 Black Cadillacs.wma";
const std::string outputFilename = "out.wav";
const std::string PCMS16BE_encoder_name = "pcm_f32le";

int main()
{
    // Open audio file
    AVFormatContext* in_format_context = avformat_alloc_context();
    avformat_open_input(&in_format_context, fileToUse.c_str(), NULL, NULL);
    avformat_find_stream_info(in_format_context, NULL);
    
    // Get audio stream from file and corresponding decoder
    AVStream* in_stream = in_format_context->streams[0];
    AVCodecParameters* codec_params = in_stream->codecpar;
    const AVCodec* in_codec = avcodec_find_decoder(codec_params->codec_id);
    AVCodecContext *in_codec_context = avcodec_alloc_context3(in_codec);
    avcodec_parameters_to_context(in_codec_context, codec_params);
    avcodec_open2(in_codec_context, in_codec, NULL);

    // Prepare output stream and output encoder (PCM)
    AVFormatContext* out_format_context = nullptr;
    avformat_alloc_output_context2(&out_format_context, NULL, NULL, outputFilename.c_str());
    AVStream* out_stream = avformat_new_stream(out_format_context, NULL);
    const AVCodec* output_codec = avcodec_find_encoder_by_name(PCMS16BE_encoder_name.c_str());
    AVCodecContext* output_codec_context = avcodec_alloc_context3(output_codec);

    // -------------------------------
    
    AVChannelLayout output_ch_layout;
    av_channel_layout_default(&output_ch_layout, 1);    // AV_CHANNEL_LAYOUT_MONO
    output_codec_context->ch_layout = output_ch_layout;
    
    auto out_sample_rate = 16000;
    output_codec_context->sample_rate = out_sample_rate;
    output_codec_context->sample_fmt = output_codec->sample_fmts[0];
    //output_codec_context->bit_rate = output_codec_context->bit_rate;  // TODO Do we need to set the bit rate?
    output_codec_context->time_base = (AVRational){1, out_sample_rate};
    out_stream->time_base = output_codec_context->time_base;

    auto in_sample_rate = in_codec_context->sample_rate;
    AVChannelLayout in_ch_layout = in_codec_context->ch_layout,
                    out_ch_layout = output_ch_layout;   // AV_CHANNEL_LAYOUT_MONO;
    enum AVSampleFormat in_sample_fmt = in_codec_context->sample_fmt,
                        out_sample_fmt = in_codec_context->sample_fmt;

    SwrContext *swr_ctx = nullptr;
    int ret = swr_alloc_set_opts2(&swr_ctx,
                      &out_ch_layout,
                      out_sample_fmt,
                      out_sample_rate,
                      &in_ch_layout,
                      in_sample_fmt,
                      in_sample_rate,
                      0,                    // log_offset
                      NULL);                // log_ctx

    // Probably not necessary - documentation says "This option is
only used for special remapping."
    av_opt_set_chlayout(swr_ctx,    "used_chlayout",     &in_ch_layout, 0);

    // Open output file for writing
    avcodec_open2(output_codec_context, output_codec, NULL);
    avcodec_parameters_from_context(out_stream->codecpar, output_codec_context);
    
    if (out_format_context->oformat->flags & AVFMT_GLOBALHEADER)
        out_format_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

    avio_open(&out_format_context->pb, outputFilename.c_str(), AVIO_FLAG_WRITE);
    AVDictionary* muxer_opts = nullptr;
    avformat_write_header(out_format_context, &muxer_opts);

    AVFrame* input_frame = av_frame_alloc();
    AVPacket* in_packet = av_packet_alloc();

    // Loop through decoded input frames. Resample and get resulting samples in a new output frame.
    // I think PCM supports variable number of samples in frames so probably can immediately write out
    while (av_read_frame(in_format_context, in_packet) >= 0) {
        avcodec_send_packet(in_codec_context, in_packet);
        avcodec_receive_frame(in_codec_context, input_frame);

        // I don't want to do this, but it 'fixes' the error where channel layout of input frames
        // doesn't match what the resampler expects - hardcoded the number 2 to fit my sample audio file.
        AVChannelLayout input_frame_ch_layout;
        av_channel_layout_default(&input_frame_ch_layout, 2 /* = nb_channels*/);
        input_frame->ch_layout = input_frame_ch_layout;

        AVFrame* output_frame = av_frame_alloc();
        output_frame->sample_rate = out_sample_rate;
        output_frame->format = out_sample_fmt;
        output_frame->ch_layout = out_ch_layout;
        output_frame->nb_samples = output_codec_context->frame_size;
        
        // TODO Probably need to do maths to calculate new pts properly
        output_frame->pts = input_frame->pts;

        if (swr_convert_frame(swr_ctx, output_frame, input_frame))
            {   logging("Swr Convert failed");  return -1;   }          
            /// ^ Fails here, the second time (since the first time init() is called internally)

        AVPacket *output_packet = av_packet_alloc();
        int response = avcodec_send_frame(output_codec_context, output_frame);

        while (response >= 0) {
            response = avcodec_receive_packet(output_codec_context, output_packet);

            if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
                break;
            }

            output_packet->stream_index = 0;
            av_packet_rescale_ts(output_packet, in_stream->time_base, out_stream->time_base);
            av_interleaved_write_frame(out_format_context, output_packet);
        }
        av_packet_unref(output_packet);
        av_packet_free(&output_packet);
        av_frame_unref(input_frame);    // Free references held by the frame before reading new data into it.
        av_frame_unref(output_frame);
    }
    // TODO write last output packet flushing the buffer

    avformat_close_input(&in_format_context);
    return 0;
}