Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (76)

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

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

Sur d’autres sites (8955)

  • How to recognize that ffmpeg pipe ended ?

    30 juillet 2023, par Veronica

    I am executing an ffmpeg command with a very complex filter and with a pipe within a C# application. I am putting images into the ffmpeg input stream (pipe)for rendering these images as overlays to the final video.

    


    I want to render images with the pipe until the pipe closes. Unfortunately, I do not know how I can recognize that the pipe of the ffmpeg process has closed. Is there any possibility of recognizing this event within C# ?

    


    The process is started like :

    


    this._ffmpegProcess = new Process
{
    StartInfo = new ProcessStartInfo
    {
        FileName = this._ffmpegPath,
        UseShellExecute = false,
        RedirectStandardInput = true,
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        CreateNoWindow = true
    }
};

this._ffmpegProcess.StartInfo.Arguments = ffmpegCmd;
this._ffmpegProcess.OutputDataReceived += this.Proc_DataReceived;
this._ffmpegProcess.ErrorDataReceived += this.Proc_DataReceived;
this._ffmpegProcess.Exited += this._ffmpegProcess_Exited;
this._ffmpegProcess.Start();
this._ffmpegProcess.BeginOutputReadLine();
this._ffmpegProcess.BeginErrorReadLine();


    


    The rendering happens within a timer :

    


    this._renderOverlayTimer = new Timer(this.RenderOverlay);
this._renderOverlayTimer.Change(0, 30);    


    


    The timer is started right after starting the ffmpeg process :

    


    private void RenderOverlay(object state)
{
   using (var ms = new MemoryStream())
   {
      using (var img = GetImage(...))
      {
          img.Save(ms, ImageFormat.Png);
          ms.WriteTo(this._ffmpegProcess.StandardInput.BaseStream);
      }
   }
}


    


    The problem is that I always receive a "The pipe has ended" error at ms.WriteTo().

    


  • nginx-rtmp module with ffmpeg

    1er janvier 2017, par sara

    I am new in video live streaming.I searched and found nginx-rtmp module to create a my media server,
    when i saw that ,
    i understood that we can run ffmpeg command in ngnix to transcode my video , or create a hls-variants , and this commands apply on videos on the fly . am i true ?

    if it is true , so with large video it takes a long time to tarnscode on the fly .so i wanna to execute my ffmpeg command when i sotre my video in my hls file path. so i create a hls files(.ts) first with running ffmpeg commands.and then i serve my files with ngnix-rtmp module.

    now my question is this 2 approaches(run async and sync(on the fly) ffmpeg command ) are true ?
    i saw a lot of example that implement first approach.and i interested in using second approach .second approach is not a common approach ?why ?is this approach has a problem and issue that i am not aware of that ?
    tnx

  • How to parallelize ffmpeg setPTS filter when using GPU ? [closed]

    28 février, par Souvic Chakraborty

    We have a long python code which chunks the video into multiple parts and changes the speed using setPTS filter.

    


    import ffmpeg
ffmpeg.input(segment_path).filter("setpts", f"{1/speed_factor}*PTS").output(
                                adjusted_segment_path,vcodec="h264_nvenc", acodec="aac",preset="fast", crf=23, g=30, keyint_min=30, sc_threshold=0,r=30,vsync='cfr',threads=1
                            ).global_args("-hwaccel", "cuda").run(quiet=True, overwrite_output=True,capture_stdout=True, capture_stderr=True)


    


    Now, because this happens multiple times before concatenation, we thought, instead of sequential processing using a ThreadPool, it may help reduce the time.
So we did that :

    


    import ffmpeg
import concurrent.futures

def process_video(segment_path, adjusted_segment_path, speed_factor):
    ffmpeg.input(segment_path).filter("setpts", f"{1/speed_factor}*PTS").output(
        adjusted_segment_path,
        vcodec="h264_nvenc",
        acodec="aac",
        preset="fast",
        crf=23,
        g=30,
        keyint_min=30,
        sc_threshold=0,
        r=30,
        vsync='cfr',
        threads=1
    ).global_args("-hwaccel", "cuda").run(
        quiet=True, overwrite_output=True, capture_stdout=True, capture_stderr=True
    )


segment_paths = ["input1.mp4", "input2.mp4", "input3.mp4"]  # List of input video segments
output_paths = ["output1.mp4", "output2.mp4", "output3.mp4"]  # Corresponding output paths
speed_factor = 1.5  

# Using ThreadPoolExecutor for concurrent processing
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
    futures = [
        executor.submit(process_video, seg, out, speed_factor)
        for seg, out in zip(segment_paths, output_paths)
    ]
    
    # Wait for all tasks to complete
    for future in concurrent.futures.as_completed(futures):
        try:
            future.result()  # This will raise any exceptions encountered in the thread
        except Exception as e:
            print(f"Error processing video: {e}")


    


    But the time required did not reduce. Previously, it was 50 seconds for a long video input, now too, it remains the same.

    


    Is there any other way I can improve the code ?

    


    I also noticed the GPU utilization is low and the code is still executed sequentially (I can see when I run nvtop, which processes are running)

    


    I am using an L4 GPU with CUDA Version : 12.4, nvcc CUDA Toolkit is also at 12.4