Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (43)

  • 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 ;

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

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

Sur d’autres sites (5553)

  • Using Flutter FFMPEG_KIT to convert a sequence of RGBA images into a mp4 video

    30 avril 2023, par jdevp2

    I’m trying to convert a sequence of RGBA byte images into an MP4 video by using Flutter FFMPEGKit package. The following is the code snippet but it gives me an error. I’m not sure what is the correct option that I should use to convert a set of rawrgba images to a video. I appreciate any help.

    


     static Future<void> videoEncoder() async {&#xA;    appTempDir = &#x27;${(await getTemporaryDirectory()).path}/workPath&#x27;;&#xA;   &#xA;    FFmpegKit.execute(&#xA;           &#x27;-hide_banner -y -f rawvideo -pix_fmt rgba -i appTempDir/input%d.rgba -c:v mpeg4  -r 12 appTempDir/output.mp4&#x27;)&#xA;     .then((session) async {&#xA;       final returnCode = await session.getReturnCode();&#xA;      if (ReturnCode.isSuccess(returnCode)) {&#xA;        print(&#x27;SUCCESS&#x27;);&#xA;      } else if (ReturnCode.isCancel(returnCode)) {&#xA;        print(&#x27;CANCEL&#x27;);&#xA;      } else {&#xA;        print(&#x27;ERROR&#x27;);&#xA;      }&#xA;    });&#xA;  }&#xA;}&#xA;</void>

    &#xA;

    The image rgba data is saved via the following code snippet.

    &#xA;

    Utils.getBuffer(renderKey).then((value) async {&#xA;        ui.Image buffer = value;&#xA;        final data =&#xA;            await buffer!.toByteData(format: ui.ImageByteFormat.rawRgba);&#xA;        Uint8List uData = data!.buffer.asUint8List();&#xA;        VideoUtil.saveImageFileToDirectory(uData, &#x27;input$frameNum.rgba&#x27;);&#xA;        frameNum&#x2B;&#x2B;;&#xA;        });&#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;

  • ffmpeg adelay audio out of sync

    30 juillet 2022, par benyamin

    im using ffmpeg to merge/mix some audio files and put each audio stream at a specific time using adelay and im using amix to get a single stream at the end.

    &#xA;

    here is exactly what im doing :

    &#xA;

    &#xA;

    ffmpeg -i ./recFiles/1659162768910.webm -i ./recFiles/1659162867370.webm -i ./recFiles/1659162981321.webm -i ./recFiles/1659163143645.webm -i ./recFiles/1659163404833.webm -i ./recFiles/1659162778530.webm -i ./recFiles/1659162827630.webm -i ./recFiles/1659162879510.webm -i ./recFiles/1659162895790.webm -i ./recFiles/1659162985833.webm -i ./recFiles/1659163160042.webm -i ./recFiles/1659163247185.webm -i ./recFiles/1659162821149.webm -i ./recFiles/1659162875630.webm -i ./recFiles/1659162995533.webm -i ./recFiles/1659163150526.webm -i ./recFiles/1659163159313.webm -i ./recFiles/1659163258913.webm -i ./recFiles/1659163279414.webm -i ./recFiles/1659163328226.webm -i ./recFiles/1659163381885.webm -i ./recFiles/1659163412389.webm -i ./recFiles/1659163454570.webm -filter_complex "[0]adelay=150:all=1[a0] ;[1]adelay=98642:all=1[a1] ;[2]adelay=212549:all=1[a2] ;[3]adelay=374873[a3] ;[4]adelay=636061:all=1[a4] ;[5]adelay=9801:all=1[a5] ;[6]adelay=58862:all=1[a6] ;[7]adelay=110738:all=1[a7] ;[8]adelay=127022:all=1[a8] ;[9]adelay=217061:all=1[a9] ;[10]adelay=391269:all=1[a10] ;[11]adelay=478413:all=1[a11] ;[12]adelay=52423:all=1[a12] ;[13]adelay=106861:all=1[a13] ;[14]adelay=226765[a14] ;[15]adelay=381758:all=1[a15] ;[16]adelay=390542:all=1[a16] ;[17]adelay=490141:all=1[a17] ;[18]adelay=510642:all=1[a18] ;[19]adelay=559458:all=1[a19] ;[20]adelay=613118:all=1[a20] ;[21]adelay=643621[a21] ;[22]adelay=685797[a22] ;[a0][a1][a2][a3][a4][a5][a6][a7][a8][a9][a10][a11][a12][a13][a14][a15][a16][a17][a18][a19][a20][a21][a22]amix=23,loudnorm[final]" -map "[final]" -metadata title="example.com - a title" ./recFiles/rec28314068fe97c6_1659163923005.webm

    &#xA;

    &#xA;

    all the numbers are calculated and correct but it doesn't seems so in the output file.&#xA;some streams are out of sync ( sometimes all of them )

    &#xA;

    my ffmpeg version is :&#xA;ffmpeg version n4.4.1-2-gcc33e73618

    &#xA;

    can anyone please help me with this ? i can't see what's wrong.. it should work

    &#xA;