Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (68)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

Sur d’autres sites (5805)

  • Why every audio part louder in FFmpeg while I join them in one audio ?

    13 mai 2024, par Volodymyr Bilovus

    I trying to make dubbing for audio. I have original audio track and I want to put translated audio parts on top of the original.

    


    translated audio 100% vol : —p1--- ---p2— -----p3--- —p4—

    


    original audio 5% vol : -----------------------------------------

    


    Here is my FFmpeg command with filter_complex

    


    ffmpeg -i video_wpmXlZF4XiE.opus -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 \
-filter_complex "\
[0:a]loudnorm=I=-14:TP=-2:LRA=7, volume=0.05[original]; \
[1:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=5000|5000, volume=1.0[sent1]; \
[2:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=10000|10000, volume=1.0[sent2]; \
[3:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=20000|20000, volume=1.0[sent3]; \
[4:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=30000|30000, volume=1.0[sent4]; \
[original][sent1][sent2][sent3][sent4]amix=inputs=5:duration=longest[out]" \
-map "[out]" output.mp3


    


    Audios I put on top of the original audio track is the same -i 989-audio.mp3 I made it by purpose to show the problem
And here is the audio levels on final generated track.
enter image description here

    


    As you can see, first and second only slightly different but third
and fourth have totally different(higher) volume level (Notice, audio is the same).
Why it's happened. And how can I workaround this odd behaviour ?

    


  • Why every audio part is louder in FFmpeg when I join them in one audio ?

    14 mai 2024, par Volodymyr Bilovus

    I trying to make dubbing for audio. I have original audio track and I want to put translated audio parts on top of the original.

    


    translated audio 100% vol : —p1--- ---p2— -----p3--- —p4—

    


    original audio 5% vol : -----------------------------------------

    


    Here is my FFmpeg command with filter_complex

    


    ffmpeg -i video_wpmXlZF4XiE.opus -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 \
-filter_complex "\
[0:a]loudnorm=I=-14:TP=-2:LRA=7, volume=0.05[original]; \
[1:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=5000|5000, volume=1.0[sent1]; \
[2:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=10000|10000, volume=1.0[sent2]; \
[3:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=20000|20000, volume=1.0[sent3]; \
[4:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=30000|30000, volume=1.0[sent4]; \
[original][sent1][sent2][sent3][sent4]amix=inputs=5:duration=longest[out]" \
-map "[out]" output.mp3


    


    Audios I put on top of the original audio track is the same -i 989-audio.mp3 I made it by purpose to show the problem
And here is the audio levels on final generated track.
enter image description here

    


    As you can see, first and second only slightly different but third
and fourth have totally different(higher) volume level (Notice, audio is the same).
Why it's happened ? And how can I workaround this odd behaviour ?

    


  • C# server problem with FFmpeg Visual Studio 2022

    16 mai 2024, par seanofdead

    Hello everyone I've spent countless hours on my server I'm trying to create that will share video from one stream to another client computer. That is the goal anyway. I'm using Visual Studio 2022 most recent update. Currently this is my code

    


    using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using FFmpeg.AutoGen;
using NLog;

public class VideoStreamServer
{
    private const int Port = 5000;
    private TcpListener server;
    private FFmpegVideoEncoder encoder;
    private static readonly Logger logger = LogManager.GetCurrentClassLogger();

    public VideoStreamServer()
    {
        // Initialize FFmpeg network components
        Console.WriteLine("Initializing FFmpeg network components...");
        int result = ffmpeg.avformat_network_init();
        if (result != 0)
        {
            throw new ApplicationException($"Failed to initialize FFmpeg network components: {result}");
        }

        // Initialize encoder
        encoder = new FFmpegVideoEncoder(1920, 1080, AVCodecID.AV_CODEC_ID_H264); // Screen size & codec
    }

    public static void Main()
    {
        // Initialize NLog
        var logger = LogManager.GetCurrentClassLogger();
        logger.Info("Application started");

        var server = new VideoStreamServer();
        server.Start().Wait();
    }

    public async Task Start()
    {
        server = new TcpListener(IPAddress.Any, Port);
        server.Start();
        logger.Info($"Server started on port {Port}...");

        try
        {
            while (true)
            {
                TcpClient client = await server.AcceptTcpClientAsync();
                logger.Info("Client connected...");
                _ = HandleClientAsync(client);
            }
        }
        catch (Exception ex)
        {
            logger.Error(ex, "An error occurred");
        }
    }

    private async Task HandleClientAsync(TcpClient client)
    {
        using (client)
        using (NetworkStream netStream = client.GetStream())
        {
            try
            {
                await encoder.StreamEncodedVideoAsync(netStream);
            }
            catch (IOException ex)
            {
                logger.Error(ex, $"Network error: {ex.Message}");
                // Additional logging and recovery actions
            }
            catch (Exception ex)
            {
                logger.Error(ex, $"Unexpected error: {ex.Message}");
                // Log and handle other exceptions
            }
            finally
            {
                // Ensure all resources are cleaned up properly
                client.Close();
                logger.Info("Client connection closed properly.");
            }
        }
    }
}

public class FFmpegVideoEncoder
{
    private readonly int width;
    private readonly int height;
    private readonly AVCodecID codecId;
    private static readonly Logger logger = LogManager.GetCurrentClassLogger();

    public FFmpegVideoEncoder(int width, int height, AVCodecID codecId)
    {
        this.width = width;
        this.height = height;
        this.codecId = codecId;
        InitializeEncoder();
    }

    private void InitializeEncoder()
    {
        // Initialize FFmpeg encoder here
        logger.Debug("FFmpeg encoder initialized");
    }

    public async Task StreamEncodedVideoAsync(NetworkStream netStream)
    {
        // Initialize reusable buffers for efficiency
        byte[] buffer = new byte[4096];

        // Capture and encode video frames
        while (true)
        {
            try
            {
                // Simulate capture and encoding
                byte[] videoData = new byte[1024]; // This would come from the encoder

                // Simulate streaming
                for (int i = 0; i < videoData.Length; i += buffer.Length)
                {
                    int chunkSize = Math.Min(buffer.Length, videoData.Length - i);
                    Buffer.BlockCopy(videoData, i, buffer, 0, chunkSize);
                    await netStream.WriteAsync(buffer, 0, chunkSize);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Error streaming video data");
                throw; // Rethrow to handle in the calling function
            }

            await Task.Delay(1000 / 30); // For 30 FPS
        }
    }
}


    


    When I build no issues but when i run it in debug mode I get this error

    


    System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'avformat.59 under C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\bin\Debug\': The specified module could not be found.
  Source=FFmpeg.AutoGen
  StackTrace:
   at FFmpeg.AutoGen.ffmpeg.LoadLibrary(String libraryName, Boolean throwException)
   at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_0(String libraryName)
   at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_242()
   at FFmpeg.AutoGen.ffmpeg.avformat_network_init()
   at VideoStreamServer..ctor() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 20
   at VideoStreamServer.Main() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 36


    


    I have FFmpeg.AutoGen package installed through VS i originally started with 7.0 but then switched to 5.0 to see if an older version might work (it did not). I also have the files in the same directory as the .exe for testing purposes as seen in the screenshot. Can someone please help me figure out this error.
enter image description here