Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (67)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (7171)

  • How to use multiple cookies in FFmpeg ?

    17 mai 2023, par カルロサグ

    I am trying to use cookies in ffmpeg to download a video that requires cookies

    


    I checked the documentation for multiple cookies using the "-cookies" argument, they must be separated by a newline, but the docs don't show an example of how to do it, there is only an example for the cookies syntax using a single cookie. I've tried "\n" and "\r\n" (used by the "-headers" argument) and they didn't work : I get a 403 response error

    


    Using a regular HTTP client such as curl or aiohttp (python) downloads the video, so the cookies and headers I provided are correct

    


    First test : Cookies as headers

    


    ffprobe -i "https://cdn12.tokyvideo.com/videos/215/215164/mp4/d41bdb167b322ab0b5bf03e9cd64c4c2edb5939e9ba56403afb52297c2ae97be.mp4?nva=20230227154655&nvb=20230223154655&token=0fe81937ec54cc94ab459" -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0" -headers "Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Host: www.tokyvideo.com
Referer: https://www.tokyvideo.com
Cookie: XSRF-TOKEN=eyJpdiI6IjNzMGJQb3duNVVNNFJFS0VUdW5MV3c9PSIsInZhbHVlIjoiMWhQRlVlUUxST01IblFXdFM3ZVQzYUZHd2ZRamdGR2JCejNpSmhaMHlwSjBwcksyeHF0UWRsZFhQd244ZW9wTzNsbmdBd2JiM2luTjR2TVhxdEdNdGJQaXE3S3BJM2J5WVljaEtXbFRMRm1aUjVTS2hQVDFVWkphUkc0bjBZSUsiLCJtYWMiOiI0ODJjZjIxZjkzZGQyZjU2YTAzNjNlYzQxMGU5YTQxYjdlZGZkZGJjYWFiZGNhYzRlMzBhZTZiY2MyYjA5OTI3In0%3D; Domain=tokyvideo.com; expires=Sat, 04-Mar-2023 15:46:56 GMT; Max-Age=604800; Path=/
Cookie: tokyvideo_session=eyJpdiI6InVEUkxxUmdTZDJtZnNmeWpqaE9mTWc9PSIsInZhbHVlIjoid1kzVTVZbmtpRHJDUDZOc25pMnRMOFBCRk1IOTVXN3dMc3Y5MmlzaGh6NzVZM0xOMlNCOTB5bTFIemdLXC9ZWE14UGhKUHN2OEFJZDZhR241bG5FcGw0aHpHeTRnbUF0cGVVUkVqQUhReXllVTY1TmtGM2hsV0w5a3RxdCtBa09JIiwibWFjIjoiNzUxM2M1MTJiN2RiM2ZmOGZkYzViM2FkY2E1NTgwNjQzY2NjODIyNWQ4ZjRkMWUxZjc5ODU3NzQyZTQ4ZjJiZiJ9; Domain=tokyvideo.com; expires=Sat, 04-Mar-2023 15:46:56 GMT; HttpOnly; Max-Age=604800; Path=/


    


    Returns 403

    


    Second test : Cookies using -cookies the argument

    


    ffprobe -i "https://cdn12.tokyvideo.com/videos/215/215164/mp4/d41bdb167b322ab0b5bf03e9cd64c4c2edb5939e9ba56403afb52297c2ae97be.mp4?nva=20230227154655&nvb=20230223154655&token=0fe81937ec54cc94ab459" -user_agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0" -headers "Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Host: www.tokyvideo.com
