Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (77)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (14149)

  • ffmpeg process how to read from pipe to pipe in c#

    28 janvier 2024, par greg

    I need to read audio data from stream 1 to stream 2 passing the data through ffmpeg.
It works great when i input data from file and output to pipe :

    


    Process? CreateStream()
{
    return Process.Start(new ProcessStartInfo
    {
        FileName = @"sources\ffmpeg",
        Arguments = @"-i input.mp3 -f s16le pipe:1",
        UseShellExecute = false,
        RedirectStandardOutput = true
    });
}


    


    Or when i input data from pipe and output to file :

    


    Process? CreateStream()
{
    return Process.Start(new ProcessStartInfo
    {
        FileName = @"sources\ffmpeg",
        Arguments = @"-i pipe: -f s16le output.file",
        UseShellExecute = false,
        RedirectStandardInput = true
    });
}


    


    But if i try to do both :

    


    Process? CreateStream()
{
    return Process.Start(new ProcessStartInfo
    {
        FileName = @"sources\ffmpeg",
        Arguments = @"-i pipe:0 -f s16le pipe:1",
        UseShellExecute = false,
        RedirectStandardInput = true,
        RedirectStandardOutput = true
    });
}


    


    Runtime will hang in place printing :

    


    


    Input #0, matroska,webm, from 'pipe:0' :
Metadata :
encoder : google/video-file
Duration : 00:04:15.38, start : -0.007000, bitrate : N/A
Stream #0:0(eng) : Audio : opus, 48000 Hz, stereo, fltp (default)
Stream mapping :
Stream #0:0 -> #0:0 (opus (native) -> pcm_s16le (native))

    


    Output #0, s16le, to 'pipe:1' :
Metadata :
encoder : Lavf59.27.100
Stream #0:0(eng) : Audio : pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata :
encoder : Lavc59.37.100 pcm_s16le

    


    


    main function code (it is the same for all examples) :

    


    async Task Do()
{
    using (var ffmpeg = CreateStream())
    {
        if (ffmpeg == null) return;

        using (var audioStream = GetAudioStream())
        {
            await audioStream.CopyToAsync(ffmpeg.StandardInput.BaseStream);
            ffmpeg.StandardInput.Close();
        }

        //runtime will hang in here

        Console.WriteLine("\n\ndone\n\n"); //this won't be printed

        using (var outputStream = CreatePCMStream())
        {
            try
            {
                await ffmpeg.StandardOutput.BaseStream.CopyToAsync(outputStream);
            }
            finally
            {
                await outputStream.FlushAsync();
            }
        }
    }
}


    


    And the most interesting is if i remove RedirectStandardOutput = true string programm will work as expected printing a bunch of raw data to the console.

    


    I'd like to solve this problem without using any intermediate files and so on.

    


  • Matplotlib pipe canvas.draw() to ffmpeg - unexpected result [duplicate]

    31 juillet 2022, par Narusan

    I'm using this code from here to try and pipe multiple matplotlib plots into ffmpeg to write a video file :

    


    import numpy as np
import matplotlib.pyplot as plt
import subprocess

xlist = np.random.randint(100,size=100)
ylist = np.random.randint(100, size=100)
color = np.random.randint(2, size=100)

f = plt.figure(figsize=(5,5), dpi = 300)
canvas_width, canvas_height = f.canvas.get_width_height()
ax = f.add_axes([0,0,1,1])
ax.axis('off')


# Open an ffmpeg process
outf = 'ffmpeg.mp4'
cmdstring = ('ffmpeg',
    '-y', '-r', '30', # overwrite, 30fps
    '-s', '%dx%d' % (canvas_width, canvas_height), # size of image string
    '-pix_fmt', 'argb', # format
    '-f', 'rawvideo',  '-i', '-', # tell ffmpeg to expect raw video from the pipe
    '-vcodec', 'mpeg4', outf) # output encoding
p = subprocess.Popen(cmdstring, stdin=subprocess.PIPE)

# Draw 1000 frames and write to the pipe
for frame in range(10):
    print("Working on frame")
    # draw the frame
    f = plt.figure(figsize=(5,5), dpi=300)
    ax = f.add_axes([0,0,1,1])
    ax.scatter(xlist, ylist,
               c=color, cmap = 'viridis')
    f.canvas.draw()
    plt.show()

    # extract the image as an ARGB string
    string = f.canvas.tostring_argb()
    # write to pipe
    p.stdin.write(string)

# Finish up
p.communicate()


    


    While plt.show() does show the correct plot (see image below), the video that ffmpeg creates is a bit different than what plt.show() shows. I am presuming the issue is with f.canvas.draw(), but I'm not sure how to get a look at what canvas.draw() actually plots.

    


    plot.show() :
enter image description here

    


    ffmpeg video (imgur link)

    


  • PortAudio pipe ffmpeg

    11 juillet 2022, par DNS

    I would like to get the buffer from PortAudio and in real time (each seconds for example) to send it to ffmpeg to make it streamable. I'm trying to capture the microphone buffer to send it to ffmpeg.

    


    Actually I get my PortAudio buffer :

    


    std::vector<unsigned short="short"> captured(bufferSize * channels);&#xA;std::vector<unsigned short="short"> saveCaptured;&#xA;&#xA;while (framesProcessed &lt; sampleRate * durationSeconds)&#xA;{&#xA;    if ((paErr = Pa_ReadStream(stream, captured.data(), bufferSize)) != paNoError)&#xA;    {&#xA;        std::cout &lt;&lt; "Pa_ReadStream failed: " &lt;&lt; Pa_GetErrorText(paErr) &lt;&lt; "\n";&#xA;        return 1;&#xA;    }&#xA;    for (const auto&amp; value : captured) {&#xA;        saveCaptured.push_back(value);&#xA;    }&#xA;    framesProcessed &#x2B;= bufferSize;&#xA;}&#xA;</unsigned></unsigned>

    &#xA;

    How can I send the buffer to ffmpeg ? I read somewhere that pcm data are readable with ffmpeg but my portaudio buffer cannot be read.

    &#xA;

    I would like to know if I have to create a audio header to be understood by ffmpeg, can you confirm that I don't need any header ?

    &#xA;