Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (89)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (6925)

  • Saving frames as JPG with FFMPEG (Visual Studio / C++)

    10 novembre 2022, par Diego Satizabal

    I am trying to save all frames from a mp4 video in separate JPG files, I have a code that runs and actually saves something to JPG files but files are not recognized as images and nothing is showing.

    


    Below my full code, I am using Visual Studio 2022 in Windows 11 and FFMPEG 5.1. The function that saves the images is save_frame_as_jpeg which is actually an adaption from the code provided here but changing the use of avcodec_encode_video2 for avcodec_send_frame/avcodec_receive_packet as indicated in the documentation.

    


    I am obiously doing something wrong but cannot quite find it, BTW, I know that a simple command (ffmpeg -i input.mp4 -vf fps=1 vid_%d.png) will do this but I am requiring to do it by code.

    


    Any help is appreciated, thanks in advance !

    


        // FfmpegTests.cpp : This file contains the &#x27;main&#x27; function. Program execution begins and ends there.&#xA;//&#xA;#pragma warning(disable : 4996)&#xA;extern "C"&#xA;{&#xA;    #include "libavformat/avformat.h"&#xA;    #include "libavcodec/avcodec.h"&#xA;    #include "libavfilter/avfilter.h"&#xA;    #include "libavutil/opt.h"&#xA;    #include "libavutil/avutil.h"&#xA;    #include "libavutil/error.h"&#xA;    #include "libavfilter/buffersrc.h"&#xA;    #include "libavfilter/buffersink.h"&#xA;    #include "libswscale/swscale.h"&#xA;}&#xA;&#xA;#pragma comment(lib, "avcodec.lib")&#xA;#pragma comment(lib, "avformat.lib")&#xA;#pragma comment(lib, "avfilter.lib")&#xA;#pragma comment(lib, "avutil.lib")&#xA;#pragma comment(lib, "swscale.lib")&#xA;&#xA;#include <cstdio>&#xA;#include <iostream>&#xA;#include <chrono>&#xA;#include <thread>&#xA;&#xA;&#xA;static AVFormatContext* fmt_ctx;&#xA;static AVCodecContext* dec_ctx;&#xA;AVFilterGraph* filter_graph;&#xA;AVFilterContext* buffersrc_ctx;&#xA;AVFilterContext* buffersink_ctx;&#xA;static int video_stream_index = -1;&#xA;&#xA;const char* filter_descr = "scale=78:24,transpose=cclock";&#xA;static int64_t last_pts = AV_NOPTS_VALUE;&#xA;&#xA;static int open_input_file(const char* filename)&#xA;{&#xA;    const AVCodec* dec;&#xA;    int ret;&#xA;&#xA;    if ((ret = avformat_open_input(&amp;fmt_ctx, filename, NULL, NULL)) &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");&#xA;        return ret;&#xA;    }&#xA;&#xA;    if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");&#xA;        return ret;&#xA;    }&#xA;&#xA;    /* select the video stream */&#xA;    ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &amp;dec, 0);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");&#xA;        return ret;&#xA;    }&#xA;    video_stream_index = ret;&#xA;&#xA;    /* create decoding context */&#xA;    dec_ctx = avcodec_alloc_context3(dec);&#xA;    if (!dec_ctx)&#xA;        return AVERROR(ENOMEM);&#xA;    avcodec_parameters_to_context(dec_ctx, fmt_ctx->streams[video_stream_index]->codecpar);&#xA;&#xA;    /* init the video decoder */&#xA;    if ((ret = avcodec_open2(dec_ctx, dec, NULL)) &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");&#xA;        return ret;&#xA;    }&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;static int init_filters(const char* filters_descr)&#xA;{&#xA;    char args[512];&#xA;    int ret = 0;&#xA;    const AVFilter* buffersrc = avfilter_get_by_name("buffer");&#xA;    const AVFilter* buffersink = avfilter_get_by_name("buffersink");&#xA;    AVFilterInOut* outputs = avfilter_inout_alloc();&#xA;    AVFilterInOut* inputs = avfilter_inout_alloc();&#xA;    AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;&#xA;    enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };&#xA;&#xA;    filter_graph = avfilter_graph_alloc();&#xA;    if (!outputs || !inputs || !filter_graph) {&#xA;        ret = AVERROR(ENOMEM);&#xA;        goto end;&#xA;    }&#xA;&#xA;    /* buffer video source: the decoded frames from the decoder will be inserted here. */&#xA;    snprintf(args, sizeof(args),&#xA;        "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",&#xA;        dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,&#xA;        time_base.num, time_base.den,&#xA;        dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);&#xA;&#xA;    ret = avfilter_graph_create_filter(&amp;buffersrc_ctx, buffersrc, "in",&#xA;        args, NULL, filter_graph);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");&#xA;        goto end;&#xA;    }&#xA;&#xA;    /* buffer video sink: to terminate the filter chain. */&#xA;    ret = avfilter_graph_create_filter(&amp;buffersink_ctx, buffersink, "out",&#xA;        NULL, NULL, filter_graph);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");&#xA;        goto end;&#xA;    }&#xA;&#xA;    ret = av_opt_set_int_list(buffersink_ctx, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Cannot set output pixel format\n");&#xA;        goto end;&#xA;    }&#xA;&#xA;    outputs->name = av_strdup("in");&#xA;    outputs->filter_ctx = buffersrc_ctx;&#xA;    outputs->pad_idx = 0;&#xA;    outputs->next = NULL;&#xA;&#xA;    inputs->name = av_strdup("out");&#xA;    inputs->filter_ctx = buffersink_ctx;&#xA;    inputs->pad_idx = 0;&#xA;    inputs->next = NULL;&#xA;&#xA;    if ((ret = avfilter_graph_parse_ptr(filter_graph, filters_descr,&#xA;        &amp;inputs, &amp;outputs, NULL)) &lt; 0)&#xA;        goto end;&#xA;&#xA;    if ((ret = avfilter_graph_config(filter_graph, NULL)) &lt; 0)&#xA;        goto end;&#xA;&#xA;end:&#xA;    avfilter_inout_free(&amp;inputs);&#xA;    avfilter_inout_free(&amp;outputs);&#xA;&#xA;    return ret;&#xA;}&#xA;&#xA;static void display_frame(const AVFrame* frame, AVRational time_base)&#xA;{&#xA;    int x, y;&#xA;    uint8_t* p0, * p;&#xA;    int64_t delay;&#xA;&#xA;    if (frame->pts != AV_NOPTS_VALUE) {&#xA;        if (last_pts != AV_NOPTS_VALUE) {&#xA;            /* sleep roughly the right amount of time;&#xA;             * usleep is in microseconds, just like AV_TIME_BASE. */&#xA;            AVRational timeBaseQ;&#xA;            timeBaseQ.num = 1;&#xA;            timeBaseQ.den = AV_TIME_BASE;&#xA;&#xA;            delay = av_rescale_q(frame->pts - last_pts, time_base, timeBaseQ);&#xA;            if (delay > 0 &amp;&amp; delay &lt; 1000000)&#xA;                std::this_thread::sleep_for(std::chrono::microseconds(delay));&#xA;        }&#xA;        last_pts = frame->pts;&#xA;    }&#xA;&#xA;    /* Trivial ASCII grayscale display. */&#xA;    p0 = frame->data[0];&#xA;    puts("\033c");&#xA;    for (y = 0; y &lt; frame->height; y&#x2B;&#x2B;) {&#xA;        p = p0;&#xA;        for (x = 0; x &lt; frame->width; x&#x2B;&#x2B;)&#xA;            putchar(" .-&#x2B;#"[*(p&#x2B;&#x2B;) / 52]);&#xA;        putchar(&#x27;\n&#x27;);&#xA;        p0 &#x2B;= frame->linesize[0];&#xA;    }&#xA;    fflush(stdout);&#xA;}&#xA;&#xA;int save_frame_as_jpeg(AVCodecContext* pCodecCtx, AVFrame* pFrame, int FrameNo) {&#xA;    int ret = 0;&#xA;&#xA;    const AVCodec* jpegCodec = avcodec_find_encoder(AV_CODEC_ID_JPEG2000);&#xA;    if (!jpegCodec) {&#xA;        return -1;&#xA;    }&#xA;    AVCodecContext* jpegContext = avcodec_alloc_context3(jpegCodec);&#xA;    if (!jpegContext) {&#xA;        return -1;&#xA;    }&#xA;&#xA;    jpegContext->pix_fmt = pCodecCtx->pix_fmt;&#xA;    jpegContext->height = pFrame->height;&#xA;    jpegContext->width = pFrame->width;&#xA;    jpegContext->time_base = AVRational{ 1,10 };&#xA;&#xA;    ret = avcodec_open2(jpegContext, jpegCodec, NULL);&#xA;    if (ret &lt; 0) {&#xA;        return ret;&#xA;    }&#xA;    FILE* JPEGFile;&#xA;    char JPEGFName[256];&#xA;&#xA;    AVPacket packet;&#xA;    packet.data = NULL;&#xA;    packet.size = 0;&#xA;    av_init_packet(&amp;packet);&#xA;&#xA;    int gotFrame;&#xA;&#xA;    ret = avcodec_send_frame(jpegContext, pFrame);&#xA;    if (ret &lt; 0) {&#xA;        return ret;&#xA;    }&#xA;&#xA;    ret = avcodec_receive_packet(jpegContext, &amp;packet);&#xA;    if (ret &lt; 0) {&#xA;        return ret;&#xA;    }&#xA;&#xA;    sprintf(JPEGFName, "c:\\folder\\dvr-%06d.jpg", FrameNo);&#xA;    JPEGFile = fopen(JPEGFName, "wb");&#xA;    fwrite(packet.data, 1, packet.size, JPEGFile);&#xA;    fclose(JPEGFile);&#xA;&#xA;    av_packet_unref(&amp;packet);&#xA;    avcodec_close(jpegContext);&#xA;    return 0;&#xA;}&#xA;&#xA;int main(int argc, char** argv)&#xA;{&#xA;    AVFrame* frame;&#xA;    AVFrame* filt_frame;&#xA;    AVPacket* packet;&#xA;    int ret;&#xA;&#xA;    if (argc != 2) {&#xA;        fprintf(stderr, "Usage: %s file\n", argv[0]);&#xA;        exit(1);&#xA;    }&#xA;&#xA;    frame = av_frame_alloc();&#xA;    filt_frame = av_frame_alloc();&#xA;    packet = av_packet_alloc();&#xA;&#xA;    if (!frame || !filt_frame || !packet) {&#xA;        fprintf(stderr, "Could not allocate frame or packet\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    if ((ret = open_input_file(argv[1])) &lt; 0)&#xA;        goto end;&#xA;    if ((ret = init_filters(filter_descr)) &lt; 0)&#xA;        goto end;&#xA;&#xA;    while (true)&#xA;    {&#xA;        if ((ret = av_read_frame(fmt_ctx, packet)) &lt; 0)&#xA;            break;&#xA;&#xA;        if (packet->stream_index == video_stream_index) {&#xA;            ret = avcodec_send_packet(dec_ctx, packet);&#xA;            if (ret &lt; 0) {&#xA;                av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n");&#xA;                break;&#xA;            }&#xA;&#xA;            while (ret >= 0)&#xA;            {&#xA;                ret = avcodec_receive_frame(dec_ctx, frame);&#xA;                if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;                    break;&#xA;                }&#xA;                else if (ret &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Error while receiving a frame from the decoder\n");&#xA;                    goto end;&#xA;                }&#xA;&#xA;                frame->pts = frame->best_effort_timestamp;&#xA;&#xA;                /* push the decoded frame into the filtergraph */&#xA;                if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) &lt; 0) {&#xA;                    av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");&#xA;                    break;&#xA;                }&#xA;&#xA;                /* pull filtered frames from the filtergraph */&#xA;                while (1) {&#xA;                    ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);&#xA;                    if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;                        break;&#xA;                    if (ret &lt; 0)&#xA;                        goto end;&#xA;                    display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);&#xA;                    av_frame_unref(filt_frame);&#xA;                    &#xA;                    ret = save_frame_as_jpeg(dec_ctx, frame, dec_ctx->frame_number);&#xA;                    if (ret &lt; 0)&#xA;                        goto end;&#xA;                }&#xA;                av_frame_unref(frame);&#xA;            }&#xA;        }&#xA;        av_packet_unref(packet);&#xA;    }&#xA;&#xA;end:&#xA;    avfilter_graph_free(&amp;filter_graph);&#xA;    avcodec_free_context(&amp;dec_ctx);&#xA;    avformat_close_input(&amp;fmt_ctx);&#xA;    av_frame_free(&amp;frame);&#xA;    av_frame_free(&amp;filt_frame);&#xA;    av_packet_free(&amp;packet);&#xA;&#xA;    if (ret &lt; 0 &amp;&amp; ret != AVERROR_EOF) {&#xA;        char errBuf[AV_ERROR_MAX_STRING_SIZE]{0};&#xA;        int res = av_strerror(ret, errBuf, AV_ERROR_MAX_STRING_SIZE);&#xA;        fprintf(stderr, "Error:  %s\n", errBuf);&#xA;        exit(1);&#xA;    }&#xA;&#xA;    exit(0);&#xA;}&#xA;</thread></chrono></iostream></cstdio>

    &#xA;

  • ffmpeg can't stop, when running with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)

    9 novembre 2022, par haizhohuang

    when i use local ffmpeg, it exit normally.

    &#xA;

    cmd = f&#x27;ffmpeg -nostdin -vsync 0 -i {sec_replace(video_path)} -r {marked_paras.get_divide_frame_fps()}&#x27; \&#xA;      f&#x27;-q:v 2 -f image2 {crop_info} {sec_replace(default_frames_dir)}%08d.png&#x27;&#xA;logger.info(cmd)&#xA;p = subprocess.Popen(cmd,&#xA;                     stdin=subprocess.PIPE,&#xA;                     stdout=subprocess.PIPE,&#xA;                     stderr=subprocess.PIPE, shell=True)&#xA;&#xA;# p.communicate()&#xA;command.utp_command("ps aux | grep ffmpeg")&#xA;timer = Timer(60, p.kill)&#xA;try:&#xA;    timer.start()&#xA;    stdout, stderr = p.communicate()&#xA;finally:&#xA;    timer.cancel()&#xA;command.utp_command("ffmpeg --version")&#xA;logger.info("stdout: {}".format(stdout))&#xA;logger.info("stdout: {}".format(stderr))&#xA;

    &#xA;

    local stdout&#xA;ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers\n built with Apple clang version 14.0.0

    &#xA;

    stdout: b"ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers\n  built with Apple clang version 14.0.0 (clang-1400.0.29.102)\n  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox\n  libavutil      57. 28.100 / 57. 28.100\n  libavcodec     59. 37.100 / 59. 37.100\n  libavformat    59. 27.100 / 59. 27.100\n  libavdevice    59.  7.100 / 59.  7.100\n  libavfilter    =-0.0 size=N/A time=00:00:07.56 bitrate=N/A speed=0.71x    \r[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 231 >= 231\nframe=  281 fps= 25 q=-0.0 size=N/A time=00:00:07.90 bitrate=N/A speed=0.708x    \rframe=  291 fps= 25 q=-0.0 size=N/A time=00:00:08.23 bitrate=N/A speed=0.706x    \r[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 247 >= 247\nframe=  300 fps= 25 q=-0.0 size=N/A time=00:00:08.50 bitrate=N/A speed=0.698x    \r[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 261 >= 261\nframe=  312 fps= 25 q=-0.0 size=N/A time=00:00:08.86 bitrate=N/A speed=0.699x    \r[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 276 >= 276\nframe=  325 fps= 25 q=-0.0 size=N/A time=00:00:09.26 bitrate=N/A speed=0.702x    \rframe=  335 fps= 24 q=-0.0 size=N/A time=00:00:09.60 bitrate=N/A speed= 0.7x    \r[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 290 >= 290\n[image2 @ 0x7fd891906080] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 305 >= 305\nframe=  344 fps= 24 q=-0.0 Lsize=N/A time=00:00:10.23 bitrate=N/A speed=0.708x    \nvideo:1096936kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown\n"&#xA;

    &#xA;

    But when i put it in cloud. it can't stop the subprocess and blocking in communicate util being killed

    &#xA;

    remote output&#xA;ffmpeg version 3.4.11 Copyright (c) 2000-2022 the FFmpeg developers\n built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)

    &#xA;

    stdout: b"ffmpeg version 3.4.11 Copyright (c) 2000-2022 the FFmpeg developers\n  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)\n  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags=&#x27;-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic&#x27; --extra-ldflags=&#x27;-Wl,-z,relro &#x27; --extra-cflags=&#x27; &#x27; --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect\n  libavutil      55. 78.100 / 55. 78.100\n  libavcodec     57.107.100 / 57.107.100\n  libavformat    57. 83.100 / 57. 83.100\n  libavdevice    57. 10.100 / 57. 10.100\n  libavfilter     6.107.100 /  6.107.100\n  libavresample   3.  7.  0 /  3.  7.  0\n  libswscale      4.  8.100 /  4.  8.100\n  libswresample   2.  9.100 /  2.  9.100\n  libpostproc    54.  7.100 / 54.  7.100\nInput #0, matroska,webm, from &#x27;case.videoquality.recommend_video_quality_performance_case.recommend_video_quality_test/record_video/com.tencent.mtt/1667903766/test.mkv&#x27;:\n  Metadata:\n    COMMENT         : Recorded by scrcpy 1.24\n    ENCODER         : Lavf57.83.100\n  Duration: N/A, start: 0.000000, bitrate: N/A\n    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1080x2240, 1k fps, 59.94 tbr, 1k tbn, 2k tbc (default)\nUsing -vsync 0 and -r can produce invalid output files\nStream mapping:\n  Stream #0:0 -> #0:0 (h264 (native) -> png (native))\nPress [q] to stop, [?] for help\nOutput #0, image2, to &#x27;case.videoquality.recommend_video_quality_performance_case.recommend_video_quality_test/record_video/com.tencent.mtt/1667903766/frames_end/%08d.png&#x27;:\n  Metadata:\n    COMMENT         : Recorded by scrcpy 1.24\n    encoder         : Lavf57.83.100\n    Stream #0:0: Video: png, rgb24, 1080x2240, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)\n    Metadata:\n      encoder         : Lavc57.107.100 png\nframe=    6 fps=0.0 q=-0.0 size=N/A time=00:00:00.06 bitrate=N/A speed=0.109x    \r[image2size=N/A time=00:00:17.06 bitrate=N/A speed=0.296x    \r[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 512 >= 512\n[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 514 >= 514\nframe=  703 fps= 12 q=-0.0 size=N/A time=00:00:17.20 bitrate=N/A speed=0.295x    \r[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 516 >= 516\n[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 517 >= 517\n[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 518 >= 518\nframe=  711 fps= 12 q=-0.0 size=N/A time=00:00:17.36 bitrate=N/A speed=0.295x    \r[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 520 >= 520\n[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 521 >= 521\n[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 522 >= 522\nframe=  717 fps= 12 q=-0.0 size=N/A time=00:00:17.46 bitrate=N/A speed=0.293x    \r[image2 @ 0x1a3e900] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 524 >= 524\n"&#xA;

    &#xA;

    i want to stop the subprocess by ffmpeg self in cloud

    &#xA;

  • Is Google Analytics Accurate ? 6 Important Caveats

    8 novembre 2022, par Erin

    It’s no secret that accurate website analytics is crucial for growing your online business — and Google Analytics is often the go-to source for insights. 

    But is Google Analytics data accurate ? Can you fully trust the provided numbers ? Here’s a detailed explainer.

    How Accurate is Google Analytics ? A Data-Backed Answer 

    When properly configured, Google Analytics (Universal Analytics and Google Analytics 4) is moderately accurate for global traffic collection. That said : Google Analytics doesn’t accurately report European traffic. 

    According to GDPR provisions, sites using GA products must display a cookie consent banner. This consent is required to collect third-party cookies — a tracking mechanism for identifying users across web properties.

    Google Analytics (GA) cannot process data about the user’s visit if they rejected cookies. In such cases, your analytics reports will be incomplete.

    Cookie rejection refers to visitors declining or blocking cookies from ever being collected by a specific website (or within their browser). It immediately affects the accuracy of all metrics in Google Analytics.

    Google Analytics is not accurate in locations where cookie consent to tracking is legally required. Most consumers don’t like disruptive cookie banners or harbour concerns about their privacy — and chose to reject tracking. 

    This leaves businesses with incomplete data, which, in turn, results in : 

    • Lower traffic counts as you’re not collecting 100% of the visitor data. 
    • Loss of website optimisation capabilities. You can’t make data-backed decisions due to inconsistent reporting

    For the above reasons, many companies now consider cookieless website tracking apps that don’t require consent screen displays. 

    Why is Google Analytics Not Accurate ? 6 Causes and Solutions 

    A high rejection rate of cookie banners is the main reason for inaccurate Google Analytics reporting. In addition, your account settings can also hinder Google Analytics’ accuracy.

    If your analytics data looks wonky, check for these six Google Analytics accuracy problems. 

    You Need to Secure Consent to Cookies Collection 

    To be GDPR-compliant, you must display a cookie consent screen to all European users. Likewise, other jurisdictions and industries require similar measures for user data collection. 

    This is a nuisance for many businesses since cookie rejection undermines their remarketing capabilities. Hence, some try to maximise cookie acceptance rates with dark patterns. For example : hide the option to decline tracking or make the texts too small. 

    Cookie consent banner examples
    Banner on the left doesn’t provide an evident option to reject all cookies and nudges the user to accept tracking. Banner on the right does a better job explaining the purpose of data collection and offers a straightforward yes/no selection

    Sadly, not everyone’s treating users with respect. A joint study by German and American researchers found that only 11% of US websites (from a sample of 5,000+) use GDPR-compliant cookie banners.

    As a result, many users aren’t aware of the background data collection to which they have (or have not) given consent. Another analysis of 200,000 cookies discovered that 70% of third-party marketing cookies transfer user data outside of the EU — a practice in breach of GDPR.

    Naturally, data regulators and activities are after this issue. In April 2022, Google was pressured to introduce a ‘reject all’ cookies button to all of its products (a €150 million compliance fine likely helped with that). Whereas, noyb has lodged over 220 complaints against individual websites with deceptive cookie consent banners.

    The takeaway ? Messing up with the cookie consent mechanism can get you in legal trouble. Don’t use sneaky banners as there are better ways to collect website traffic statistics. 

    Solution : Try Matomo GDPR-Friendly Analytics 

    Fill in the gaps in your traffic analytics with Matomo – a fully GDPR-compliant product that doesn’t rely on third-party cookies for tracking web visitors. Because of how it is designed, the French data protection authority (CNIL) confirmed that Matomo can be used to collect data without tracking consent.

    With Matomo, you can track website users without asking for cookie consent. And when you do, we supply you with a compact, compliant, non-disruptive cookie banner design. 

    Your Google Tag Isn’t Embedded Correctly 

    Google Tag (gtag.js) is a web tracking script that sends data to your Google Analytics, Google Ads and Google Marketing Platform.

    A corrupted gtag.js installation can create two accuracy issues : 

    • Duplicate page tracking 
    • Missing script installation 

    Is there a way to tell if you’re affected ?

    Yes. You may have duplicate scripts installed if you have a very low bounce rate on most website pages (below 15% – 20%). The above can happen if you’re using a WordPress GA plugin and additionally embed gtag.js straight in your website code. 

    A tell-tale sign of a missing script on some pages is low/no traffic stats. Google alerts you about this with a banner : 

    Google Analytics alerts

    Solution : Use Available Troubleshooting Tools 

    Use Google Analytics Debugger extension to analyse pages with low bounce rates. Use the search bar to locate duplicate code-tracking elements. 

    Alternatively, you can use Google Tag Assistant for diagnosing snippet install and troubleshooting issues on individual pages. 

    If the above didn’t work, re-install your analytics script

    Machine Learning and Blended Data Are Applied

    Google Analytics 4 (GA4) relies a lot on machine learning and algorithmic predictions.

    By applying Google’s advanced machine learning models, the new Analytics can automatically alert you to significant trends in your data. [...] For example, it calculates churn probability so you can more efficiently invest in retaining customers.

    On the surface, the above sounds exciting. In practice, Google’s application of predictive algorithms means you’re not seeing actual data. 

    To offer a variation of cookieless tracking, Google algorithms close the gaps in reporting by creating models (i.e., data-backed predictions) instead of reporting on actual user behaviours. Therefore, your GA4 numbers may not be accurate.

    For bigger web properties (think websites with 1+ million users), Google also relies on data sampling — a practice of extrapolating data analytics, based on a data subset, rather than the entire dataset. Once again, this can lead to inconsistencies in reporting with some numbers (e.g., average conversion rates) being inflated or downplayed. 

    Solution : Try an Alternative Website Analytics App 

    Unlike GA4, Matomo reports consist of 100% unsampled data. All the aggregated reporting you see is based on real user data (not guesstimation). 

    Moreover, you can migrate from Universal Analytics (UA) to Matomo without losing access to your historical records. GA4 doesn’t yet have any backward compatibility.

    Spam and Bot Traffic Isn’t Filtered Out 

    Surprise ! 42% of all Internet traffic is generated by bots, of which 27.7% are bad ones.

    Good bots (aka crawlers) do essential web “housekeeping” tasks like indexing web pages. Bad bots distribute malware, spam contact forms, hack user accounts and do other nasty stuff. 

    A lot of such spam bots are designed specifically for web analytics apps. The goal ? Flood your dashboard with bogus data in hopes of getting some return action from your side. 

    Types of Google Analytics Spam :

    • Referral spam. Spambots hijack the referrer, displayed in your GA referral traffic report to indicate a page visit from some random website (which didn’t actually occur). 
    • Event spam. Bots generate fake events with free language entries enticing you to visit their website. 
    • Ghost traffic spam. Malicious parties can also inject fake pageviews, containing URLs that they want you to click. 

    Obviously, such spammy entities distort the real website analytics numbers. 

    Solution : Set Up Bot/Spam Filters 

    Google Analytics 4 has automatic filtering of bot traffic enabled for all tracked Web and App properties. 

    But if you’re using Universal Analytics, you’ll have to manually configure spam filtering. First, create a new view and then set up a custom filter. Program it to exclude :

    • Filter Field : Request URI
    • Filter Pattern : Bot traffic URL

    Once you’ve configured everything, validate the results using Verify this filter feature. Then repeat the process for other fishy URLs, hostnames and IP addresses. 

    You Don’t Filter Internal Traffic 

    Your team(s) spend a lot of time on your website — and their sporadic behaviours can impair your traffic counts and other website metrics.

    To keep your data “employee-free”, exclude traffic from : 

    • Your corporate IPs addresses 
    • Known personal IPs of employees (for remote workers) 

    If you also have a separate stage version of your website, you should also filter out all traffic coming from it. Your developers, contractors and marketing people spend a lot of time fiddling with your website. This can cause a big discrepancy in average time on page and engagement rates. 

    Solution : Set Internal Traffic Filters 

    Google provides instructions for excluding internal traffic from your reports using IPv4/IPv6 address filters. 

    Google Analytics IP filters

    Session Timeouts After 30 Minutes 

    After 30 minutes of inactivity, Google Analytics tracking sessions start over. Inactivity means no recorded interaction hits during this time. 

    Session timeouts can be a problem for some websites as users often pin a tab to check it back later. Because of this, you can count the same user twice or more — and this leads to skewed reporting. 

    Solution : Programme Custom Timeout Sessions

    You can codify custom cookie timeout sessions with the following code snippets : 

    Final Thoughts 

    Thanks to its scale and longevity, Google Analytics has some strong sides, but its data accuracy isn’t 100% perfect.

    The inability to capture analytics data from users who don’t consent to cookie tracking and data sampling applied to bigger web properties may be a deal-breaker for your business. 

    If that’s the case, try Matomo — a GDPR-compliant, accurate web analytics solution. Start your 21-day free trial now. No credit card required.