Recherche avancée

Médias (91)

Autres articles (88)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (10729)

  • ffmpeg crash when updating overlay file (c# console app)

    24 décembre 2024, par Vlad Stefan

    I am trying to develop a console app that can record the screen and have cpu/ram/gpu usage of the machine noted on the recording. The problem i am facing is that after a while (2-3 hours) the recording stops because ffmpeg is trying to read the file text while my C# code tries to update the file. I managed to find out that I should use a temp file and replace the original instead of rewriting the whole file but that way I encounter another problem, ffmpeg will try to read the file while the file is replaced or even for that split second when is considered deleted. Any ideas what I should do ? How should the method with the temp file be managed or how can I make the method that updates the same file stable ? I was even thinking to increment the ffmpeg reload frames since it might narrow the chances of crashing but it's not a 100% crash proof solution.

    


    Error message received from ffmpeg with updating only the text from the file :

    


    Error: [Parsed_drawtext_0 @ 000001e68fd95dc0] [FILE @ 0000009fb7ffee70] Error occurred in CreateFileMapping()
Error: [Parsed_drawtext_0 @ 000001e68fd95dc0] The text file 'OverlayFiles/OverlayFile_MyPC.txt' could not be read or is empty
Error: [vf#0:0 @ 000001e68fd48300] Error while filtering: Operation not permitted
Error: [vf#0:0 @ 000001e68fd48300] Task finished with error code: -1 (Operation not permitted)


    


    Error message received from ffmpeg with the use of a temp file that's replacing the original file :

    


    Error: [Parsed_drawtext_0 @ 0000014c815e6200] [FILE @ 000000253d7fee70] Cannot read file 'OverlayFiles/OverlayFile_MyPC.txt': Permission denied
Error: [Parsed_drawtext_0 @ 0000014c815e6200] The text file 'OverlayFiles/OverlayFile_MyPC.txt' could not be read or is empty
Error: [vf#0:0 @ 0000014c81597280] Error while filtering: Permission denied
Error: [vf#0:0 @ 0000014c81597280] Task finished with error code: -13 (Permission denied)
Error: [vf#0:0 @ 0000014c81597280] Terminating thread with return code -13 (Permission denied)


    


    ffmpeg arguments :

    


    string arguments = $"-video_size 1920x1080 -framerate 30 -f gdigrab -i desktop -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 " +
                   $"-vf \"drawtext=fontfile=C\\\\:/Windows/fonts/consola.ttf:fontsize=30:fontcolor='white':textfile={overlayFilePath_}:boxcolor=0x00000080:box=1:x=10:y=H-210:reload=1\" \"" + 
                   outputFile + "\"";


    


    The code that updates the overlay file (1st version) :

    


    public void UpdateOverlayText(string filePath)
{
    string usage = GetSystemUsage(filePath);  // Get the system usage data

    try
    {
        // Open the file with FileShare.ReadWrite to allow other processes to read it while writing
        using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite))
        {
            using (var writer = new StreamWriter(fileStream))
            {
                writer.Write(usage);  // Write the system usage data to the file
            }
        }

        // Ensure file permissions are set correctly after writing
        SetFilePermissions(filePath);
    }
    catch (IOException ex)
    {
        Console.WriteLine($"Error updating overlay file: {ex.Message}");
    }
}


    


    (UPDATE)Code that updates overlay file using MemoryStream :

    


    public void UpdateOverlayText(string filePath)
{
    string usage = GetSystemUsage(filePath);

    try
    {
        using (var memoryStream = new MemoryStream())
        {
            using (var writer = new StreamWriter(memoryStream))
            {
                writer.Write(usage);
                writer.Flush();

                memoryStream.Position = 0;

                File.WriteAllBytes(filePath, memoryStream.ToArray());
            }
        }

        SetFilePermissions(filePath);
    }
    catch (IOException ex)
    {
        Console.WriteLine($"Error updating overlay file: {ex.Message}");
    }
}


    


    Code tested using MemoryStream and Temp file :

    


    public void UpdateOverlayText(string filePath)
{
    string usage = GetSystemUsage(filePath);
    string tempFilePath = filePath + ".tmp";
    try
    {
        // Write to a temporary file first
        using (var memoryStream = new MemoryStream())
        {
            using (var writer = new StreamWriter(memoryStream))
            {
                writer.Write(usage);
                writer.Flush();

                memoryStream.Position = 0;
                File.WriteAllBytes(tempFilePath, memoryStream.ToArray());
            }
        }
        File.Replace(tempFilePath, filePath, null);
    }
    catch (IOException ex)
    {
        Console.WriteLine($"Error updating overlay file: {ex.Message}");
    }
    finally
    {
        if (File.Exists(tempFilePath))
        {
            File.Delete(tempFilePath);
        }
    }
}


    


    Thanks in advance for your help and sorry for any typo or wrong phrases I used.

    


  • Show the filename being processed when using an input list and an error occurs ?

    17 février 2024, par GeoNomad

    I am concatenating a large number of short files using a list.

    


    One in a hundred seems to have an error of one sort or another which stops the processing.

    


      

    1. Is there a way to tell ffmpeg to just drop the bad frame or even bad file and continue ?

      


    2. 


    3. If not, is there a way to know what file has the error so I can just remove that file from the list ?

      


    4. 


    


    ffmpeg -safe 0  -f concat -i list.txt -c copy FEEDER.mp4

    


    I have tried -loglevel verbose, but that did not help.

    


    [concat @ 0000022d22b23480] h264_mp4toannexb filter failed to receive output packet
Error demuxing input file 0: Invalid data found when processing input
Terminating demuxer thread 0
list.txt: Invalid data found when processing input


    


    How do I find out which file of the several hundred files in list.txt is the culprit ?

    


    As it happens, these files have time stamps and I can find it by looking at the last output frame and then deleting the appropriate file. But it seems there should be a better way.

    


    FWIW I am working in Windows cmd.exe or Powershell Terminal

    


  • How can I debug this rtmp stream ? It wont play on Vlc, and logs show no error

    12 avril 2020, par SquirrelSenpai

    I am creating a rtmp stream using FFMPEG and sending the data to local NGINX server with the RTMP module.

    



    When playing the stream in VLC I am unable to hear any music. Have I missed something ?

    



    No FFMPEG errors according to logs

    



    fmpeg -hide_banner -loglevel warning -i http://x.x.x.x:8138 -f mp3 rtmp://localhost/live


    



    To test VLC >> Open Network Stream >> rtmp ://localhost/live

    



    Nginx.conf

    



    worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

rtmp_auto_push on;

rtmp{

        server{

                listen 1935;

                application live {

                        # enable live streaming
                        live on;
                        record off;

                        # publish only from localhost
                        allow publish all;
                        allow play all;

                }

        }

}