Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (69)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

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

Sur d’autres sites (10908)

  • FFmpeg output to textfile causing 500 Internal Server Error in PHP

    27 mars 2018, par user3080392

    I have a PHP script with two FFmpeg commands. The first command combines a list of .ts files into a single .ts file and logs the output information into a textfile. The second command converts the combined .ts file into an mp4 file and logs the output information into a textfile.

    Here’s the PHP :

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');

    $ffmpeg = "/usr/local/bin/ffmpeg";
    $vidClips = 'my_vids/vidClipslist.txt';
    $combinedFileTs = 'my_vids/combinedFileTs.ts';
    $logFileCombine = 'my_vids/logFileCombine.txt';
    $logFileConvert = 'my_vids/logFileConvert.txt';
    $combinedFileMp4 = 'my_vids/combinedFileMp4.mp4';

    shell_exec("$ffmpeg -f concat -safe 0 -i $vidClips -c copy $combinedFileTs 1> $logFileCombine 2>&1");

    shell_exec("$ffmpeg -i $combinedFileTs -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 12 $combinedFileMp4 1> $logFileConvert 2>&1");

    echo "Video finished.";
    ?>

    When I run this, my 500.shtml file message is shown on the page. However, I get no other error message echoed to the page nor are there any errors in my Cpanel error log. I also have a php error log set up, but it doesn’t show any errors.
    Oddly, both of the FFmpeg commands do what they’re supposed to, i.e., the "combinedFileTs.ts", "logFileCombine.txt", "combinedFileMp4.mp4", and "logFileConvert.txt" are all created. It’s just that I’m getting the 500 error and the PHP script following the two FFmpeg commands is not being run, i.e., echo "video finished."

    When I remove the output directive on the first FFmpeg command, i.e., "1> $logFileCombine 2>&1", everything works. All the files are created, the proceeding PHP script is run, and I don’t get the 500 error.

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');

    $ffmpeg = "/usr/local/bin/ffmpeg";
    $vidClips = 'my_vids/vidClipslist.txt';
    $combinedFileTs = 'my_vids/combinedFileTs.ts';
    $logFileCombine = 'my_vids/logFileCombine.txt';
    $logFileConvert = 'my_vids/logFileConvert.txt';
    $combinedFileMp4 = 'my_vids/combinedFileMp4.mp4';

    shell_exec("$ffmpeg -f concat -safe 0 -i $vidClips -c copy $combinedFileTs");

    shell_exec("$ffmpeg -i $combinedFileTs -f mpegts -codec:v mpeg1video -bf 0 -codec:a mp2 -q 12 $combinedFileMp4 1> $logFileConvert 2>&1");

    echo "Video finished.";
    ?>    

    Also, the first FFmpeg command takes about 2 min to run. Thinking that the problem was due to the PHP script being killed, I increased the max_execution_time to 600 and the memory_limit to 512M in my php.ini file but that did not fix the problem.

    I need both FFmpeg commands to produce an output log textfile and I need the proceeding PHP code to run.

  • is there a way to change dynamic the water mark text color when using ffmpeg depending on the background color when recording a vieo file ?

    11 juillet 2023, par Shelly Ron

    This command in the command prompt window is working fine and recording the entire screen :

    


    ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p out.mp4


    


    this command prompt add a water mark text in the middle of the screen in white color :

    


    ffmpeg -f gdigrab -framerate 24 -i desktop -vf "drawtext=fontfile=path/to/arial.ttf:text='All rights reserved to ...':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2" -preset ultrafast -pix_fmt yuv420p out.mp4


    


    the problem is that the water mark text is in white and i can see it only when the background window color is black for example when i bring to the front the ffmpeg console window :

    


    water mark

    


    but when it's recording some window with white background, because the text is white it can't be seen.

    


    I want to update the command prompt of the ffmpeg to make somehow dynamic so if the background window is black show the water mark text in white and then if I'm bringing up a window with background white change the water mark text automatic to black.

    


    this is the command i tried for the dynamic effect but it didn't work i got errors and then i tried so many versions of the command line, but nothing helped or worked.

    


    ffmpeg -f gdigrab -framerate 24 -i desktop -filter_complex "[0:v]drawtext=text='Watermark Text':x=(w-text_w)/2:y=(h-text_h)/2:fontfile=arial.ttf:fontsize=24,format=rgba [txt];[txt]split=2 [bw][wc];[bw]lut=r=val*2 [b];[wc]lut=r=val*0.5+0.5:g=val*0.5+0.5:b=val*0.5+0.5 [wc];[wc][b]alphamerge [wm];[wm][0:v]overlay=10:10[outv]" -c:v libx264 -preset ultrafast -map "[outv]" out.mp4


    


    and also tried this

    


    ffmpeg -f gdigrab -framerate 24 -i desktop -filter_complex "[0:v]drawtext=text='Watermark Text':x=(w-text_w)/2:y=(h-text_h)/2:fontfile=Arial.ttf:fontsize=24,format=rgba [txt];[txt]split=2 [bw][wm];[bw][1:v]split=3 [b][g][r];[b]geq=r=0:g=0.5:b=0 [b];[g]geq=r=0:g=0:b=0.5 [g];[r]geq=r=0.5:g=0:b=0 [r];[wm][b][g][r]merge=3,format=rgba [watermark];[0:v][watermark]overlay=x=(W-w)/2:y=(H-h)/2" -map "[watermark]" -map 0:a? -c:v libx264 -c:a copy -preset ultrafast out.mp4


    


  • ffmpeg Using -movflags faststart

    16 mai 2019, par user3571514

    I tried to use the command -movflags faststart

    And got the following error :

    Microsoft Windows [Version 6.0.6002] Copyright (c) 2006 Microsoft
    Corporation. All rights reserved.

    C :\uploads\1\videos>ffmpeg -i simple1.mp4 -codec copy -map 0 -movflags faststart output.mp4

    -movflags faststart output.mp4 ffmpeg version N-34549-g13b7781, Copyright (c) 2000-2011 the FFmpeg developers built on Nov 6 2011
    22:02:08 with gcc 4.6.1 configuration : —enable-gpl
    —enable-version3 —disable-w32threads —enable-ru ntime-cpudetect —enable-avisynth —enable-bzlib —enable-frei0r —enable-libope ncore-amrnb —enable-libopencore-amrwb —enable-libfreetype
    —enable-libgsm —en able-libmp3lame —enable-libopenjpeg —enable-librtmp —enable-libschroedinger -
    -enable-libspeex —enable-libtheora —enable-libvo-aacenc —enable-libvo-amrwben c —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libxavs —enable- libxvid —enable-zlib libavutil 51. 24. 0 / 51. 24. 0 libavcodec 53. 28. 0 / 53. 28.
    0 libavformat 53. 19. 0 / 53. 19. 0 libavdevice 53. 4. 0 / 53.
    4. 0 libavfilter 2. 47. 0 / 2. 47. 0 libswscale 2. 1. 0 / 2. 1. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ’simple1.mp4’ : Metadata :
    major_brand : isom
    minor_version : 512
    compatible_brands : isomiso2avc1mp41
    encoder : Lavf54.29.104 Duration : 00:02:32.81, start : 0.000000, bitrate : 1166 kb/s
    Stream #0:0(und) : Video : h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [ SAR 1:1 DAR 427:240], 1064 kb/s, 29.97 fps, 29.97 tbr, 90k
    tbn, 59.94 tbc
    Metadata :
    handler_name : VideoHandler
    Stream #0:1(und) : Audio : aac (mp4a / 0x6134706D), 44100 Hz, mono, s16, 93 kb /s
    Metadata :
    handler_name : [mp4 muxer @ 04179D00] [Eval @ 0027DAB8] Undefined constant or missing ’(’ in ’f aststart’

    [mp4 muxer @ 04179D00] Unable to parse option value "faststart"

    [mp4 muxer @ 04179D00] Error setting option movflags to value
    faststart.

    Output #0, mp4, to ’output.mp4’ : Metadata :
    major_brand : isom
    minor_version : 512
    compatible_brands : isomiso2avc1mp41
    encoder : Lavf54.29.104
    Stream #0:0(und) : Video : h264, yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=2-3 1, 1064 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
    Metadata :
    handler_name : VideoHandler
    Stream #0:1(und) : Audio : aac, 44100 Hz, mono, 93 kb/s
    Metadata :
    handler_name : Stream mapping : Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy)

    Could not write header for output file #0 (incorrect codec parameters ?)