Recherche avancée

Médias (91)

Autres articles (88)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (11320)

  • Failed to run the ffmpeg binary : The process "ffmpeg exceeded the timeout of 60 seconds

    6 janvier 2024, par Sufian The Geek

    I am using FSPOSTER wordpress plugin to share videos on instagram as a reels and story. I have installed wordpress on amazon aws ec2 t2.micro. FsPoster required FFmpeg plugin to work with the videos.

    


    Whenever I share the video, I get error after 60 seconds. There are some videos that are easily getting shared as a reel and story. I looked into the plugin code and changed every single timeout function value to 300 seconds including php.ini file. There are some libraries like symfony in the plugin, I also changed the timeout 60 sec to 300 seconds. Restarted the server and all but still getting the error.

    


    


    Failed to run the ffmpeg binary : The process "'ffmpeg' -v error -y -i '/opt/bitnami/wordpress/wp-content/uploads/2024/01/videoWater-First-18.mp4' -vf 'crop=w=1280:h=720:x=0:y=0' -metadata:s:v rotate="" -f mp4 -c:v libx264 -preset fast -crf 24 -strict -2 -c:a aac -b:a 96k '/tmp/fs_65994ac0ddf8b.mp4'" exceeded the timeout of 60 seconds.

    


    


    I am using bitnami wordpress on ec3 aws t2.micro that has 1 vcpu and 1 GB ram. I also switched to 2 vcpu and 8 gb ram but still this timeout issue.

    


  • "How can we use Ffmpeg to apply blur, overlay a logo and waveform, and add a border around a video, step by step ? [closed]

    1er février 2024, par itsfaisalkhalid

    We're looking to enhance a video using Ffmpeg by implementing several effects sequentially. First, we aim to apply a blur effect to the entire video. Then, we want to overlay a logo and a waveform onto the blurred video. Finally, we need to add a border around the entire composition. This step-by-step process requires precise commands and careful consideration of parameters to achieve the desired result effectively.

    


    I utilized Ffmpeg commands to sequentially apply blur, overlay the logo and waveform, and add a border to the video. I expected each effect to be applied in the specified order, resulting in a visually enhanced video with all desired elements. However, I encountered challenges in properly configuring the parameters for each effect, leading to unexpected results such as misaligned overlays or improper blur intensity.

    


    @echo off
setlocal enabledelayedexpansion

rem Set paths and directories
set "ffmpeg_path=C:\ffmpeg\bin\ffmpeg.exe"
set "input_dir=_input"
set "output_dir=_output"

rem Ensure input and output directories exist
if not exist "%input_dir%" (
    echo Error: Input directory "%input_dir%" not found.
    exit /b 1
)

if not exist "%output_dir%" (
    mkdir "%output_dir%"
)

rem Loop through input directory
for %%t in ("%input_dir%\*.*") DO (

    rem Process each file with ffmpeg
"%ffmpeg_path%" -y -i "%%t" -i logo.png -filter_complex "\
    [0:v]eq=brightness=0.2:saturation=2.0:contrast=1.2, crop=iw/1.2:ih/1.2, \
    boxblur=1:2 [blurred_bg]; \
    [blurred_bg][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h-10)[bg_with_logo]; \
    [0:a]showwaves=s=1080x100:mode=line:colors=white [waveform]; \
    [bg_with_logo][waveform]overlay=10:H-h-10, \
    format=yuv420p[v]; \
    [v]pad=iw+20:ih+20:x=10:y=10:color=white[final_output]" \
    -map "[final_output]" -map 0:a -c:v h264 -c:a aac -b:a 128k -ar 44100 "%output_dir%\temp.mp4"

    rem Check if output file exists
    if exist "%output_dir%\temp.mp4" (
        rem Calculate new MD5 hash
        certutil -hashfile "%output_dir%\temp.mp4" MD5 > "%output_dir%\temp_md5.txt"

        rem Remove ID3 tag metadata
        "%ffmpeg_path%" -i "%output_dir%\temp.mp4" -map_metadata -1 -c:v copy -c:a copy "%output_dir%\%%~nt.mp4"

        rem Clean up temporary files
        del "%output_dir%\temp.mp4"
        del "%output_dir%\temp_md5.txt"
    ) else (
        echo Error: Failed to create output file for "%%~nt"
    )
)

