Recherche avancée

Médias (91)

Autres articles (68)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (6648)

  • Python : Extracting device and lens information from video metadata

    14 mai 2023, par cat_got_my_tongue

    I am interested in extracting device and lens information from videos. Specifically, make and model of the device and the focal length. I was able to do this successfully for still images using the exifread module and extract a whole bunch of very useful information :

    


    image type      : MPO
Image ImageDescription: Shot with DxO ONE
Image Make: DxO
Image Model: DxO ONE
Image Orientation: Horizontal (normal)
Image XResolution: 300
Image YResolution: 300
Image ResolutionUnit: Pixels/Inch
Image Software: V3.0.0 (2b448a1aee) APP:1.0
Image DateTime: 2022:04:05 14:53:45
Image YCbCrCoefficients: [299/1000, 587/1000, 57/500]
Image YCbCrPositioning: Centered
Image ExifOffset: 158
Thumbnail Compression: JPEG (old-style)
Thumbnail XResolution: 300
Thumbnail YResolution: 300
Thumbnail ResolutionUnit: Pixels/Inch
Thumbnail JPEGInterchangeFormat: 7156
Thumbnail JPEGInterchangeFormatLength: 24886
EXIF ExposureTime: 1/3
EXIF FNumber: 8
EXIF ExposureProgram: Aperture Priority
EXIF ISOSpeedRatings: 100
EXIF SensitivityType: ISO Speed
EXIF ISOSpeed: 100
EXIF ExifVersion: 0221
EXIF DateTimeOriginal: 2022:04:05 14:53:45
EXIF DateTimeDigitized: 2022:04:05 14:53:45
EXIF ComponentsConfiguration: CrCbY
EXIF CompressedBitsPerPixel: 3249571/608175
EXIF ExposureBiasValue: 0
EXIF MaxApertureValue: 212/125
EXIF SubjectDistance: 39/125
EXIF MeteringMode: MultiSpot
EXIF LightSource: Unknown
EXIF Flash: Flash did not fire
EXIF FocalLength: 1187/100
EXIF SubjectArea: [2703, 1802, 675, 450]
EXIF MakerNote: [68, 88, 79, 32, 79, 78, 69, 0, 12, 0, 0, 0, 21, 0, 3, 0, 5, 0, 2, 0, ... ]
EXIF SubSecTime: 046
EXIF SubSecTimeOriginal: 046
EXIF SubSecTimeDigitized: 046
EXIF FlashPixVersion: 0100
EXIF ColorSpace: sRGB
EXIF ExifImageWidth: 5406
EXIF ExifImageLength: 3604
Interoperability InteroperabilityIndex: R98
Interoperability InteroperabilityVersion: [48, 49, 48, 48]
EXIF InteroperabilityOffset: 596
EXIF FileSource: Digital Camera
EXIF ExposureMode: Auto Exposure
EXIF WhiteBalance: Auto
EXIF DigitalZoomRatio: 1
EXIF FocalLengthIn35mmFilm: 32
EXIF SceneCaptureType: Standard
EXIF ImageUniqueID: C01A1709306530020220405185345046
EXIF BodySerialNumber: C01A1709306530


    


    Unfortunately, I have been unable to extract this kind of info from videos so far.

    


    This is what I have tried so far, with the ffmpeg module :

    


    import ffmpeg
from pprint import pprint