Referer: https://www.tokyvideo.com
" -cookies "XSRF-TOKEN=eyJpdiI6IjNzMGJQb3duNVVNNFJFS0VUdW5MV3c9PSIsInZhbHVlIjoiMWhQRlVlUUxST01IblFXdFM3ZVQzYUZHd2ZRamdGR2JCejNpSmhaMHlwSjBwcksyeHF0UWRsZFhQd244ZW9wTzNsbmdBd2JiM2luTjR2TVhxdEdNdGJQaXE3S3BJM2J5WVljaEtXbFRMRm1aUjVTS2hQVDFVWkphUkc0bjBZSUsiLCJtYWMiOiI0ODJjZjIxZjkzZGQyZjU2YTAzNjNlYzQxMGU5YTQxYjdlZGZkZGJjYWFiZGNhYzRlMzBhZTZiY2MyYjA5OTI3In0%3D; Domain=tokyvideo.com; expires=Sat, 04-Mar-2023 15:46:56 GMT; Max-Age=604800; Path=/;
tokyvideo_session=eyJpdiI6InVEUkxxUmdTZDJtZnNmeWpqaE9mTWc9PSIsInZhbHVlIjoid1kzVTVZbmtpRHJDUDZOc25pMnRMOFBCRk1IOTVXN3dMc3Y5MmlzaGh6NzVZM0xOMlNCOTB5bTFIemdLXC9ZWE14UGhKUHN2OEFJZDZhR241bG5FcGw0aHpHeTRnbUF0cGVVUkVqQUhReXllVTY1TmtGM2hsV0w5a3RxdCtBa09JIiwibWFjIjoiNzUxM2M1MTJiN2RiM2ZmOGZkYzViM2FkY2E1NTgwNjQzY2NjODIyNWQ4ZjRkMWUxZjc5ODU3NzQyZTQ4ZjJiZiJ9; Domain=tokyvideo.com; expires=Sat, 04-Mar-2023 15:46:56 GMT; HttpOnly; Max-Age=604800; Path=/;"


    


    Returns 403, using either "\n" or "\r\n" to split the cookies

    


    Output :

    


      built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[https @ 0x557191d9b840] HTTP error 403 Forbidden
https://cdn12.tokyvideo.com/videos/215/215164/mp4/d41bdb167b322ab0b5bf03e9cd64c4c2edb5939e9ba56403afb52297c2ae97be.mp4?nva=20230227154655&nvb=20230223154655&token=0fe81937ec54cc94ab459: Server returned 403 Forbidden (access denied)


    


  • How to record frames with ffmpeg and finish the recording

    20 février 2024, par Jorge Augusto Wilchen

    In the following code, i trying to create a class to record frames from an IP camera (RTSP), save frames on a .avi file and finish the record, but, when i kill the operation, the video file may be corrupted. Have any other more safely way to stop the ffmpeg recording ?

    


    .cpp file :

    


    #include "videorecorder.h"


VideoRecorder::VideoRecorder(const std::string& rtspUrl) :
    url(rtspUrl),
    recording(false)
{

}

VideoRecorder::~VideoRecorder()
{
    end_record();
}

bool VideoRecorder::start_record(const std::string &fileName)
{
    if (recording) {
        std::cerr << "Already recording." << std::endl;
        return false;
    }

    std::string command = "ffmpeg -rtsp_transport udp -i " + url
                          + " -c:v mjpeg -preset fast -qp 0 " + fileName;

    videoWriter = popen(command.c_str(), "w");
    if (!videoWriter) {
        std::cerr << "Error opening ffmpeg process." << std::endl;
        return false;
    }

    recording = true;
    ffmpegProcessId = getpid();
    std::cout << "Recording started." << std::endl;
    return true;
}

