Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (26)

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

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

Sur d’autres sites (4739)

  • Revision 39957 : afficher en cas de server down + rangement dans le script

    20 août 2010, par fil@… — Log

    afficher en cas de server down + rangement dans le script

  • ffmpeg / python script - is it actually doing anything ?

    13 août 2021, par Mark Cornbill

    I downloaded the following script - it is not my own work ; it came with another Python script which scans through a folder of Rocket League gameplay videos, looking for moments where a goal has been scored (using tesseract-OCR), and then logs the clip filename and frame into a csv file called "detected.csv".

    


    That part has all worked now I've figured it all out ! It is the second part, this script is supposed to read the "detected.csv" list of files and frame numbers, to then trim and create the new video clips and output them to a folder. The code looks like this :

    


    import ntpath
import os

detectedGoalList = []
f = open("detected.csv", "r")
for x in f:
    tup = x.replace("\"[", "").replace("]\"", "").split(", ")
    print(x)
    detectedGoalList.append([tup[0], tup[1]])


for dg in detectedGoalList:
    print(dg[0])
    input_file = "\"{}\"".format(dg[0].replace("'", ""))
    output_path = "../clips/" + ntpath.basename(dg[0]).replace("'", "").replace(
    ".mp4", "").replace("Rocket League®_", "").replace("Rocket League™_", "").replace("Rocket 
    League_", "") + ".clipped.mp4"
    start = (int(dg[1]) - int(30 * 10)) / 30
    if start < 0:
       start = 0
    end = (int(dg[1]) / 30) - 3
    duration = end - start

    os.system("ffmpeg -ss {} -i {} -t {} -c copy {}".format(start, input_file,
                                                        duration, output_path))


    


    The script runs instantly and returns no errors. It doesn't log anything to the terminal. It doesn't output any new clips. I have 5 mp4 files in the "clips" directory that match in the csv file exactly. The "detected.csv" file contains the following :

    


    "['K:/Gameplay Videos/Rocket League/goals/clips\\goal(2).mp4', 1750]"
"['K:/Gameplay Videos/Rocket League/goals/clips\\goal(28).mp4', 1200]"
"['K:/Gameplay Videos/Rocket League/goals/clips\\goal(3).mp4', 3350]"
"['K:/Gameplay Videos/Rocket League/goals/clips\\goal(4).mp4', 3050]"
"['K:/Gameplay Videos/Rocket League/goals/clips\\goal(5).mp4', 3500]"


    


    So I'm pretty sure that the final ffmpeg line is the culprit. I understand basic command line ffmpeg syntax but when it's part of Python code and variables I just can't figure it out. I see reference to the number "30" a lot - maybe the guy who wrote this had 30fps videos as his source (they were after all Playstation replays), I have 60fps videos. I've tried changing those numbers to 60 to no avail.

    


  • Powershell script finishes after the first ffmpeg call

    25 mars 2014, par sk904861

    The following Powershell script only executes the first ffmpeg call, no matter which one is first. Both the ffmpeg and the powershell processes never finish. Stopping the server, however, leads to the processes finishing and suddenly the second picture also appears.

    Param($InputFile, $OutputFile, $Thumbnail, $Sprites)

    $ThumbnailWidth = 120
    $ThumbnailHeight = 120

    # Thumbnail
    ffmpeg -i $InputFile -f image2 -vframes 1 -filter:v "crop=min(iw\,ih):min(iw\,ih), scale=$($ThumbnailWidth):$($ThumbnailHeight)" -crf 18 "$($Thumbnail)\150x150.png"

    # Poster
    ffmpeg -i $InputFile -f image2 -vframes 1 -filter:v "crop=min(iw\,ih):min(iw\,ih), scale=$($PosterWidth):$($PosterHeight)" -crf 18 "$($Thumbnail)\1000x1000.png"

    The script gets called within an ASP.NET application as follows :

    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.FileName = "powershell.exe";
    startInfo.Arguments = String.Format("-executionpolicy RemoteSigned -file \"{0}\" \"{1}\" \"{2}\" \"{3}\" \"{4}\"", scriptPath, fullPath, videoPath, thumbnailPath, sprites);
    startInfo.RedirectStandardOutput = true;
    startInfo.RedirectStandardError = true;
    startInfo.UseShellExecute = false;
    startInfo.CreateNoWindow = true;
    Process process = new Process();
    process.StartInfo = startInfo;

    process.EnableRaisingEvents = true;
    process.Exited += delegate
    {
        // Do some cleaning up
    };

    process.Start();

    Does anyone have a clue, why only the first the two ffmpeg calls is working, while each call seems to be correct ?

    Adding process.StandardError.ReadToEnd(); makes the script finish as expected, but also makes it block, which is not acceptable.