test_video = "my_video.mp4"
pprint(ffmpeg.probe(test_video)["streams"])


    


    And the output I get contains a lot of info but nothing related to the device or lens, which is what I am looking for :

    


    [{'avg_frame_rate': '30/1',
  'bit_rate': '1736871',
  'bits_per_raw_sample': '8',
  'chroma_location': 'left',
  'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
  'codec_name': 'h264',
  'codec_tag': '0x31637661',
  'codec_tag_string': 'avc1',
  'codec_time_base': '1/60',
  'codec_type': 'video',
  'coded_height': 1088,
  'coded_width': 1920,
  'display_aspect_ratio': '16:9',
  'disposition': {'attached_pic': 0,
                  'clean_effects': 0,
                  'comment': 0,
                  'default': 1,
                  'dub': 0,
                  'forced': 0,
                  'hearing_impaired': 0,
                  'karaoke': 0,
                  'lyrics': 0,
                  'original': 0,
                  'timed_thumbnails': 0,
                  'visual_impaired': 0},
  'duration': '20.800000',
  'duration_ts': 624000,
  'has_b_frames': 0,
  'height': 1080,
  'index': 0,
  'is_avc': 'true',
  'level': 40,
  'nal_length_size': '4',
  'nb_frames': '624',
  'pix_fmt': 'yuv420p',
  'profile': 'Constrained Baseline',
  'r_frame_rate': '30/1',
  'refs': 1,
  'sample_aspect_ratio': '1:1',
  'start_pts': 0,
  'start_time': '0.000000',
  'tags': {'creation_time': '2021-05-08T13:23:20.000000Z',
           'encoder': 'AVC Coding',
           'handler_name': 'VideoHandler',
           'language': 'und'},
  'time_base': '1/30000',
  'width': 1920},
 {'avg_frame_rate': '0/0',
  'bit_rate': '79858',
  'bits_per_sample': 0,
  'channel_layout': 'stereo',
  'channels': 2,
  'codec_long_name': 'AAC (Advanced Audio Coding)',
  'codec_name': 'aac',
  'codec_tag': '0x6134706d',
  'codec_tag_string': 'mp4a',
  'codec_time_base': '1/48000',
  'codec_type': 'audio',
  'disposition': {'attached_pic': 0,
                  'clean_effects': 0,
                  'comment': 0,
                  'default': 1,
                  'dub': 0,
                  'forced': 0,
                  'hearing_impaired': 0,
                  'karaoke': 0,
                  'lyrics': 0,
                  'original': 0,
                  'timed_thumbnails': 0,
                  'visual_impaired': 0},
  'duration': '20.864000',
  'duration_ts': 1001472,
  'index': 1,
  'max_bit_rate': '128000',
  'nb_frames': '978',
  'profile': 'LC',
  'r_frame_rate': '0/0',
  'sample_fmt': 'fltp',
  'sample_rate': '48000',
  'start_pts': 0,
  'start_time': '0.000000',
  'tags': {'creation_time': '2021-05-08T13:23:20.000000Z',
           'handler_name': 'SoundHandler',
           'language': 'und'},
  'time_base': '1/48000'}]


    


    Are these pieces of info available for videos ? Should I be using a different package ?

    


    Thanks.

    


    Edit :

    


    pprint(ffmpeg.probe(test_video)["format"]) gives

    


    {'bit_rate': '1815244',
 'duration': '20.864000',
 'filename': 'my_video.mp4',
 'format_long_name': 'QuickTime / MOV',
 'format_name': 'mov,mp4,m4a,3gp,3g2,mj2',
 'nb_programs': 0,
 'nb_streams': 2,
 'probe_score': 100,
 'size': '4734158',
 'start_time': '0.000000',
 'tags': {'artist': 'Microsoft Game DVR',
          'compatible_brands': 'mp41isom',
          'creation_time': '2021-05-08T12:12:33.000000Z',
          'major_brand': 'mp42',
          'minor_version': '0',
          'title': 'Snipping Tool'}}


    


  • Capture and encode desktop with libav in real time not giving corect images

    3 septembre 2022, par thoxey

    As part of a larger project I want to be able to capture and encode the desktop frame by frame in real time. I have the following test code to reproduce the issue shown in the screenshot :

    


    #include &#xA;#include &#xA;#include <iostream>&#xA;#include <fstream>&#xA;#include <string>&#xA;#include &#xA;#include &#xA;&#xA;extern "C"&#xA;{&#xA;#include "libavdevice/avdevice.h"&#xA;#include "libavutil/channel_layout.h"&#xA;#include "libavutil/mathematics.h"&#xA;#include "libavutil/opt.h"&#xA;#include "libavformat/avformat.h"&#xA;#include "libswscale/swscale.h"&#xA;}&#xA;&#xA;&#xA;/* 5 seconds stream duration */&#xA;#define STREAM_DURATION   5.0&#xA;#define STREAM_FRAME_RATE 25 /* 25 images/s */&#xA;#define STREAM_NB_FRAMES  ((int)(STREAM_DURATION * STREAM_FRAME_RATE))&#xA;#define STREAM_PIX_FMT    AV_PIX_FMT_YUV420P /* default pix_fmt */&#xA;&#xA;int videoStreamIndx;&#xA;int framerate = 30;&#xA;&#xA;int width = 1920;&#xA;int height = 1080;&#xA;&#xA;int encPacketCounter;&#xA;&#xA;AVFormatContext* ifmtCtx;&#xA;AVCodecContext* avcodecContx;&#xA;AVFormatContext* ofmtCtx;&#xA;AVStream* videoStream;&#xA;AVCodecContext* avCntxOut;&#xA;AVPacket* avPkt;&#xA;AVFrame* avFrame;&#xA;AVFrame* outFrame;&#xA;SwsContext* swsCtx;&#xA;&#xA;std::ofstream fs;&#xA;&#xA;&#xA;AVDictionary* ConfigureScreenCapture()&#xA;{&#xA;&#xA;    AVDictionary* options = NULL;&#xA;    //Try adding "-rtbufsize 100M" as in https://stackoverflow.com/questions/6766333/capture-windows-screen-with-ffmpeg&#xA;    av_dict_set(&amp;options, "rtbufsize", "100M", 0);&#xA;    av_dict_set(&amp;options, "framerate", std::to_string(framerate).c_str(), 0);&#xA;    char buffer[16];&#xA;    sprintf(buffer, "%dx%d", width, height);&#xA;    av_dict_set(&amp;options, "video_size", buffer, 0);&#xA;    return options;&#xA;}&#xA;&#xA;AVCodecParameters* ConfigureAvCodec()&#xA;{&#xA;    AVCodecParameters* av_codec_par_out = avcodec_parameters_alloc();&#xA;    av_codec_par_out->width = width;&#xA;    av_codec_par_out->height = height;&#xA;    av_codec_par_out->bit_rate = 40000;&#xA;    av_codec_par_out->codec_id = AV_CODEC_ID_H264; //AV_CODEC_ID_MPEG4; //Try H.264 instead of MPEG4&#xA;    av_codec_par_out->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    av_codec_par_out->format = 0;&#xA;    return av_codec_par_out;&#xA;}&#xA;&#xA;int GetVideoStreamIndex()&#xA;{&#xA;    int VideoStreamIndx = -1;&#xA;    avformat_find_stream_info(ifmtCtx, NULL);&#xA;    /* find the first video stream index . Also there is an API available to do the below operations */&#xA;    for (int i = 0; i &lt; (int)ifmtCtx->nb_streams; i&#x2B;&#x2B;) // find video stream position/index.&#xA;    {&#xA;        if (ifmtCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)&#xA;        {&#xA;            VideoStreamIndx = i;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (VideoStreamIndx == -1)&#xA;    {&#xA;    }&#xA;&#xA;    return VideoStreamIndx;&#xA;}&#xA;&#xA;void CreateFrames(AVCodecParameters* av_codec_par_in, AVCodecParameters* av_codec_par_out)&#xA;{&#xA;&#xA;    avFrame = av_frame_alloc();&#xA;    avFrame->width = avcodecContx->width;&#xA;    avFrame->height = avcodecContx->height;&#xA;    avFrame->format = av_codec_par_in->format;&#xA;    av_frame_get_buffer(avFrame, 0);&#xA;&#xA;    outFrame = av_frame_alloc();&#xA;    outFrame->width = avCntxOut->width;&#xA;    outFrame->height = avCntxOut->height;&#xA;    outFrame->format = av_codec_par_out->format;&#xA;    av_frame_get_buffer(outFrame, 0);&#xA;}&#xA;&#xA;bool Init()&#xA;{&#xA;    AVCodecParameters* avCodecParOut = ConfigureAvCodec();&#xA;&#xA;    AVDictionary* options = ConfigureScreenCapture();&#xA;&#xA;    AVInputFormat* ifmt = av_find_input_format("gdigrab");&#xA;    auto ifmtCtxLocal = avformat_alloc_context();&#xA;    if (avformat_open_input(&amp;ifmtCtxLocal, "desktop", ifmt, &amp;options) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;    ifmtCtx = ifmtCtxLocal;&#xA;&#xA;    videoStreamIndx = GetVideoStreamIndex();&#xA;&#xA;    AVCodecParameters* avCodecParIn = avcodec_parameters_alloc();&#xA;    avCodecParIn = ifmtCtx->streams[videoStreamIndx]->codecpar;&#xA;&#xA;    AVCodec* avCodec = avcodec_find_decoder(avCodecParIn->codec_id);&#xA;    if (avCodec == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    avcodecContx = avcodec_alloc_context3(avCodec);&#xA;    if (avcodec_parameters_to_context(avcodecContx, avCodecParIn) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    //av_dict_set&#xA;    int value = avcodec_open2(avcodecContx, avCodec, NULL); //Initialize the AVCodecContext to use the given AVCodec.&#xA;    if (value &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    AVOutputFormat* ofmt = av_guess_format("h264", NULL, NULL);&#xA;&#xA;    if (ofmt == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    auto ofmtCtxLocal = avformat_alloc_context();&#xA;    avformat_alloc_output_context2(&amp;ofmtCtxLocal, ofmt, NULL, NULL);&#xA;    if (ofmtCtxLocal == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;    ofmtCtx = ofmtCtxLocal;&#xA;&#xA;    AVCodec* avCodecOut = avcodec_find_encoder(avCodecParOut->codec_id);&#xA;    if (avCodecOut == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    videoStream = avformat_new_stream(ofmtCtx, avCodecOut);&#xA;    if (videoStream == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    avCntxOut = avcodec_alloc_context3(avCodecOut);&#xA;    if (avCntxOut == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    if (avcodec_parameters_copy(videoStream->codecpar, avCodecParOut) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    if (avcodec_parameters_to_context(avCntxOut, avCodecParOut) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    avCntxOut->gop_size = 30; //3; //Use I-Frame frame every 30 frames.&#xA;    avCntxOut->max_b_frames = 0;&#xA;    avCntxOut->time_base.num = 1;&#xA;    avCntxOut->time_base.den = framerate;&#xA;&#xA;    //avio_open(&amp;ofmtCtx->pb, "", AVIO_FLAG_READ_WRITE);&#xA;&#xA;    if (avformat_write_header(ofmtCtx, NULL) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    value = avcodec_open2(avCntxOut, avCodecOut, NULL); //Initialize the AVCodecContext to use the given AVCodec.&#xA;    if (value &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    if (avcodecContx->codec_id == AV_CODEC_ID_H264)&#xA;    {&#xA;        av_opt_set(avCntxOut->priv_data, "preset", "ultrafast", 0);&#xA;        av_opt_set(avCntxOut->priv_data, "zerolatency", "1", 0);&#xA;        av_opt_set(avCntxOut->priv_data, "tune", "ull", 0);&#xA;    }&#xA;&#xA;    if ((ofmtCtx->oformat->flags &amp; AVFMT_GLOBALHEADER) != 0)&#xA;    {&#xA;        avCntxOut->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    }&#xA;&#xA;    CreateFrames(avCodecParIn, avCodecParOut);&#xA;&#xA;    swsCtx = sws_alloc_context();&#xA;    if (sws_init_context(swsCtx, NULL, NULL) &lt; 0)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    swsCtx = sws_getContext(avcodecContx->width, avcodecContx->height, avcodecContx->pix_fmt,&#xA;        avCntxOut->width, avCntxOut->height, avCntxOut->pix_fmt, SWS_FAST_BILINEAR,&#xA;        NULL, NULL, NULL);&#xA;    if (swsCtx == NULL)&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;void Encode(AVCodecContext* enc_ctx, AVFrame* frame, AVPacket* pkt)&#xA;{&#xA;    int ret;&#xA;&#xA;    /* send the frame to the encoder */&#xA;    ret = avcodec_send_frame(enc_ctx, frame);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        return;&#xA;    }&#xA;&#xA;    while (ret >= 0)&#xA;    {&#xA;        ret = avcodec_receive_packet(enc_ctx, pkt);&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;            return;&#xA;        if (ret &lt; 0)&#xA;        {&#xA;            return;&#xA;        }&#xA;&#xA;        fs.write((char*)pkt->data, pkt->size);&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;}&#xA;&#xA;void EncodeFrames(int noFrames)&#xA;{&#xA;    int frameCount = 0;&#xA;    avPkt = av_packet_alloc();&#xA;    AVPacket* outPacket = av_packet_alloc();&#xA;    encPacketCounter = 0;&#xA;&#xA;    while (av_read_frame(ifmtCtx, avPkt) >= 0)&#xA;    {&#xA;        if (frameCount&#x2B;&#x2B; == noFrames)&#xA;            break;&#xA;        if (avPkt->stream_index != videoStreamIndx) continue;&#xA;&#xA;        avcodec_send_packet(avcodecContx, avPkt);&#xA;&#xA;        if (avcodec_receive_frame(avcodecContx, avFrame) >= 0) // Frame successfully decoded :)&#xA;        {&#xA;            outPacket->data = NULL; // packet data will be allocated by the encoder&#xA;            outPacket->size = 0;&#xA;&#xA;            outPacket->pts = av_rescale_q(encPacketCounter, avCntxOut->time_base, videoStream->time_base);&#xA;            if (outPacket->dts != AV_NOPTS_VALUE)&#xA;                outPacket->dts = av_rescale_q(encPacketCounter, avCntxOut->time_base, videoStream->time_base);&#xA;&#xA;            outPacket->dts = av_rescale_q(encPacketCounter, avCntxOut->time_base, videoStream->time_base);&#xA;            outPacket->duration = av_rescale_q(1, avCntxOut->time_base, videoStream->time_base);&#xA;&#xA;            outFrame->pts = av_rescale_q(encPacketCounter, avCntxOut->time_base, videoStream->time_base);&#xA;            outFrame->pkt_duration = av_rescale_q(encPacketCounter, avCntxOut->time_base, videoStream->time_base);&#xA;            encPacketCounter&#x2B;&#x2B;;&#xA;&#xA;            int sts = sws_scale(swsCtx,&#xA;                avFrame->data, avFrame->linesize, 0, avFrame->height,&#xA;                outFrame->data, outFrame->linesize);&#xA;&#xA;            /* make sure the frame data is writable */&#xA;            auto ret = av_frame_make_writable(outFrame);&#xA;            if (ret &lt; 0)&#xA;                break;&#xA;            Encode(avCntxOut, outFrame, outPacket);&#xA;        }&#xA;        av_frame_unref(avFrame);&#xA;        av_packet_unref(avPkt);&#xA;    }&#xA;}&#xA;&#xA;void Dispose()&#xA;{&#xA;    fs.close();&#xA;&#xA;    auto ifmtCtxLocal = ifmtCtx;&#xA;    avformat_close_input(&amp;ifmtCtx);&#xA;    avformat_free_context(ifmtCtx);&#xA;    avcodec_free_context(&amp;avcodecContx);&#xA;&#xA;}&#xA;&#xA;int main(int argc, char** argv)&#xA;{&#xA;    avdevice_register_all();&#xA;&#xA;    fs.open("out.h264");&#xA;&#xA;    if (Init())&#xA;    {&#xA;        EncodeFrames(300);&#xA;    }&#xA;    else&#xA;    {&#xA;        std::cout &lt;&lt; "Failed to Init \n";&#xA;    }    &#xA;&#xA;    Dispose();&#xA;&#xA;    return 0;&#xA;}&#xA;</string></fstream></iostream>

    &#xA;

    As far as I can tell the setup of the encoding process is correct as it is largely unchanged from how the example given in the official documentation is working : https://libav.org/documentation/doxygen/master/encode__video_8c_source.html

    &#xA;

    However there is limited documentation around the desktop capture online so I am not sure if I have set that up correctly.

    &#xA;

    Bad image

    &#xA;

  • ffmpeg command never work in lambda function using nodejs [closed]

    4 décembre 2022, par Santosh swain

    I am trying to implement FFmpeg video streaming functionality such as Instagram countdown functionality. In this code, first of all, I get records(URLs) from the s3 bucket and then split them according to my need, and then create the command and execute it with exec() belonging to childe_process. in this, I am trying to store the out in some specific folder in lambda function but it was never stored. I thought lambda does allow to write files locally so I am trying to do the direct upload on the s3 bucket by using the stdout parameter of exec()'s callback. guys, please help to do that. I have a question lambda does allow to write content in its local folder ? or if not allow then whats the way to do that thing ? I just share my code please guide me.

    &#xA;

    &#xA;    // dependencies&#xA;var AWS = require(&#x27;aws-sdk&#x27;);&#xA;var s3 = new AWS.S3();&#xA;var { exec } = require(&#x27;child_process&#x27;);&#xA;var path = require(&#x27;path&#x27;)&#xA;var AWS_ACCESS_KEY = &#x27;&#x27;;&#xA;var AWS_SECRET_ACCESS_KEY = &#x27;&#x27;;&#xA;var fs = require(&#x27;fs&#x27;)&#xA;&#xA;s3 = new AWS.S3({&#xA;    accessKeyId: AWS_ACCESS_KEY,&#xA;    secretAccessKey: AWS_SECRET_ACCESS_KEY&#xA;});&#xA;&#xA;exports.handler = async function (event, context) {&#xA;&#xA;    var bucket_name = "sycu-game";&#xA;    var bucketName = "sycu-test";&#xA;&#xA;    //CREATE OVERLAY AND BG_VALUE PATH TO GET VALUE FROM S3&#xA;    const bgValue = (event.Records[0].bg_value).split(&#x27;/&#x27;);&#xA;    const overlayImage = (event.Records[0].overlay_image_url).split(&#x27;/&#x27;);&#xA;&#xA;&#xA;    var s3_bg_value = bgValue[3] &#x2B; "/" &#x2B; bgValue[4];&#xA;    var s3_overlay_image = overlayImage[4] &#x2B; "/" &#x2B; overlayImage[5] &#x2B; "/" &#x2B; overlayImage[6];&#xA;    const signedUrlExpireSeconds = 60 * 5;&#xA;&#xA;&#xA;    //RETREIVE BG_VALUE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE&#xA;    var bg_value_url = s3.getSignedUrl(&#x27;getObject&#x27;, {&#xA;        Bucket: bucket_name,&#xA;        Key: s3_bg_value,&#xA;        Expires: signedUrlExpireSeconds&#xA;    });&#xA;    bg_value_url = bg_value_url.split("?");&#xA;    bg_value_url = bg_value_url[0];&#xA;&#xA;&#xA;    //RETREIVE OVERLAY IMAGE FROM S3 AND CREATE URL FOR FFMPEG INPUT VALUE   &#xA;    var overlay_image_url = s3.getSignedUrl(&#x27;getObject&#x27;, {&#xA;        Bucket: bucket_name,&#xA;        Key: s3_overlay_image,&#xA;        Expires: signedUrlExpireSeconds&#xA;    });&#xA;    overlay_image_url = overlay_image_url.split("?");&#xA;    overlay_image_url = overlay_image_url[0];&#xA;&#xA;&#xA;    //MANUAL ASSIGN VARIABLE FOR FFMPEG COMMAND &#xA;    var command,&#xA;        ExtraTimerSec = event.Records[0].timer_seconds &#x2B; 5,&#xA;        TimerSec = event.Records[0].timer_seconds &#x2B; 1,&#xA;        BackgroundWidth = 1080,&#xA;        BackgroundHeight = 1920,&#xA;        videoPath = (__dirname &#x2B; &#x27;/tmp/&#x27; &#x2B; event.Records[0].name);&#xA;    console.log("path", videoPath)&#xA;    //TEMP DIRECTORY&#xA;&#xA;    var videoPath = &#x27;/media/volume-d/generatedCountdownS3/tmp/&#x27; &#x2B; event.Records[0].name&#xA;    var tmpFile = fs.createWriteStream(videoPath)&#xA;    //FFMPEG COMMAND &#xA;    if (event.Records[0].bg_type == 2) {&#xA;        if (event.Records[0].is_rotate) {&#xA;            command = &#x27; -stream_loop -1 -t &#x27; &#x2B; ExtraTimerSec &#x2B; &#x27; -i &#x27; &#x2B; bg_value_url &#x2B; &#x27; -i &#x27; &#x2B; overlay_image_url &#x2B; &#x27; -filter_complex "color=color=0x000000@0.0:s= &#x27; &#x2B; event.Records[0].resized_box_width &#x2B; &#x27;x&#x27; &#x2B; event.Records[0].resized_box_height &#x2B; &#x27;,drawtext=fontcolor=&#x27; &#x2B; event.Records[0].time_text_color &#x2B; &#x27;:fontsize=&#x27; &#x2B; event.Records[0].time_text_size &#x2B; &#x27;:x=&#x27; &#x2B; event.Records[0].minute_x &#x2B; &#x27;:y=&#x27; &#x2B; event.Records[0].minute_y &#x2B; &#x27;:text=\&#x27;%{eif\\:trunc(mod(((&#x27; &#x2B; TimerSec &#x2B; &#x27;-if(between(t, 0, 1),1,if(gte(t,&#x27; &#x2B; TimerSec &#x2B; &#x27;),&#x27; &#x2B; TimerSec &#x2B; &#x27;,t)))/60),60))\\:d\\:2}\&#x27;,drawtext=fontcolor=&#x27; &#x2B; event.Records[0].time_text_color &#x2B; &#x27;:fontsize=&#x27; &#x2B; event.Records[0].time_text_size &#x2B; &#x27;:x=&#x27; &#x2B; event.Records[0].second_x &#x2B; &#x27;:y=&#x27; &#x2B; event.Records[0].second_y &#x2B; &#x27;:text=\&#x27;%{eif\\:trunc(mod(&#x27; &#x2B; TimerSec &#x2B; &#x27;-if(between(t, 0, 1),1,if(gte(t,&#x27; &#x2B; TimerSec &#x2B; &#x27;),&#x27; &#x2B; TimerSec &#x2B; &#x27;,t))\,60))\\:d\\:2}\&#x27;[txt]; [txt] rotate=&#x27; &#x2B; event.Records[0].box_angle &#x2B; &#x27;*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=&#x27; &#x2B; BackgroundWidth &#x2B; &#x27;:h=&#x27; &#x2B; BackgroundHeight &#x2B; &#x27;[t];[1] scale=w=&#x27; &#x2B; BackgroundWidth &#x2B; &#x27;:h=&#x27; &#x2B; BackgroundHeight &#x2B; &#x27;[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=&#x27; &#x2B; event.Records[0].flat_box_coordinate_x &#x2B; &#x27; :y=&#x27; &#x2B; event.Records[0].flat_box_coordinate_x &#x2B; &#x27; [m2]" -map "[m2]" -pix_fmt yuv420p -t &#x27; &#x2B;&#xA;                ExtraTimerSec &#x2B; &#x27; -r 24 -c:a copy &#x27; &#x2B; videoPath &#x2B; "";&#xA;        }&#xA;        else {&#xA;            command = &#x27; -stream_loop -1 -t &#x27; &#x2B; ExtraTimerSec &#x2B; &#x27; -i &#x27; &#x2B; bg_value_url &#x2B; &#x27; -i &#x27; &#x2B; overlay_image_url &#x2B; &#x27; -filter_complex "color=color=0x000000@0.0:s= &#x27; &#x2B; event.Records[0].resized_box_width &#x2B; &#x27;x&#x27; &#x2B; event.Records[0].resized_box_height &#x2B; &#x27;,drawtext=fontcolor=&#x27; &#x2B; event.Records[0].time_text_color &#x2B; &#x27;:fontsize=&#x27; &#x2B; event.Records[0].time_text_size &#x2B; &#x27;:x=&#x27; &#x2B; event.Records[0].minute_x &#x2B; &#x27;:y=&#x27; &#x2B; event.Records[0].minute_y &#x2B; &#x27;:text=\&#x27;%{eif\\:trunc(mod(((&#x27; &#x2B; TimerSec &#x2B; &#x27;-if(between(t, 0, 1),1,if(gte(t,&#x27; &#x2B; TimerSec &#x2B; &#x27;),&#x27; &#x2B; TimerSec &#x2B; &#x27;,t)))/60),60))\\:d\\:2}\&#x27;,drawtext=fontcolor=&#x27; &#x2B; event.Records[0].time_text_color &#x2B; &#x27;:fontsize=&#x27; &#x2B; event.Records[0].time_text_size &#x2B; &#x27;:x=&#x27; &#x2B; event.Records[0].second_x &#x2B; &#x27;:y=&#x27; &#x2B; event.Records[0].second_y &#x2B; &#x27;:text=\&#x27;%{eif\\:trunc(mod(&#x27; &#x2B; TimerSec &#x2B; &#x27;-if(between(t, 0, 1),1,if(gte(t,&#x27; &#x2B; TimerSec &#x2B; &#x27;),&#x27; &#x2B; TimerSec &#x2B; &#x27;,t))\,60))\\:d\\:2}\&#x27;[txt]; [txt] rotate=&#x27; &#x2B; event.Records[0].box_angle &#x2B; &#x27;*PI/180:fillcolor=#00000000 [rotated];[0] scale=w=&#x27; &#x2B; BackgroundWidth &#x2B; &#x27;:h=&#x27; &#x2B; BackgroundHeight &#x2B; &#x27;[t];[1] scale=w=&#x27; &#x2B; BackgroundWidth &#x2B; &#x27;:h=&#x27; &#x2B; BackgroundHeight &#x2B; &#x27;[ot];[t][ot] overlay = :x=0 :y=0 [m1];[m1][rotated]overlay = :x=&#x27; &#x2B; event.Records[0].flat_box_coordinate_x &#x2B; &#x27; :y=&#x27; &#x2B; event.Records[0].flat_box_coordinate_x &#x2B; &#x27; [m2]" -map "[m2]" -pix_fmt yuv420p -t &#x27; &#x2B;&#xA;                ExtraTimerSec &#x2B; &#x27; -r 24 -c:a copy &#x27; &#x2B; videoPath &#x2B; "";&#xA;        }&#xA;    }&#xA;    var final_command = &#x27;/usr/bin/ffmpeg&#x27; &#x2B; command;&#xA;&#xA;&#xA;    //COMMAND EXECUTE HERE&#xA;&#xA;    await exec(final_command, function (err, stdout, stderr) {&#xA;        console.log("data is here")&#xA;        console.log(&#x27;err:&#x27;, err);&#xA;        console.log(&#x27;stdout:&#x27;, stdout);&#xA;        console.log(&#x27;stderr:&#x27;, stderr);&#xA;        const params = {&#xA;            Bucket: bucketName,&#xA;            Key: "countdown/output.mp4",&#xA;            Body: stdout,&#xA;        }&#xA;        s3.upload(params).promise().then(data => {&#xA;            console.log("data is here -->", data)&#xA;        });&#xA;    });&#xA;    var tmpFile = fs.createReadStream(videoPath)&#xA;    console.log(&#x27;temp file data:&#x27;, tmpFile.toString())&#xA;};&#xA;

    &#xA;