bool VideoRecorder::end_record()
{
    if (recording) {
        if (videoWriter) {
            pid_t ffmpegPID = fileno(videoWriter);

            if (kill(ffmpegPID, SIGTERM) == 0) {
                std::cout << "Recording terminated successfully." << std::endl;
            } else {
                std::cerr << "Error terminating recording." << std::endl;
                return false;
            }

            int status = pclose(videoWriter);

            if (status == 0) {
                std::cout << "Recording ended successfully." << std::endl;
            } else {
                std::cerr << "Error ending recording. pclose status: " << status << std::endl;
                return false;
            }
        } else {
            std::cerr << "Error ending recording. videoWriter is nullptr." << std::endl;
            return false;
        }

        recording = false;
        return true;
    }

    return false;
}


    


    .h file :

    


    #ifndef VIDEORECORDER_H&#xA;#define VIDEORECORDER_H&#xA;&#xA;#include <string>&#xA;#include <iostream>&#xA;#include <fstream>&#xA;#include <cstdlib>&#xA;#include <csignal>&#xA;#include <sys></sys>wait.h>&#xA;&#xA;extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include &#xA;}&#xA;&#xA;#include <linux></linux>videodev2.h>&#xA;&#xA;#include <opencv2></opencv2>opencv.hpp>&#xA;#include <opencv2></opencv2>videoio.hpp>&#xA;#include <opencv2></opencv2>highgui/highgui.hpp>&#xA;&#xA;&#xA;class VideoRecorder&#xA;{&#xA;public:&#xA;    VideoRecorder(const std::string&amp; rtspUrl);&#xA;    ~VideoRecorder();&#xA;    bool start_record(const std::string&amp; fileName);&#xA;    bool end_record();&#xA;&#xA;private:&#xA;    std::string url;&#xA;    AVFormatContext *formatContext;&#xA;    AVStream *videoStream;&#xA;    AVCodecContext *codecContext;&#xA;    AVCodec *codec;&#xA;    SwsContext *swsContext;&#xA;    AVFrame *frame;&#xA;    AVPacket packet;&#xA;    bool recording;&#xA;    pid_t ffmpegProcessId;&#xA;    FILE* videoWriter;&#xA;};&#xA;&#xA;#endif // VIDEORECORDER_H&#xA;</csignal></cstdlib></fstream></iostream></string>

    &#xA;

    I'm using the ffmpeg lib becouse i need max speed on frames recording, and OpenCV and AV Lib is much slowness than ffmpeg.

    &#xA;

    This my terminal output after recording during 10 seconds (generated a file with 23 seconds duration) :

    &#xA;

    Recording started.&#xA;ffmpeg version 4.3.6-0&#x2B;deb11u1&#x2B;rpt5 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with gcc 10 (Debian 10.2.1-6)&#xA;  configuration: --prefix=/usr --extra-version=0&#x2B;deb11u1&#x2B;rpt5 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-mmal --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --enable-sand --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, rtsp, from &#x27;rtsp://admin:[password]@[ip]:[port]/live/0/MAIN&#x27;:&#xA;  Metadata:&#xA;    title           : RTSP Server&#xA;  Duration: N/A, start: 0.280000, bitrate: N/A&#xA;    Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc&#xA;Codec AVOption preset (Configuration preset) specified for output file #0 (/home/guardian-tech/Pictures/output_frame.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.&#xA;Codec AVOption qp (Constant quantization parameter rate control method) specified for output file #0 (/home/guardian-tech/Pictures/output_frame.avi) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, avi, to &#x27;/home/guardian-tech/Pictures/output_frame.avi&#x27;:&#xA;  Metadata:&#xA;    INAM            : RTSP Server&#xA;    ISFT            : Lavf58.45.100&#xA;    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc), 1920x1080, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc&#xA;    Metadata:&#xA;      encoder         : Lavc58.91.100 mjpeg&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A&#xA;[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet&#xA;[rtsp @ 0x5592e7bb00] RTP: missed 212 packets&#xA;[h264 @ 0x5592ebb790] concealing 2192 DC, 2192 AC, 2192 MV errors in I frame&#xA;rtsp://admin:[password]@[ip]:[port]/live/0/MAIN: corrupt decoded frame in stream 0&#xA;[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet&#xA;[rtsp @ 0x5592e7bb00] RTP: missed 6 packets&#xA;[rtsp @ 0x5592e7bb00] max delay reached. need to consume packet&#xA;[rtsp @ 0x5592e7bb00] RTP: missed 14 packets&#xA;[h264 @ 0x5592f1bd30] cabac decode of qscale diff failed at 42 29&#xA;[h264 @ 0x5592f1bd30] error while decoding MB 42 29, bytestream 0&#xA;[h264 @ 0x5592f1bd30] concealing 4687 DC, 4687 AC, 4687 MV errors in I frame&#xA;rtsp://admin:[password]@[ip]:[port]/live/0/MAIN: corrupt decoded frame in stream 0&#xA;Error terminating recording.&#xA;

    &#xA;

  • FFmpeg Concatenation Command Fails in Flutter App

    18 février 2024, par Petro

    I'm developing a Flutter application where I need to concatenate several images into a single video file using FFmpeg. Despite following the recommended practices and trying multiple variations of the FFmpeg command, all my attempts result in failure with an exit code of 1.

    &#xA;

    FFMPEG Version : ffmpeg_kit_flutter: ^6.0.3-LTS

    &#xA;

    All of the files are present when this happens...&#xA;enter image description here

    &#xA;

    Environment :&#xA;Flutter app targeting Android&#xA;Using ffmpeg-kit-flutter for FFmpeg operations

    &#xA;

    Objective :&#xA;To concatenate multiple images stored in the app's file system into a video.

    &#xA;

    Code Snippet :&#xA;I'm generating a list of image paths, writing them to a file (ffmpeg_list.txt), and using that file with FFmpeg's concat demuxer. Here's a simplified version of my code :

    &#xA;

    Future<void> _createVideoFromImages() async {&#xA;  final Directory appDir = await getApplicationDocumentsDirectory();&#xA;  final Uuid uuid = Uuid();&#xA;  final String videoFileName = uuid.v4();&#xA;  final String outputPath = &#x27;${appDir.path}/$videoFileName.mp4&#x27;;&#xA;  &#xA;  final Directory tempImageDir = await Directory(&#x27;${appDir.path}/tempImages&#x27;).create();&#xA;  final StringBuffer ffmpegInput = StringBuffer();&#xA;  int index = 0;&#xA;&#xA;  for (var image in _images) {&#xA;    String newFileName = &#x27;img${index&#x2B;&#x2B;}${Path.extension(image.path)}&#x27;.replaceAll(&#x27; &#x27;, &#x27;_&#x27;);&#xA;    final String newPath = &#x27;${tempImageDir.path}/$newFileName&#x27;;&#xA;    await image.copy(newPath);&#xA;    ffmpegInput.writeln("file &#x27;$newPath&#x27;");&#xA;  }&#xA;&#xA;  final String listFilePath = &#x27;${appDir.path}/ffmpeg_list.txt&#x27;;&#xA;  await File(listFilePath).writeAsString(ffmpegInput.toString());&#xA;&#xA;  if(await File(listFilePath).exists()) {&#xA;    String ffmpegCommand = "-v verbose -f concat -safe 0 -i $listFilePath -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 $outputPath";&#xA;    // Additional commands tried here...&#xA;    await FFmpegKit.execute(ffmpegCommand).then((session) async {&#xA;      // Error handling code...&#xA;    });&#xA;  }&#xA;}&#xA;&#xA;Result Logs:&#xA;I/flutter: file exists at /data/user/0/com.example.app/app_flutter/ffmpeg_list.txt&#xA;I/flutter: FFmpeg command: -v verbose -f concat -safe 0 -i /data/user/0/com.example.app/app_flutter/ffmpeg_list.txt -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 /data/user/0/com.example.app/app_flutter/58fdf92b-47b0-49d1-be93-d9c95870c733.mp4&#xA;I/flutter: Failed to create video&#xA;I/flutter: FFmpeg process exited with:1&#xA;I/flutter: FFmpeg command failed with logs: ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers...&#xA;</void>

    &#xA;

    Attempts :&#xA;-Simplified the FFmpeg command by removing -vsync vfr, -pix_fmt yuv420p, and adjusting -r 30 parameters.&#xA;-Tried using the -c copy option to avoid re-encoding.&#xA;-Tested with a single image to ensure basic functionality works.&#xA;-Checked file permissions and ensured all images and the list file are accessible.

    &#xA;

    Despite these attempts, the command fails without providing specific error messages related to the command's execution. The verbose logs do not offer insights beyond the FFmpeg version and configuration.

    &#xA;

    Questions :&#xA;Are there known issues with FFmpeg's concat that might lead to such failures ?&#xA;Are there alternative approaches ?

    &#xA;

    I appreciate any insights or suggestions the community might have. Thank you !

    &#xA;

    Full code :

    &#xA;

    Future<void> _createVideoFromImages() async {&#xA;    final Directory appDir = await getApplicationDocumentsDirectory();&#xA;    final Uuid uuid = Uuid();&#xA;    final String videoFileName = uuid.v4();&#xA;    final String outputPath = &#x27;${appDir.path}/$videoFileName.mp4&#x27;;&#xA;    final String singleImagePath = _images[0]!.path;&#xA;&#xA;// Create a directory to store renamed images to avoid any naming conflict&#xA;    final Directory tempImageDir = await Directory(&#x27;${appDir.path}/tempImages&#x27;).create();&#xA;&#xA;    final StringBuffer ffmpegInput = StringBuffer();&#xA;    int index = 0; // To ensure unique filenames&#xA;&#xA;    for (var image in _images) {&#xA;      // Generate a new filename by replacing spaces with underscores and adding an index&#xA;      String newFileName = &#x27;img${index&#x2B;&#x2B;}${p.extension(image!.path)}&#x27;.replaceAll(&#x27; &#x27;, &#x27;_&#x27;);&#xA;      final String newPath = &#x27;${tempImageDir.path}/$newFileName&#x27;;&#xA;&#xA;      // Copy and rename the original file to the new path&#xA;      await image!.copy(newPath);&#xA;&#xA;      // Add the new, safely named file path to the ffmpegInput&#xA;      ffmpegInput.writeln("file &#x27;$newPath&#x27;");&#xA;    }&#xA;&#xA;// Write the paths to a temporary text file for FFmpeg&#x27;s concat demuxer&#xA;    final String listFilePath = &#x27;${appDir.path}/ffmpeg_list.txt&#x27;;&#xA;    await File(listFilePath).writeAsString(ffmpegInput.toString());&#xA;&#xA;    //check if file exists&#xA;    if(await File(listFilePath).exists()) {&#xA;      print("file exists at $listFilePath");&#xA;&#xA;// Use the generated list file in the concat command&#xA;      String ffmpegCommand = "-v verbose -f concat -safe 0 -i $listFilePath -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 $outputPath";&#xA;      String ffmpegCommand2 = "-v verbose -f concat -safe 0 -i $listFilePath -c:v libx264 $outputPath";&#xA;      String ffmpegCommand3 = "-v verbose -i $singleImagePath -frames:v 1 $outputPath";&#xA;      //print command&#xA;      print("FFmpeg command: $ffmpegCommand");&#xA;&#xA;&#xA;      await FFmpegKit.execute(ffmpegCommand).then((session) async {&#xA;        // Check the session for success or failure&#xA;        final returnCode = await session.getReturnCode();&#xA;        if (returnCode!.isValueSuccess()) {&#xA;          print("Video created successfully: $outputPath");&#xA;          //okay all set, now set the video to be this:&#xA;          _actual_video_file_ready_to_upload = File(outputPath);&#xA;          print ("video path is: ${outputPath}");&#xA;        } else {&#xA;          print("Failed to create video");&#xA;          print("FFmpeg process exited with:" &#x2B; returnCode.toString());&#xA;          // Command failed; capture and log error details&#xA;          await session.getLogsAsString().then((logs) {&#xA;            print("FFmpeg command failed with logs: $logs");&#xA;          });&#xA;          // Handle failure, e.g., by showing an error message&#xA;          showSnackBarHelperERRORWrapLongString(context, "Failed to create video");&#xA;        }&#xA;      });&#xA;&#xA;      //try command 2&#xA;      if(_actual_video_file_ready_to_upload == null) {&#xA;        await FFmpegKit.execute(ffmpegCommand2).then((session) async {&#xA;          // Check the session for success or failure&#xA;          final returnCode = await session.getReturnCode();&#xA;          if (returnCode!.isValueSuccess()) {&#xA;            print("Video created successfully: $outputPath");&#xA;            //okay all set, now set the video to be this:&#xA;            _actual_video_file_ready_to_upload = File(outputPath);&#xA;            print ("video path is: ${outputPath}");&#xA;          } else {&#xA;            print("Failed to create video");&#xA;            print("FFmpeg process exited with:" &#x2B; returnCode.toString());&#xA;            // Command failed; capture and log error details&#xA;            await session.getLogsAsString().then((logs) {&#xA;              print("FFmpeg command failed with logs: $logs");&#xA;            });&#xA;            // Handle failure, e.g., by showing an error message&#xA;            showSnackBarHelperERRORWrapLongString(context, "Failed to create video");&#xA;          }&#xA;        });&#xA;      }&#xA;      //try command 3&#xA;      if(_actual_video_file_ready_to_upload == null) {&#xA;        await FFmpegKit.execute(ffmpegCommand3).then((session) async {&#xA;          // Check the session for success or failure&#xA;          final returnCode = await session.getReturnCode();&#xA;          if (returnCode!.isValueSuccess()) {&#xA;            print("Video created successfully: $outputPath");&#xA;            //okay all set, now set the video to be this:&#xA;            _actual_video_file_ready_to_upload = File(outputPath);&#xA;            print ("video path is: ${outputPath}");&#xA;          } else {&#xA;            print("Failed to create video");&#xA;            print("FFmpeg process exited with:" &#x2B; returnCode.toString());&#xA;            // Command failed; capture and log error details&#xA;            await session.getLogsAsString().then((logs) {&#xA;              print("FFmpeg command failed with logs: $logs");&#xA;            });&#xA;            // Handle failure, e.g., by showing an error message&#xA;            showSnackBarHelperERRORWrapLongString(context, "Failed to create video");&#xA;          }&#xA;        });&#xA;      }&#xA;    }else{&#xA;      print("file does not exist at $listFilePath");&#xA;    }&#xA;  }&#xA;</void>

    &#xA;