Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (43)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (9464)

  • save a serial of images(cv::Mat) to a mp4 file in Variable Frame Rate mode by using ffmpeg library, how to set the pts ?

    2 mai 2023, par ollydbg23

    In C++ code, I can correctly save a serial of images(opencv's cv::Mat) to a mp4 file by using ffmpeg library, see the question and answer here : avformat_write_header() function call crashed when I try to save several RGB data to a output.mp4 file

    


    Now here comes another question :

    


    Rotem' answer in that question can have the output.mp4 saved correctly. When play the mp4 file, I see the frames(OpenCV's cv::Mat image) shows in a const rate.

    


    What I can do if I have got the frames not in a const frequency, for example, the I got the first frame at the 0ms, and the second frame at the 50ms the third frame at 75ms, so that the each frame as associated time stamp, for example, those time stamp array are something like below :

    


    int timestamp[100] = {0, 50, 75, ...};


    


    What is the method to modify the Rotem's answer to reflect this ? It looks like I have to change the pts field of each frame. Because I just test the code, if I change this :

    


    yuvFrame->pts = av_rescale_q(frame_count*frame_count, outCodecCtx->time_base, outStream->time_base); //Set PTS timestamp

// note I change from frame_count to frame_count*frame_count


    


    Then the output.mp4 plays slower and slower, because the later frame has large pts values.

    


    Thanks.

    


    EDIT

    


    This is the code I'm currently used :

    


    #include <iostream>&#xA;#include <vector>&#xA;#include <cstring>&#xA;#include <fstream>&#xA;#include <sstream>&#xA;#include <stdexcept>&#xA;#include <opencv2></opencv2>opencv.hpp>&#xA;extern "C" {&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;}&#xA;&#xA;#include<cstdlib> // to generate time stamps&#xA;&#xA;using namespace std;&#xA;using namespace cv;&#xA;&#xA;int main()&#xA;{&#xA;    // Set up input frames as BGR byte arrays&#xA;    vector<mat> frames;&#xA;&#xA;    int width = 640;&#xA;    int height = 480;&#xA;    int num_frames = 100;&#xA;    Scalar black(0, 0, 0);&#xA;    Scalar white(255, 255, 255);&#xA;    int font = FONT_HERSHEY_SIMPLEX;&#xA;    double font_scale = 1.0;&#xA;    int thickness = 2;&#xA;&#xA;    for (int i = 0; i &lt; num_frames; i&#x2B;&#x2B;) {&#xA;        Mat frame = Mat::zeros(height, width, CV_8UC3);&#xA;        putText(frame, std::to_string(i), Point(width / 2 - 50, height / 2), font, font_scale, white, thickness);&#xA;        frames.push_back(frame);&#xA;    }&#xA;&#xA;    // generate a serial of time stamps which is used to set the PTS value&#xA;    // suppose they are in ms unit, the time interval is between 30ms to 59ms&#xA;    vector<int> timestamps;&#xA;&#xA;    for (int i = 0; i &lt; num_frames; i&#x2B;&#x2B;) {&#xA;        int timestamp;&#xA;        if (i == 0)&#xA;            timestamp = 0;&#xA;        else&#xA;        {&#xA;            int random = 30 &#x2B; (rand() % 30);&#xA;            timestamp = timestamps[i-0] &#x2B; random;&#xA;        }&#xA;&#xA;        timestamps.push_back(timestamp);&#xA;    }&#xA;&#xA;    // Populate frames with BGR byte arrays&#xA;&#xA;    // Initialize FFmpeg&#xA;    //av_register_all();&#xA;&#xA;    // Set up output file&#xA;    AVFormatContext* outFormatCtx = nullptr;&#xA;    //AVCodec* outCodec = nullptr;&#xA;    AVCodecContext* outCodecCtx = nullptr;&#xA;    //AVStream* outStream = nullptr;&#xA;    //AVPacket outPacket;&#xA;&#xA;    const char* outFile = "output.mp4";&#xA;    int outWidth = frames[0].cols;&#xA;    int outHeight = frames[0].rows;&#xA;    int fps = 25;&#xA;&#xA;    // Open the output file context&#xA;    avformat_alloc_output_context2(&amp;outFormatCtx, nullptr, nullptr, outFile);&#xA;    if (!outFormatCtx) {&#xA;        cerr &lt;&lt; "Error: Could not allocate output format context" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Open the output file&#xA;    if (avio_open(&amp;outFormatCtx->pb, outFile, AVIO_FLAG_WRITE) &lt; 0) {&#xA;        cerr &lt;&lt; "Error opening output file" &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Set up output codec&#xA;    const AVCodec* outCodec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    if (!outCodec) {&#xA;        cerr &lt;&lt; "Error: Could not find H.264 codec" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    outCodecCtx = avcodec_alloc_context3(outCodec);&#xA;    if (!outCodecCtx) {&#xA;        cerr &lt;&lt; "Error: Could not allocate output codec context" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;    outCodecCtx->codec_id = AV_CODEC_ID_H264;&#xA;    outCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    outCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    outCodecCtx->width = outWidth;&#xA;    outCodecCtx->height = outHeight;&#xA;    outCodecCtx->time_base = { 1, fps*1000 };   // 25000&#xA;    outCodecCtx->framerate = {fps, 1};          // 25&#xA;    outCodecCtx->bit_rate = 4000000;&#xA;&#xA;    //https://github.com/leandromoreira/ffmpeg-libav-tutorial&#xA;    //We set the flag AV_CODEC_FLAG_GLOBAL_HEADER which tells the encoder that it can use the global headers.&#xA;    if (outFormatCtx->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;    {&#xA;        outCodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; //&#xA;    }&#xA;&#xA;    // Open output codec&#xA;    if (avcodec_open2(outCodecCtx, outCodec, nullptr) &lt; 0) {&#xA;        cerr &lt;&lt; "Error: Could not open output codec" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Create output stream&#xA;    AVStream* outStream = avformat_new_stream(outFormatCtx, outCodec);&#xA;    if (!outStream) {&#xA;        cerr &lt;&lt; "Error: Could not allocate output stream" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Configure output stream parameters (e.g., time base, codec parameters, etc.)&#xA;    // ...&#xA;&#xA;    // Connect output stream to format context&#xA;    outStream->codecpar->codec_id = outCodecCtx->codec_id;&#xA;    outStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    outStream->codecpar->width = outCodecCtx->width;&#xA;    outStream->codecpar->height = outCodecCtx->height;&#xA;    outStream->codecpar->format = outCodecCtx->pix_fmt;&#xA;    outStream->time_base = outCodecCtx->time_base;&#xA;&#xA;    int ret = avcodec_parameters_from_context(outStream->codecpar, outCodecCtx);&#xA;    if (ret &lt; 0) {&#xA;        cerr &lt;&lt; "Error: Could not copy codec parameters to output stream" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    outStream->avg_frame_rate = outCodecCtx->framerate;&#xA;    //outStream->id = outFormatCtx->nb_streams&#x2B;&#x2B;;  &lt;--- We shouldn&#x27;t modify outStream->id&#xA;&#xA;    ret = avformat_write_header(outFormatCtx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        cerr &lt;&lt; "Error: Could not write output header" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Convert frames to YUV format and write to output file&#xA;    int frame_count = -1;&#xA;    for (const auto&amp; frame : frames) {&#xA;        frame_count&#x2B;&#x2B;;&#xA;        AVFrame* yuvFrame = av_frame_alloc();&#xA;        if (!yuvFrame) {&#xA;            cerr &lt;&lt; "Error: Could not allocate YUV frame" &lt;&lt; endl;&#xA;            return -1;&#xA;        }&#xA;        av_image_alloc(yuvFrame->data, yuvFrame->linesize, outWidth, outHeight, AV_PIX_FMT_YUV420P, 32);&#xA;&#xA;        yuvFrame->width = outWidth;&#xA;        yuvFrame->height = outHeight;&#xA;        yuvFrame->format = AV_PIX_FMT_YUV420P;&#xA;&#xA;        // Convert BGR frame to YUV format&#xA;        Mat yuvMat;&#xA;        cvtColor(frame, yuvMat, COLOR_BGR2YUV_I420);&#xA;        memcpy(yuvFrame->data[0], yuvMat.data, outWidth * outHeight);&#xA;        memcpy(yuvFrame->data[1], yuvMat.data &#x2B; outWidth * outHeight, outWidth * outHeight / 4);&#xA;        memcpy(yuvFrame->data[2], yuvMat.data &#x2B; outWidth * outHeight * 5 / 4, outWidth * outHeight / 4);&#xA;&#xA;        // Set up output packet&#xA;        //av_init_packet(&amp;outPacket); //error C4996: &#x27;av_init_packet&#x27;: was declared deprecated&#xA;        AVPacket* outPacket = av_packet_alloc();&#xA;        memset(outPacket, 0, sizeof(outPacket)); //Use memset instead of av_init_packet (probably unnecessary).&#xA;        //outPacket->data = nullptr;&#xA;        //outPacket->size = 0;&#xA;&#xA;        yuvFrame->pts = av_rescale_q(timestamps[frame_count], outCodecCtx->time_base, outStream->time_base); //Set PTS timestamp&#xA;&#xA;        // Encode frame and write to output file&#xA;        int ret = avcodec_send_frame(outCodecCtx, yuvFrame);&#xA;        if (ret &lt; 0) {&#xA;            cerr &lt;&lt; "Error: Could not send frame to output codec" &lt;&lt; endl;&#xA;            return -1;&#xA;        }&#xA;        while (ret >= 0) {&#xA;            ret = avcodec_receive_packet(outCodecCtx, outPacket);&#xA;            if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;                break;&#xA;            } else if (ret &lt; 0) {&#xA;                cerr &lt;&lt; "Error: Could not receive packet from output codec" &lt;&lt; endl;&#xA;                return -1;&#xA;            }&#xA;&#xA;            //av_packet_rescale_ts(&amp;outPacket, outCodecCtx->time_base, outStream->time_base);&#xA;&#xA;            outPacket->stream_index = outStream->index;&#xA;&#xA;            outPacket->duration = av_rescale_q(1, outCodecCtx->time_base, outStream->time_base);   // Set packet duration&#xA;&#xA;            ret = av_interleaved_write_frame(outFormatCtx, outPacket);&#xA;            av_packet_unref(outPacket);&#xA;            if (ret &lt; 0) {&#xA;                cerr &lt;&lt; "Error: Could not write packet to output file" &lt;&lt; endl;&#xA;                return -1;&#xA;            }&#xA;        }&#xA;&#xA;        av_frame_free(&amp;yuvFrame);&#xA;    }&#xA;&#xA;    // Flush the encoder&#xA;    ret = avcodec_send_frame(outCodecCtx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        std::cerr &lt;&lt; "Error flushing encoder: " &lt;&lt; std::endl;&#xA;        return -1;&#xA;    }&#xA;&#xA;    while (ret >= 0) {&#xA;        AVPacket* pkt = av_packet_alloc();&#xA;        if (!pkt) {&#xA;            std::cerr &lt;&lt; "Error allocating packet" &lt;&lt; std::endl;&#xA;            return -1;&#xA;        }&#xA;        ret = avcodec_receive_packet(outCodecCtx, pkt);&#xA;&#xA;        // Write the packet to the output file&#xA;        if (ret == 0)&#xA;        {&#xA;            pkt->stream_index = outStream->index;&#xA;            pkt->duration = av_rescale_q(1, outCodecCtx->time_base, outStream->time_base);   // &lt;---- Set packet duration&#xA;            ret = av_interleaved_write_frame(outFormatCtx, pkt);&#xA;            av_packet_unref(pkt);&#xA;            if (ret &lt; 0) {&#xA;                std::cerr &lt;&lt; "Error writing packet to output file: " &lt;&lt; std::endl;&#xA;                return -1;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;&#xA;    // Write output trailer&#xA;    av_write_trailer(outFormatCtx);&#xA;&#xA;    // Clean up&#xA;    avcodec_close(outCodecCtx);&#xA;    avcodec_free_context(&amp;outCodecCtx);&#xA;    avformat_free_context(outFormatCtx);&#xA;&#xA;    return 0;&#xA;}&#xA;</int></mat></cstdlib></stdexcept></sstream></fstream></cstring></vector></iostream>

    &#xA;

    Especially, I have those changes to the original Rotem's answer :

    &#xA;

    Fist, I have some code to generate a time stamp array :

    &#xA;

        // generate a serial of time stamps which is used to set the PTS value&#xA;    // suppose they are in ms unit, the time interval is between 30ms to 59ms&#xA;    vector<int> timestamps;&#xA;&#xA;    for (int i = 0; i &lt; num_frames; i&#x2B;&#x2B;) {&#xA;        int timestamp;&#xA;        if (i == 0)&#xA;            timestamp = 0;&#xA;        else&#xA;        {&#xA;            int random = 30 &#x2B; (rand() % 30);&#xA;            timestamp = timestamps[i-0] &#x2B; random;&#xA;        }&#xA;&#xA;        timestamps.push_back(timestamp);&#xA;    }&#xA;</int>

    &#xA;

    Second, I just set the PTS by those values :

    &#xA;

            yuvFrame->pts = av_rescale_q(timestamps[frame_count], outCodecCtx->time_base, outStream->time_base); //Set PTS timestamp&#xA;

    &#xA;

    Note that I have set the fps like below :

    &#xA;

        outCodecCtx->time_base = { 1, fps*1000 };   // 25000&#xA;    outCodecCtx->framerate = {fps, 1};          // 25&#xA;

    &#xA;

    Now, when I run the program, I got a lot of warnings in the console :

    &#xA;

    [libx264 @ 0000022e7fa621c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0000022e7fa621c0] profile High, level 3.0, 4:2:0, 8-bit&#xA;[libx264 @ 0000022e7fa621c0] 264 - core 164 r3094M bfc87b7 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=4000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] non-strictly-monotonic PTS&#xA;[libx264 @ 0000022e7fa621c0] invalid DTS: PTS is less than DTS&#xA;[mp4 @ 0000022e090b2300] pts (592) &lt; dts (1129348497) in stream 0&#xA;Error: Could not write packet to output file&#xA;

    &#xA;

    Any ideas ?&#xA;Thanks.

    &#xA;

  • lavfi/dnn : Remove DNN native backend

    27 avril 2023, par Ting Fu
    lavfi/dnn : Remove DNN native backend
    

    According to discussion in
    https://etherpad.mit.edu/p/FF_dev_meeting_20221202 and the proposal in
    http://ffmpeg.org/pipermail/ffmpeg-devel/2022-December/304534.html,
    the DNN native backend should be removed at first step.
    All the DNN native backend related codes are deleted.

    Signed-off-by : Ting Fu <ting.fu@intel.com>

    • [DH] libavfilter/Makefile
    • [DH] libavfilter/dnn/Makefile
    • [DH] libavfilter/dnn/dnn_backend_native.c
    • [DH] libavfilter/dnn/dnn_backend_native.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_avgpool.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_avgpool.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_conv2d.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_conv2d.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_dense.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_dense.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_depth2space.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_depth2space.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_mathbinary.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_mathbinary.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_mathunary.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_mathunary.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_maximum.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_maximum.h
    • [DH] libavfilter/dnn/dnn_backend_native_layer_pad.c
    • [DH] libavfilter/dnn/dnn_backend_native_layer_pad.h
    • [DH] libavfilter/dnn/dnn_backend_native_layers.c
    • [DH] libavfilter/dnn/dnn_backend_native_layers.h
    • [DH] libavfilter/dnn/dnn_backend_tf.c
    • [DH] libavfilter/dnn_interface.h
    • [DH] libavfilter/tests/dnn-layer-avgpool.c
    • [DH] libavfilter/tests/dnn-layer-conv2d.c
    • [DH] libavfilter/tests/dnn-layer-dense.c
    • [DH] libavfilter/tests/dnn-layer-depth2space.c
    • [DH] libavfilter/tests/dnn-layer-mathbinary.c
    • [DH] libavfilter/tests/dnn-layer-mathunary.c
    • [DH] libavfilter/tests/dnn-layer-maximum.c
    • [DH] libavfilter/tests/dnn-layer-pad.c
    • [DH] libavfilter/vf_derain.c
    • [DH] libavfilter/vf_dnn_processing.c
    • [DH] libavfilter/vf_sr.c
    • [DH] tests/Makefile
    • [DH] tests/fate/dnn.mak
  • FFMPEG hangs (sometimes) when trying to take a photo from USB camera ?

    13 mai 2022, par dezman

    I am attempting to write a script that takes a photo every 3 seconds from camera source "1", the -pix_fmt I think is unique to my USB camera.

    &#xA;

    Here is the script :

    &#xA;

    #!/bin/bash&#xA;&#xA;set -e&#xA;&#xA;while :&#xA;do&#xA;  nice_num=$(date &#x2B;%s)&#xA;  &#xA;  ffmpeg -ss 00:00:00 -f avfoundation -pix_fmt yuyv422 -r 30.000030 -i "1" -t 1 -frames:v 1 -q:v 2 "image_$nice_num_%03d.jpg"&#xA;  &#xA;  wait&#xA;&#xA;  sleep 3&#xA;done&#xA;

    &#xA;

    The issue is half the time it successfully takes the photo, and half the time it just hangs forever echoing this (not useful) :

    &#xA;

    ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with Apple clang version 13.1.6 (clang-1316.0.21.2)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0.1 --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&#xA;  libavutil      57. 17.100 / 57. 17.100&#xA;  libavcodec     59. 18.100 / 59. 18.100&#xA;  libavformat    59. 16.100 / 59. 16.100&#xA;  libavdevice    59.  4.100 / 59.  4.100&#xA;  libavfilter     8. 24.100 /  8. 24.100&#xA;  libswscale      6.  4.100 /  6.  4.100&#xA;  libswresample   4.  3.100 /  4.  3.100&#xA;  libpostproc    56.  3.100 / 56.  3.100&#xA;

    &#xA;

    Then I CTRL-C 3 times and get :

    &#xA;

    ^C^C^CReceived > 3 system signals, hard exiting&#xA;

    &#xA;

    Other methods of "taking a photo every n seconds from bash" are also appreciated.

    &#xA;