Recherche avancée

Médias (91)

Autres articles (11)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (4352)

  • mp4 video written with ffmpeg has different first frame based on total number of frames

    26 janvier 2023, par Nitzan Weissman

    I'm trying to read and write videos using ffmpeg, and I got an interesting phenomenon where the first frame is not the same in videos I create that are made from the same frames, only with different lengths.

    


    The commands I'm running to reproduce the problem :

    


    ffmpeg -i .mp4 -frames:v 20 -q:v 3 resource_images/00%04d.png

ffmpeg -hide_banner -loglevel error -framerate 30 -y -i resource_images/00%04d.png  -c:v libx264 -pix_fmt yuv420p -frames:v 20 long_video.mp4 -y

ffmpeg -hide_banner -loglevel error -framerate 30 -y -i resource_images/00%04d.png  -c:v libx264 -pix_fmt yuv420p -frames:v 10 short_video.mp4 -y

ffmpeg -i long_video.mp4 -vf "select=eq(n,0)" -q:v 3 long_frame0.png -y

ffmpeg -i short_video.mp4 -vf "select=eq(n,0)" -q:v 3 short_frame0.png -y


    


    The images long_frame0.png and short_frame0.png are different (I loaded them using Python and compared them, there are many differences).

    


    I find it very peculiar, since I create very short videos, it's those videos first frames, and they are keyframes of those videos (I checked it using ffprobe)

    


    What is the cause of this issue and how do I overcome it to create a consistent first frame for a video, regardless of the video length ?

    


  • With ffmpeg print onto clipped video hh:mm:ss time *from original* and hh:mm:ss total duration from original

    25 mai 2023, par Kes

    I am using arch linux and bash and ffmpeg, all are up to date and the latest versions.

    


    I am clipping a video that is 30 seconds long and wish to clip from 5 secs to 10 seconds to a new file, from the original.

    


    In the bottom right hand corner of the clip I wish to show timestamps from the original video as follows

    


      

    • in the 5th second "00:00:05/ 00:00:30"
    • 


    • in the 6th second "00:00:06/ 00:00:30"
      
etc
    • 


    • in the 10th second "00:00:10/ 00:00:30"
    • 


    


    This is an apparentley simple question(?) but the syntax of the command is not at all obvious and I am hoping an expert may shed some light on this.

    


    All I have so far for the drawtext part, which does not do what I want as it only counts the elapsed time from t=0 of the new clip, whereas I want it to show the timestamp and total duration of the original clip

    


    drawtext I started with

    


    "drawtext=text='%{pts\:gmtime\:0\:%M\\\\\:%S}':fontsize=24:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)"


    


    ffmpeg line with drawtext I have started with

    


    ffmpeg -ss 00:00:05 -i  "$in_file" -filter_complex "drawtext=fontfile=font.ttf:text='sample text':x=10:y=10:fontsize=12:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5,drawtext=text='%{duration\:hms}':fontsize=12:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)" -t 5 -c:a copy -c:v libx264 out_file.mp4


    


  • Getting the total samples of an audio file using ffmpeg.exe in C#

    12 juillet 2023, par hello world

    I'm currently working on a C# project where I need to determine the total number of samples in an audio file using ffmpeg.exe. I've been attempting to achieve this by executing the ffmpeg.exe command within my C# code and parsing the output, but I haven't been successful so far.

    


    Here's the code I've tried :

    


    using System;
using System.Diagnostics;

public class AudioUtils
{
    public static int GetTotalSamples(string audioFilePath)
    {
        string ffmpegPath = "path/to/ffmpeg.exe"; // Path to ffmpeg.exe

        Process process = new Process();
        ProcessStartInfo startInfo = new ProcessStartInfo
        {
            FileName = ffmpegPath,
            Arguments = $"-i \"{audioFilePath}\" -af \"volumedetect\" -vn -sn -dn -f null /dev/null 2>&1",
            RedirectStandardOutput = true,
            RedirectStandardError = true,
            UseShellExecute = false,
            CreateNoWindow = true
        };

        process.StartInfo = startInfo;
        process.Start();

        string output = process.StandardError.ReadToEnd();
        process.WaitForExit();

        int totalSamples = 0;
        // Parsing logic to extract total samples from output goes here...

        return totalSamples;
    }
}


    


    I suspect there might be an issue with the command or the parsing logic in the code snippet above. Could someone please guide me on how to correctly execute ffmpeg.exe and extract the total number of samples from the output in C# ? Any insights, alternative approaches, or modifications to the code would be greatly appreciated. Thank you in advance for your assistance !