pause



    


  • Flutter : How to use "ffmpeg_kit_flutter" to merge videos ?

    28 mai 2024, par Hani Kanakri

    i am using "ffmpeg_kit_flutter" to merge two videos with code

    


    &#xA;import &#x27;dart:io&#x27;;&#xA;&#xA;import &#x27;package:ffmpeg_kit_flutter/ffmpeg_kit.dart&#x27;;&#xA;import &#x27;package:ffmpeg_kit_flutter/abstract_session.dart&#x27;;&#xA;import &#x27;package:ffmpeg_kit_flutter/return_code.dart&#x27;;&#xA;import &#x27;package:flutter/material.dart&#x27;;&#xA;import &#x27;package:flutter_bloc/flutter_bloc.dart&#x27;;&#xA;import &#x27;package:wechat_assets_picker/wechat_assets_picker.dart&#x27;;&#xA;&#xA;import &#x27;/features/merge_videos/cubit/merge_videos_state.dart&#x27;;&#xA;&#xA;class MergeVideosCubit extends Cubit<mergevideosstate> {&#xA;  MergeVideosCubit(this.originalFile) : super(InitialMergeVideos());&#xA;  final File? originalFile;&#xA;&#xA;  Future<void> selectVideo(BuildContext context) async {&#xA;    final List<assetentity>? videos = await AssetPicker.pickAssets(&#xA;      context,&#xA;      pickerConfig: const AssetPickerConfig(requestType: RequestType.video),&#xA;    );&#xA;&#xA;    if (videos != null &amp;&amp; videos.isNotEmpty) {&#xA;      for (AssetEntity asset in videos) {&#xA;        File? videoFile = await asset.file;&#xA;        if (videoFile != null) {&#xA;          print(&#x27;Selected Asset Path: ${videoFile.path}&#x27;);&#xA;          mergeVideos(originalFile!.path, videoFile.path);&#xA;        }&#xA;      }&#xA;    }&#xA;  }&#xA;&#xA;  Future<void> mergeVideos(String inputPath1, String inputPath2) async {&#xA;    final String outputPath = "/storage/emulated/0/merged_video_${now()}.mp4";&#xA;    // final String command =&#xA;    //     &#x27;-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" -y $outputPath&#x27;;&#xA;    final String command =&#xA;        &#x27;-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y $outputPath&#x27;;&#xA;    print("FFmpeg process starting with command: $command");&#xA;    print(command);&#xA;    print("LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE");&#xA;    emit(LoadMergeVideos());&#xA;    await FFmpegKit.execute(command).then((value) async {&#xA;      await value.getDuration();&#xA;      var id = await value.getSessionId();&#xA;&#xA;      print(value);&#xA;      print(id);&#xA;      print(await value.getDuration());&#xA;    });&#xA;    await FFmpegKit.executeAsync(command, (session) async {&#xA;      final returnCode = await session.getReturnCode();&#xA;      await session.getSessionId();&#xA;      print(await session.getSessionId());&#xA;&#xA;      if (ReturnCode.isSuccess(returnCode)) {&#xA;        print("SUCCESS: Video merged successfully at $outputPath");&#xA;        print("SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS MERGE");&#xA;        emit(SuccessMergeVideos());&#xA;&#xA;      } else if (ReturnCode.isCancel(returnCode)) {&#xA;        print("CANCELLED: Video merging was cancelled.");&#xA;        print("CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL MERGE");&#xA;        emit(CancelMergeVideos());&#xA;&#xA;      } else {&#xA;        print("ERROR: Failed to merge videos.");&#xA;        print("ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE");&#xA;        emit(ErrorMergeVideos());&#xA;&#xA;        final failLog = await session.getFailStackTrace();&#xA;&#xA;        print("FFmpeg Failure Log: $failLog");&#xA;      }&#xA;    });&#xA;  }&#xA;&#xA;  String now() {&#xA;    final DateTime now = DateTime.now();&#xA;    return "${now.year}${now.month}${now.day}_${now.hour}${now.minute}${now.second}";&#xA;  }&#xA;}&#xA;</void></assetentity></void></mergevideosstate>

    &#xA;

    The console when i run the code

    &#xA;

    &#xA;D/EGL_emulation(23858): app_time_stats: avg=2379.66ms min=5.87ms max=23160.09ms count=10&#xA;I/PhotoManager(23858): uri: content://media/external/file&#xA;I/PhotoManager(23858): projection: _display_name, _data, _id, title, bucket_id, bucket_display_name, width, height, orientation, date_added, date_modified, mime_type, datetaken, duration, media_type, relative_path&#xA;I/PhotoManager(23858): selection: _id = ?&#xA;I/PhotoManager(23858): selectionArgs: 1000000039&#xA;I/PhotoManager(23858): sortOrder: null&#xA;I/PhotoManager(23858): sql: _id = 1000000039&#xA;I/PhotoManager(23858): cursor count: 1&#xA;I/flutter (23858): Selected Asset Path: /storage/emulated/0/Movies/VID_20240512_115116.mp4&#xA;I/flutter (23858): FFmpeg process starting with command: -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;I/flutter (23858): -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;I/flutter (23858): LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE&#xA;I/flutter (23858): Instance of &#x27;FFmpegSession&#x27;&#xA;I/flutter (23858): 1&#xA;I/flutter (23858): 246&#xA;I/flutter (23858): 2&#xA;I/flutter (23858): ERROR: Failed to merge videos.&#xA;I/flutter (23858): ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE&#xA;D/EGL_emulation(23858): app_time_stats: avg=87.27ms min=4.92ms max=319.92ms count=13&#xA;I/flutter (23858): FFmpeg Failure Log: null&#xA;

    &#xA;

    In "mergeVideos" function the "returnCode" it return value "1" when i look in the package code

    &#xA;

    getState() async {&#xA;    try {&#xA;      return _platform&#xA;          .abstractSessionGetState(this.getSessionId())&#xA;          .then((state) {&#xA;        switch (state) {&#xA;          case 0:&#xA;            return SessionState.created;&#xA;          case 1:&#xA;            return SessionState.running;&#xA;          case 2:&#xA;            return SessionState.failed;&#xA;          case 3:&#xA;          default:&#xA;            return SessionState.completed;&#xA;        }&#xA;      });&#xA;    } on PlatformException catch (e, stack) {&#xA;      print("Plugin getState error: ${e.message}");&#xA;      return Future.error("getState failed.", stack);&#xA;    }&#xA;}&#xA;

    &#xA;

    Which mean its keep running but in my code it does not wait until complete merging

    &#xA;

    how can i fix that ??!

    &#xA;

    but i think my problem is in command(concat)

    &#xA;

    &#xA;-i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4&#xA;

    &#xA;

    (This is my command when i run the code) ??

    &#xA;