Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

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

Autres articles (72)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (7031)

  • FFmpeg C++ API : Using HW acceleration (VAAPI) to transcode video coming from a webcam [closed]

    16 avril 2024, par nicoh

    I'm actually trying to use HW acceleration with the FFmpeg C++ API in order to transcode the video coming from a webcam (which may vary from one config to another) into a given output format (i.e : converting the video stream coming from the webcam in MJPEG to H264 so that it can be written into a MP4 file).

    


    I already succeeded to achieve this by transferring the AVFrame output by the HW decoder from GPU to CPU, then transfer this to the HW encoder input (so from CPU to GPU).
This is not so optimized and on top of that, for the given above config (MJPEG => H264), I cannot provide the output of the decoder as an input for the encoder as the MJPEG HW decoder wants to output in RGBA pixel format, and the H264 encoder wants NV12. So I have to perform pixel format conversion on CPU side.

    


    That's why I would like to connect the output of the HW video decoder directly to the input of the HW encoder (inside the GPU).
To do this, I followed this example given by FFmpeg : https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/vaapi_transcode.c.

    


    This works fine when transcoding an AVI file with MJPEG inside to H264 but it fails when using a MJPEG stream coming from a webcam as input.
In this case, the encoder says :

    


    [h264_vaapi @ 0x5555555e5140] No usable encoding profile found.


    


    Below the code of the FFmpeg example I modified to connect on webcam instead of opening input file :

    


    /*&#xA; * Permission is hereby granted, free of charge, to any person obtaining a copy&#xA; * of this software and associated documentation files (the "Software"), to deal&#xA; * in the Software without restriction, including without limitation the rights&#xA; * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#xA; * copies of the Software, and to permit persons to whom the Software is&#xA; * furnished to do so, subject to the following conditions:&#xA; *&#xA; * The above copyright notice and this permission notice shall be included in&#xA; * all copies or substantial portions of the Software.&#xA; *&#xA; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#xA; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#xA; * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL&#xA; * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#xA; * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#xA; * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN&#xA; * THE SOFTWARE.&#xA; */&#xA;&#xA;/**&#xA; * @file Intel VAAPI-accelerated transcoding API usage example&#xA; * @example vaapi_transcode.c&#xA; *&#xA; * Perform VAAPI-accelerated transcoding.&#xA; * Usage: vaapi_transcode input_stream codec output_stream&#xA; * e.g: - vaapi_transcode input.mp4 h264_vaapi output_h264.mp4&#xA; *      - vaapi_transcode input.mp4 vp9_vaapi output_vp9.ivf&#xA; */&#xA;&#xA;#include &#xA;#include &#xA;#include <iostream>&#xA;&#xA;//#define USE_INPUT_FILE&#xA;&#xA;extern "C"{&#xA;#include <libavutil></libavutil>hwcontext.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavdevice></libavdevice>avdevice.h>&#xA;}&#xA;&#xA;static AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;&#xA;static AVBufferRef *hw_device_ctx = NULL;&#xA;static AVCodecContext *decoder_ctx = NULL, *encoder_ctx = NULL;&#xA;static int video_stream = -1;&#xA;static AVStream *ost;&#xA;static int initialized = 0;&#xA;&#xA;static enum AVPixelFormat get_vaapi_format(AVCodecContext *ctx,&#xA;                                           const enum AVPixelFormat *pix_fmts)&#xA;{&#xA;    const enum AVPixelFormat *p;&#xA;&#xA;    for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p&#x2B;&#x2B;) {&#xA;        if (*p == AV_PIX_FMT_VAAPI)&#xA;            return *p;&#xA;    }&#xA;&#xA;    std::cout &lt;&lt; "Unable to decode this file using VA-API." &lt;&lt; std::endl;&#xA;    return AV_PIX_FMT_NONE;&#xA;}&#xA;&#xA;static int open_input_file(const char *filename)&#xA;{&#xA;    int ret;&#xA;    AVCodec *decoder = NULL;&#xA;    AVStream *video = NULL;&#xA;    AVDictionary    *pInputOptions = nullptr;&#xA;&#xA;#ifdef USE_INPUT_FILE&#xA;    if ((ret = avformat_open_input(&amp;ifmt_ctx, filename, NULL, NULL)) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Cannot open input file &#x27;" &lt;&lt; filename &lt;&lt; "&#x27;, Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;#else&#xA;    avdevice_register_all();&#xA;    av_dict_set(&amp;pInputOptions, "input_format", "mjpeg", 0);&#xA;    av_dict_set(&amp;pInputOptions, "framerate", "30", 0);&#xA;    av_dict_set(&amp;pInputOptions, "video_size", "640x480", 0);&#xA;&#xA;    if ((ret = avformat_open_input(&amp;ifmt_ctx, "/dev/video0", NULL, &amp;pInputOptions)) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Cannot open input file &#x27;" &lt;&lt; filename &lt;&lt; "&#x27;, Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;#endif&#xA;&#xA;    ifmt_ctx->flags |= AVFMT_FLAG_NONBLOCK;&#xA;&#xA;    if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Cannot find input stream information. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;&#xA;    ret = av_find_best_stream(ifmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &amp;decoder, 0);&#xA;    if (ret &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Cannot find a video stream in the input file. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;    video_stream = ret;&#xA;&#xA;    if (!(decoder_ctx = avcodec_alloc_context3(decoder)))&#xA;        return AVERROR(ENOMEM);&#xA;&#xA;    video = ifmt_ctx->streams[video_stream];&#xA;    if ((ret = avcodec_parameters_to_context(decoder_ctx, video->codecpar)) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "avcodec_parameters_to_context error. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;&#xA;    decoder_ctx->hw_device_ctx = av_buffer_ref(hw_device_ctx);&#xA;    if (!decoder_ctx->hw_device_ctx) {&#xA;        std::cout &lt;&lt; "A hardware device reference create failed." &lt;&lt; std::endl;&#xA;        return AVERROR(ENOMEM);&#xA;    }&#xA;    decoder_ctx->get_format    = get_vaapi_format;&#xA;&#xA;    if ((ret = avcodec_open2(decoder_ctx, decoder, NULL)) &lt; 0)&#xA;    {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Failed to open codec for decoding. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;    }&#xA;&#xA;    return ret;&#xA;}&#xA;&#xA;static int encode_write(AVPacket *enc_pkt, AVFrame *frame)&#xA;{&#xA;    int ret = 0;&#xA;&#xA;    av_packet_unref(enc_pkt);&#xA;&#xA;    AVHWDeviceContext *pHwDevCtx = reinterpret_cast(encoder_ctx->hw_device_ctx);&#xA;    AVHWFramesContext *pHwFrameCtx = reinterpret_cast(encoder_ctx->hw_frames_ctx);&#xA;&#xA;    if ((ret = avcodec_send_frame(encoder_ctx, frame)) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Error during encoding. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        goto end;&#xA;    }&#xA;    while (1) {&#xA;        ret = avcodec_receive_packet(encoder_ctx, enc_pkt);&#xA;        if (ret)&#xA;            break;&#xA;&#xA;        enc_pkt->stream_index = 0;&#xA;        av_packet_rescale_ts(enc_pkt, ifmt_ctx->streams[video_stream]->time_base,&#xA;                             ofmt_ctx->streams[0]->time_base);&#xA;        ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt);&#xA;        if (ret &lt; 0) {&#xA;            char errMsg[1024] = {0};&#xA;            std::cout &lt;&lt; "Error during writing data to output file. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;            return -1;&#xA;        }&#xA;    }&#xA;&#xA;end:&#xA;    if (ret == AVERROR_EOF)&#xA;        return 0;&#xA;    ret = ((ret == AVERROR(EAGAIN)) ? 0:-1);&#xA;    return ret;&#xA;}&#xA;&#xA;static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, AVCodecContext *pDecCtx)&#xA;{&#xA;    AVFrame *frame;&#xA;    int ret = 0;&#xA;&#xA;    ret = avcodec_send_packet(decoder_ctx, pkt);&#xA;    if (ret &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Error during decoding. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return ret;&#xA;    }&#xA;&#xA;    while (ret >= 0) {&#xA;        if (!(frame = av_frame_alloc()))&#xA;            return AVERROR(ENOMEM);&#xA;&#xA;        ret = avcodec_receive_frame(decoder_ctx, frame);&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;            av_frame_free(&amp;frame);&#xA;            return 0;&#xA;        } else if (ret &lt; 0) {&#xA;            char errMsg[1024] = {0};&#xA;            std::cout &lt;&lt; "Error while decoding. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;            goto fail;&#xA;        }&#xA;&#xA;        if (!initialized) {&#xA;            AVHWFramesContext *pHwFrameCtx = reinterpret_cast(decoder_ctx->hw_frames_ctx);&#xA;            &#xA;            /* we need to ref hw_frames_ctx of decoder to initialize encoder&#x27;s codec.&#xA;               Only after we get a decoded frame, can we obtain its hw_frames_ctx */&#xA;            encoder_ctx->hw_frames_ctx = av_buffer_ref(pDecCtx->hw_frames_ctx);&#xA;            if (!encoder_ctx->hw_frames_ctx) {&#xA;                ret = AVERROR(ENOMEM);&#xA;                goto fail;&#xA;            }&#xA;            /* set AVCodecContext Parameters for encoder, here we keep them stay&#xA;             * the same as decoder.&#xA;             * xxx: now the sample can&#x27;t handle resolution change case.&#xA;             */&#xA;            if(encoder_ctx->time_base.den == 1 &amp;&amp; encoder_ctx->time_base.num == 0)&#xA;            {&#xA;                encoder_ctx->time_base = av_inv_q(ifmt_ctx->streams[video_stream]->avg_frame_rate);&#xA;            }&#xA;            else&#xA;            {&#xA;                encoder_ctx->time_base = av_inv_q(decoder_ctx->framerate);&#xA;            }&#xA;            encoder_ctx->pix_fmt   = AV_PIX_FMT_VAAPI;&#xA;            encoder_ctx->width     = decoder_ctx->width;&#xA;            encoder_ctx->height    = decoder_ctx->height;&#xA;&#xA;            if ((ret = avcodec_open2(encoder_ctx, enc_codec, NULL)) &lt; 0) {&#xA;                char errMsg[1024] = {0};&#xA;                std::cout &lt;&lt; "Failed to open encode codec. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;                goto fail;&#xA;            }&#xA;&#xA;            if (!(ost = avformat_new_stream(ofmt_ctx, enc_codec))) {&#xA;                std::cout &lt;&lt; "Failed to allocate stream for output format." &lt;&lt; std::endl;&#xA;                ret = AVERROR(ENOMEM);&#xA;                goto fail;&#xA;            }&#xA;&#xA;            ost->time_base = encoder_ctx->time_base;&#xA;            ret = avcodec_parameters_from_context(ost->codecpar, encoder_ctx);&#xA;            if (ret &lt; 0) {&#xA;                char errMsg[1024] = {0};&#xA;                std::cout &lt;&lt; "Failed to copy the stream parameters. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;                goto fail;&#xA;            }&#xA;&#xA;            /* write the stream header */&#xA;            if ((ret = avformat_write_header(ofmt_ctx, NULL)) &lt; 0) {&#xA;                char errMsg[1024] = {0};&#xA;                std::cout &lt;&lt; "Error while writing stream header. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;                goto fail;&#xA;            }&#xA;&#xA;            initialized = 1;&#xA;        }&#xA;&#xA;        if ((ret = encode_write(pkt, frame)) &lt; 0)&#xA;            std::cout &lt;&lt; "Error during encoding and writing." &lt;&lt; std::endl;&#xA;&#xA;fail:&#xA;        av_frame_free(&amp;frame);&#xA;        if (ret &lt; 0)&#xA;            return ret;&#xA;    }&#xA;    return 0;&#xA;}&#xA;&#xA;int main(int argc, char **argv)&#xA;{&#xA;    const AVCodec *enc_codec;&#xA;    int ret = 0;&#xA;    AVPacket *dec_pkt;&#xA;&#xA;    if (argc != 4) {&#xA;        fprintf(stderr, "Usage: %s <input file="file" /> <encode codec="codec"> <output file="file">\n"&#xA;                "The output format is guessed according to the file extension.\n"&#xA;                "\n", argv[0]);&#xA;        return -1;&#xA;    }&#xA;&#xA;    ret = av_hwdevice_ctx_create(&amp;hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0);&#xA;    if (ret &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Failed to create a VAAPI device. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    dec_pkt = av_packet_alloc();&#xA;    if (!dec_pkt) {&#xA;        std::cout &lt;&lt; "Failed to allocate decode packet" &lt;&lt; std::endl;&#xA;        goto end;&#xA;    }&#xA;&#xA;    if ((ret = open_input_file(argv[1])) &lt; 0)&#xA;        goto end;&#xA;&#xA;    if (!(enc_codec = avcodec_find_encoder_by_name(argv[2]))) {&#xA;        std::cout &lt;&lt; "Could not find encoder &#x27;" &lt;&lt; argv[2] &lt;&lt; "&#x27;" &lt;&lt; std::endl;&#xA;        ret = -1;&#xA;        goto end;&#xA;    }&#xA;&#xA;    if ((ret = (avformat_alloc_output_context2(&amp;ofmt_ctx, NULL, NULL, argv[3]))) &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Failed to deduce output format from file extension. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        goto end;&#xA;    }&#xA;&#xA;    if (!(encoder_ctx = avcodec_alloc_context3(enc_codec))) {&#xA;        ret = AVERROR(ENOMEM);&#xA;        goto end;&#xA;    }&#xA;&#xA;    ret = avio_open(&amp;ofmt_ctx->pb, argv[3], AVIO_FLAG_WRITE);&#xA;    if (ret &lt; 0) {&#xA;        char errMsg[1024] = {0};&#xA;        std::cout &lt;&lt; "Cannot open output file. Error code: " &lt;&lt; av_make_error_string(errMsg, 1024, ret) &lt;&lt; std::endl;&#xA;        goto end;&#xA;    }&#xA;&#xA;    /* read all packets and only transcoding video */&#xA;    while (ret >= 0) {&#xA;        if ((ret = av_read_frame(ifmt_ctx, dec_pkt)) &lt; 0)&#xA;            break;&#xA;&#xA;        if (video_stream == dec_pkt->stream_index)&#xA;            ret = dec_enc(dec_pkt, enc_codec, decoder_ctx);&#xA;&#xA;        av_packet_unref(dec_pkt);&#xA;    }&#xA;&#xA;    /* flush decoder */&#xA;    av_packet_unref(dec_pkt);&#xA;    ret = dec_enc(dec_pkt, enc_codec, decoder_ctx);&#xA;&#xA;    /* flush encoder */&#xA;    ret = encode_write(dec_pkt, NULL);&#xA;&#xA;    /* write the trailer for output stream */&#xA;    av_write_trailer(ofmt_ctx);&#xA;&#xA;end:&#xA;    avformat_close_input(&amp;ifmt_ctx);&#xA;    avformat_close_input(&amp;ofmt_ctx);&#xA;    avcodec_free_context(&amp;decoder_ctx);&#xA;    avcodec_free_context(&amp;encoder_ctx);&#xA;    av_buffer_unref(&amp;hw_device_ctx);&#xA;    av_packet_free(&amp;dec_pkt);&#xA;    return ret;&#xA;}&#xA;</output></encode></iostream>

    &#xA;

    And the content of the associated CMakeLists.txt file to build it using gcc :

    &#xA;

    cmake_minimum_required(VERSION 3.5)&#xA;&#xA;include(FetchContent)&#xA;&#xA;set(CMAKE_CXX_STANDARD 17)&#xA;set(CMAKE_CXX_STANDARD_REQUIRED ON)&#xA;&#xA;set(CMAKE_VERBOSE_MAKEFILE ON)&#xA;&#xA;SET (FFMPEG_HW_TRANSCODE_INCS&#xA;    ${CMAKE_CURRENT_LIST_DIR})&#xA;&#xA;include_directories(&#xA;    ${CMAKE_INCLUDE_PATH}&#xA;    ${CMAKE_CURRENT_LIST_DIR}&#xA;)&#xA;&#xA;project(FFmpeg_HW_transcode LANGUAGES CXX)&#xA;&#xA;set(CMAKE_CXX_FLAGS "-Wall -Werror=return-type -pedantic -fPIC -gdwarf-4")&#xA;set(CMAKE_CPP_FLAGS "-Wall -Werror=return-type -pedantic -fPIC -gdwarf-4")&#xA;&#xA;set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/build/${CMAKE_BUILD_TYPE}/FFmpeg_HW_transcode")&#xA;set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/build/${CMAKE_BUILD_TYPE}/FFmpeg_HW_transcode")&#xA;&#xA;add_executable(${PROJECT_NAME})&#xA;&#xA;target_sources(${PROJECT_NAME} PRIVATE&#xA;                vaapi_transcode.cpp)&#xA;&#xA;target_link_libraries(${PROJECT_NAME}&#xA;                -L${CMAKE_CURRENT_LIST_DIR}/../build/${CMAKE_BUILD_TYPE}/FFmpeg_HW_transcode&#xA;                -lavdevice&#xA;                -lavformat&#xA;                -lavutil&#xA;                -lavcodec)&#xA;

    &#xA;

    Has anyone tried to do this kind of stuff ?

    &#xA;

    Thanks for your help.

    &#xA;

  • Sporadic "Error parsing Cues... Operation not permitted" errors when trying to generate a DASH manifest

    22 novembre 2023, par kshetline

    I have already-generated .webm audio and video files (1 audio, 3 video resolutions for each video I want to stream). The video has been generated not (directly) by ffmpeg, but HandbrakeCLI 1.7.0, with V9 encoding. The audio (which has never caused an error) is generated by ffmpeg using libvorbis.

    &#xA;

    Most of the time ffmpeg (version 6.1) creates a manifest without any problem. Sporadically, however, "Error parsing Cues" comes up (frequently with the latest videos I've been trying to process) and I can't create a manifest. Since this is happening during an automated process to process many videos for streaming, the audio and video sources are being created exactly the same way whether ffmpeg succeeds or fails in generating a manifest, making this all the more confusing.

    &#xA;

    The video files ffmpeg chokes on play perfectly well using VLC, and mediainfo doesn't show any problems with these files.

    &#xA;

    Here's the way I've been (sometimes successfully, sometimes not) generating a manifest, with extra logging added :

    &#xA;

    ffmpeg -v 9 -loglevel 99 \&#xA;  -f webm_dash_manifest -i &#x27;.\Sample Video.v480.webm&#x27; \&#xA;  -f webm_dash_manifest -i &#x27;.\Sample Video.v720.webm&#x27; \&#xA;  -f webm_dash_manifest -i &#x27;.\Sample Video.v1080.webm&#x27; \&#xA;  -f webm_dash_manifest -i &#x27;.\Sample Video.audio.webm&#x27; \&#xA;  -c copy -map 0 -map 1 -map 2 -map 3 \&#xA;  -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1,2 id=1,streams=3" \&#xA;  &#x27;.\Sample Video.mpd&#x27;&#xA;

    &#xA;

    Here's the result when it fails :

    &#xA;

    ffmpeg version 6.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      58. 29.100 / 58. 29.100&#xA;  libavcodec     60. 31.102 / 60. 31.102&#xA;  libavformat    60. 16.100 / 60. 16.100&#xA;  libavdevice    60.  3.100 / 60.  3.100&#xA;  libavfilter     9. 12.100 /  9. 12.100&#xA;  libswscale      7.  5.100 /  7.  5.100&#xA;  libswresample   4. 12.100 /  4. 12.100&#xA;  libpostproc    57.  3.100 / 57.  3.100&#xA;Splitting the commandline.&#xA;Reading option &#x27;-v&#x27; ... matched as option &#x27;v&#x27; (set logging level) with argument &#x27;9&#x27;.&#xA;Reading option &#x27;-loglevel&#x27; ... matched as option &#x27;loglevel&#x27; (set logging level) with argument &#x27;99&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;webm_dash_manifest&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as output url with argument &#x27;.\Sample Video.v480.webm&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;webm_dash_manifest&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as output url with argument &#x27;.\Sample Video.v720.webm&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;webm_dash_manifest&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as output url with argument &#x27;.\Sample Video.v1080.webm&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;webm_dash_manifest&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as output url with argument &#x27;.\Sample Video.audio.webm&#x27;.&#xA;Reading option &#x27;-c&#x27; ... matched as option &#x27;c&#x27; (codec name) with argument &#x27;copy&#x27;.&#xA;Reading option &#x27;-map&#x27; ... matched as option &#x27;map&#x27; (set input stream mapping) with argument &#x27;0&#x27;.&#xA;Reading option &#x27;-map&#x27; ... matched as option &#x27;map&#x27; (set input stream mapping) with argument &#x27;1&#x27;.&#xA;Reading option &#x27;-map&#x27; ... matched as option &#x27;map&#x27; (set input stream mapping) with argument &#x27;2&#x27;.&#xA;Reading option &#x27;-map&#x27; ... matched as option &#x27;map&#x27; (set input stream mapping) with argument &#x27;3&#x27;.&#xA;Reading option &#x27;-f&#x27; ... matched as option &#x27;f&#x27; (force format) with argument &#x27;webm_dash_manifest&#x27;.&#xA;Reading option &#x27;-adaptation_sets&#x27; ... matched as AVOption &#x27;adaptation_sets&#x27; with argument &#x27;id=0,streams=0,1,2 id=1,streams=3&#x27;.&#xA;Reading option &#x27;.\Sample Video.mpd&#x27; ... matched as output url.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Applying option v (set logging level) with argument 9.&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url .\Sample Video.v480.webm.&#xA;Applying option f (force format) with argument webm_dash_manifest.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: .\Sample Video.v480.webm.&#xA;[webm_dash_manifest @ 000002bbcb41dc80] Opening &#x27;.\Sample Video.v480.webm&#x27; for reading&#xA;[file @ 000002bbcb41e300] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;st:0 removing common factor 1000000 from timebase&#xA;[webm_dash_manifest @ 000002bbcb41dc80] Error parsing Cues&#xA;[AVIOContext @ 000002bbcb41e5c0] Statistics: 102283 bytes read, 4 seeks&#xA;[in#0 @ 000002bbcb41dac0] Error opening input: Operation not permitted&#xA;Error opening input file .\Sample Video.v480.webm.&#xA;Error opening input files: Operation not permitted&#xA;

    &#xA;

    This is mediainfo for the offending input file, Sample Video.v480.webm :

    &#xA;

    General&#xA;Complete name                            : .\Sample Video.v480.webm&#xA;Format                                   : WebM&#xA;Format version                           : Version 2&#xA;File size                                : 628 MiB&#xA;Duration                                 : 1 h 34 min&#xA;Overall bit rate                         : 926 kb/s&#xA;Frame rate                               : 23.976 FPS&#xA;Encoded date                             : 2023-11-21 16:48:35 UTC&#xA;Writing application                      : HandBrake 1.7.0 2023111500&#xA;Writing library                          : Lavf60.16.100&#xA;&#xA;Video&#xA;ID                                       : 1&#xA;Format                                   : VP9&#xA;Format profile                           : 0&#xA;Codec ID                                 : V_VP9&#xA;Duration                                 : 1 h 34 min&#xA;Bit rate                                 : 882 kb/s&#xA;Width                                    : 720 pixels&#xA;Height                                   : 480 pixels&#xA;Display aspect ratio                     : 16:9&#xA;Frame rate mode                          : Constant&#xA;Frame rate                               : 23.976 (24000/1001) FPS&#xA;Color space                              : YUV&#xA;Chroma subsampling                       : 4:2:0&#xA;Bit depth                                : 8 bits&#xA;Bits/(Pixel*Frame)                       : 0.106&#xA;Stream size                              : 598 MiB (95%)&#xA;Default                                  : Yes&#xA;Forced                                   : No&#xA;Color range                              : Limited&#xA;Color primaries                          : BT.709&#xA;Transfer characteristics                 : BT.709&#xA;Matrix coefficients                      : BT.709&#xA;

    &#xA;

    I don't know if I need different command line options, or whether this might be an ffmpeg or Handbrake bug. It has taken many, many hours to generate these video files (VP9 is painfully slow to encode), so I hate to do a lot of this over again, especially doing it again encoding the video with ffmpeg instead of Handbrake, as Handbrake is (oddly enough, considering it uses ffmpeg under the hood) noticeably faster.

    &#xA;

    I have no idea what these "Cues" are that ffmpeg wants and can't parse, or how I would change them.

    &#xA;

  • Virginia Consumer Data Protection Act (VCDPA) Guide

    27 septembre 2023, par Erin — Privacy

    Do you run a for-profit organisation in the United States that processes personal and sensitive consumer data ? If so, you may be concerned about the growing number of data privacy laws cropping up from state to state.

    Ever since the California Consumer Privacy Act (CCPA) came into effect on January 1, 2020, four other US states — Connecticut, Colorado, Utah and Virginia — have passed their own data privacy laws. Each law uses the CCPA as a foundation but slightly deviates from the formula. This is a problem for US organisations, as they cannot apply the same CCPA compliance framework everywhere else.

    In this article, you’ll learn what makes the Virginia Consumer Data Protection Act (VCDPA) unique and how to ensure compliance.

    What is the VCDPA ?

    Signed by Governor Ralph Northam on 2 March 2021, and brought into effect on 1 January 2023, the VCDPA is a new data privacy law. It gives Virginia residents certain rights regarding how organisations process their personal and sensitive consumer data.

    The VCDPA explained

    The law contains several provisions, which define :

    • Who must follow the VCDPA
    • Who is exempt from the VCDPA
    • The consumer rights of data subjects
    • Relevant terms, such as “consumers,” “personal data,” “sensitive data” and the “sale of personal data”
    • The rights and responsibilities of data controllers
    • What applicable organisations must do to ensure VCDPA compliance

    These guidelines define the data collection practices that VCDPA-compliant organisations must comply with. The practices are designed to protect the rights of Virginia residents who have their personal or sensitive data collected.

    What are the consumer rights of VCDPA data subjects ?

    There are seven consumer rights that protect residents who fit the definition of “data subjects” under the new Virginia data privacy law. 

    VCDPA consumer rights

    A data subject is an “identified or identifiable natural person” who has their information collected. Personally identifiable information includes a person’s name, address, date of birth, religious beliefs, immigration status, status of child protection assessments, ethnic origin and more.

    Below is a detailed breakdown of each VCDPA consumer right :

    1. Right to know, access and confirm personal data : Data subjects have the right to know that their data is being collected, the right to access their data and the right to confirm that the data being collected is accurate and up to date.
    2. Right to delete personal data : Data subjects have the right to request that their collected personal or sensitive consumer data be deleted.
    3. Right to correct inaccurate personal data : Data subjects have the right to request that their collected data be corrected.
    4. Right to data portability : Data subjects have the right to obtain their collected data and, when reasonable and possible, request that their collected data be transferred from one data controller to another.
    5. Right to opt out of data processing activity : Data subjects have the right to opt out of having their personal or sensitive data collected.
    6. Right to opt out of the sale of personal and sensitive consumer data : Data subjects have the right to opt out of having their collected data sold to third parties.

    Right to not be discriminated against for exercising one’s rights : Data subjects have the right to not be discriminated against for exercising their right to not have their personal or sensitive consumer data collected, processed and sold to third parties for targeted advertising or other purposes.

    Who must comply with the VCDPA ?

    The VCDPA applies to for-profit organisations. Specifically, those that operate and offer products or services in the state of Virginia.

    Who the VCDPA applies to

    Additionally, for-profit organisations that fit under either of these two categories must comply with the VCDPA :

    • Collect and process the personal data of at least 100,000 Virginia residents within a financial year or
    • Collect and process the personal data of at least 25,000 Virginia residents and receive at least 50% of gross revenue by selling personal or sensitive data.

    If a for-profit organisation resides out of the state of Virginia and falls into one of the categories above, they must comply with the VCDPA. Eligibility requirements also apply, regardless of the revenue threshold of the organisation in question. Large organisations can avoid VCDPA compliance if they don’t meet either of the above two eligibility requirements.

    What types of consumer data does the VCDPA protect ?

    The two main types of data that apply to the VCDPA are personal and sensitive data. 

    Types of VCDPA data

    Personal data is either identified or personally identifiable information, such as home address, date of birth or phone number. Information that is publicly available or has been de-identified (dissociated with a natural person or entity) is not considered personal data.

    Sensitive data is a category of personal data. It’s data that’s either the collected data of a known child or data that can be used to form an opinion about a natural person or individual. Examples of sensitive data include information about a person’s ethnicity, religion, political beliefs and sexual orientation. 

    It’s important that VCDPA-compliant organisations understand the difference between the two data types, as failure to do so could result in penalties of up to $7,500 per violation. For instance, if an organisation wants to collect sensitive data (and they have a valid reason to do so), they must first ask for consent from consumers. If the organisation in question fails to do so, then they’ll be in violation of the VCDPA, and may be subject to multiple penalties — equal to however many violations they incur.

    A 5-step VCDPA compliance framework

    Getting up to speed with the terms of the VCDPA can be challenging, especially if this is your first time encountering such a law. That said, even organisations that have experience with data privacy laws should still take the time to understand the VCDPA.

    VCDPA compliance explained

    Here’s a simple 5-step VCDPA compliance framework to follow.

    1. Assess data

    First off, take the time to become familiar with the Virginia Consumer Data Protection Act (VCDPA). Then, read the content from the ‘Who does the VCDPA apply to’ section of this article, and use this information to determine if the law applies to your organisation.

    How do you know if you reach the data subject threshold ? Easy. Use a web analytics platform like Matomo to see where your web visitors are, how many of them (from that specific region) are visiting your website and how many of them you’re collecting personal or sensitive data from.

    To do this in Matomo, simply open the dashboard, look at the “Locations” section and use the information on display to see how many Virginia residents are visiting your website.

    Matomo lets you easily view your visitors by region

    Using the dashboard will help you determine if the VCDPA applies to your company.

    2. Evaluate your privacy practices

    Review your existing privacy policies and practices and update them to comply with the VCDPA. Ensure your data collection practices protect the confidentiality, integrity and accessibility of your visitors.

    One way to do this is to automatically anonymise visitor IPs, which you can do in Matomo — in fact, the feature is automatically set to default. 

    ip address anonymity feature

    Another great thing about IP anonymisation is that after a visitor leaves your website, any evidence of them ever visiting is gone, and such information cannot be tracked by anyone else. 

    3. Inform data subjects of their rights

    To ensure VCDPA compliance in your organisation, you must inform your data subjects of their rights, including their right to access their data, their right to transfer their data to another controller and their right to opt out of your data collection efforts.

    That last point is one of the most important, and to ensure that you’re ready to respond to consumer rights requests, you should prepare an opt-out form in advance. If a visitor wants to opt out from tracking, they’ll be able to do so quickly and easily. Not only will this help you be VCDPA compliant, but your visitors will also appreciate the fact that you take their privacy seriously.

    To create an opt-out form in Matomo, visit the privacy settings section (click on the cog icon in the top menu) and click on the “Users opt-out” menu item under the Privacy section. After creating the form, you can then customise and publish the form as a snippet of HTML code that you can place on the pages of your website.

    4. Review vendor contracts

    Depending on the nature of your organisation, you may have vendor contracts with a third-party business associate. These are individuals or organisations, separate from your own, that contribute to the successful delivery of your products and services.

    You may also engage with third parties that process the data you collect, as is the case for many website owners that use Google Analytics (to which there are many alternatives) to convert visitor data into insights. 

    Financial institutions, such as stock exchange companies, also rely on third-party data for trading. If this is the case for you, then you likely have a Data Processing Agreement (DPA) in place — a legally binding document between you (the data controller, who dictates how and why the collected data is used) and the data processor (who processes the data you provide to them).

    To ensure that your DPA is VCDPA compliant, make sure it contains the following items :

    • Definition of terms
    • Instructions for processing data
    • Limits of use (explain what all parties can and cannot do with the collected data)
    • Physical data security practices (e.g., potential risks, risk of harm and control measures)
    • Data subject rights
    • Consumer request policies (i.e., must respond within 45 days of receipt)
    • Privacy notices and policies

    5. Seek expert legal advice

    To ensure your organisation is fully VCDPA compliant, consider speaking to a data and privacy lawyer. They can help you better understand the specifics of the law, advise you on where you fall short of compliance and what you must do to become VCDPA compliant.

    Data privacy lawyers can also help you draft a meaningful privacy notice, which may be useful in modifying your existing DPAs or creating new ones. If needed, they can also advise you on areas of compliance with other state-specific data protection acts, such as the CCPA and newly released laws in Colorado, Connecticut and Utah.

    How does the VCDPA differ from the CCPA ?

    Although the VCDPA has many similarities to the CCPA, the two laws still have their own approach to applying the law. 

    Here’s a quick breakdown of the main differences that set these laws apart.

    Definition of a consumer

    Under the VCDPA, a consumer is a “natural person who is a Virginia resident acting in an individual or household context.” Meanwhile, under the CCPA, a consumer is a “natural person who is a California resident acting in an individual or household context.” However, the VCDPA omits people in employment contexts, while the CCPA doesn’t. Hence, organisations don’t need to consider employee data.

    Sale of personal data

    The VCDPA defines the “sale of personal data” as an exchange “for monetary consideration” by the data controller to a data processor or third party. This means that, under the VCDPA, an act is only considered a “sale of personal data” if there is monetary value attached to the transaction.

    This contrasts with the CCPA, where that law also counts “other valuable considerations” as a factor when determining if the sale of personal data has occurred.

    Right to opt out

    Just like the CCPA, the VCDPA clearly outlines that organisations must respond to a user request to opt out of tracking. However, unlike the CCPA, the VCDPA does not give organisations any exceptions to such a right. This means that, even if the organisation believes that the request is impractical or hard to pull off, it must comply with the request under any circumstances, even in instances of hardship.

    Ensure VCDPA compliance with Matomo

    The VCDPA, like many other data privacy laws in the US, is designed to enhance the rights of Virginia consumers who have their personal or sensitive data collected and processed. Fortunately, this is where platforms like Matomo can help.

    Matomo is a powerful web analytics platform that has built-in features to help you comply with the VCDPA. These include options like :

    Try out the free 21-day Matomo trial today. No credit card required.