Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (101)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (16547)

  • c# Process data piping : 'The pipe has ended'

    9 août 2024, par user2224583

    There are two process I am handling. Ffmpeg and fpcalc.

    


    I have completed my appplication by encoding a wav file with ffmpeg, and reading it for purposes of chromaprinting with fpcalc.

    


    However, I think the next step is to skip the saving of a wav file, and pipe the data directly into the fpcalc process.

    


    I've been trying to understand how to pipe the stream data from ffpmeg stdout into the fpcalc process stdin.

    


    Some of the code I've been testing and reading (below) has come from other answers, with regards to piping data out of a Process object in c#, specifically with ffmpeg, found here on Stack

    


    private static void ExtractPCMAudio(string input, int duration)
    {
        Process proc = new Process();

        proc.StartInfo.FileName = @"ffmpeg.exe";
        proc.StartInfo.Arguments = $"-t 00:3:00 -i \"{input}\" -f wav -ac 1 -acodec pcm_s16le -ar 16000 -"; //"-" Dash pipes the stream
        proc.StartInfo.UseShellExecute = false;
        proc.StartInfo.RedirectStandardInput = true;
        proc.StartInfo.RedirectStandardOutput = true;

        proc.Start();

        FileStream baseStream = proc.StandardOutput.BaseStream as FileStream;

        byte[] audioBytes = null;
        int lastRead = 0;

        using (MemoryStream ms = new MemoryStream())
        {            
            byte[] buffer = new byte[4096];
            do
            {
                lastRead = baseStream.Read(buffer, 0, buffer.Length);
                ms.Write(buffer, 0, lastRead);
            } while (lastRead > 0);

            audioBytes = ms.ToArray();
        }
        
        proc.StandardInput.BaseStream.Close();
        
        baseStream.Close();
        FingerPrintAudio(audioBytes);
        Console.WriteLine("Done!");
        
    }


private static void FingerPrintAudio(byte[] audioBytes)
    {
        
        var fpcalc = "fpcalc.exe";
        var procStartInfo =
            new ProcessStartInfo(fpcalc, $" -raw -length 600 -json") 
            {
                RedirectStandardOutput = true,
                RedirectStandardInput = true,
                RedirectStandardError  = true,
                UseShellExecute        = false,
                CreateNoWindow         = true,
            };

        var process = new Process {StartInfo = procStartInfo};
        process.Start();            
        
        process.StandardInput.BaseStream.Write(audioBytes, 0, audioBytes.Length); //<--This is where the piping error happens.

        string processOutput = null;
        using (var sr = new StreamWriter("Test.json"))
        {
            while ((processOutput = process.StandardOutput.ReadLine()) != null)
            {
                sr.WriteLine(processOutput);
                Console.WriteLine(processOutput);
            }
            sr.Close();
        }
        
    }


    


    Throughout many variations of the code, posted above, I seem to encounter an error : 'the pipe has ended'.
I think it is a buffering error, where the process handling fpcalc is expecting more byte data, but is cut short ?

    


    Perhaps there is a better way to send stream data from one process and use it in a second process ?

    


  • Error while downloading video stream with streamlink + ffmpeg : Pipe copy aborted error

    29 novembre 2020, par beta

    I am trying to download a big video with the following command with Streamlink. Streamlink in the background uses ffmpeg. So what I get is actually an ffmpeg error.

    


    This is the command I use :

    


    streamlink --loglevel debug --hls-live-restart -o test.mp4 "https://aivottjab-a.akamaihd.net/IAD/jab-assets/jab-prod-iad/out/v1/732334e942a4465b8af9b21077d4e61d/cenc-083bb0.mpd?encoding=segmentBase&amznDtid=AOAGZA014O5RE" best


    


    This is the error I get after 26GB are downloaded.

    


    [19:48:27,437][stream.dash][debug] Download of segment: https://aivottjab-a.akamaihd.net/IAD/jab-assets/jab-prod-iad/out/v1/732334e942a4465b8af9b21077d4e61d/cenc_video_117_0_5791117.mp4 complete
[download][test.mp4] Written 25.97 GB (2h24m58s @ 1.0 MB/s)                                                         
[19:49:27,503][stream.ffmpegmux][error] Pipe copy aborted: \\.\pipe\ffmpeg-12796-364
[19:49:27,518][stream.ffmpegmux][error] Pipe copy aborted: \\.\pipe\ffmpeg-12796-967


    


    Anyone knows why this comes up ?

    


    I am on Windows 10, Streamlink 1.7.0 and FFmpeg 4.3.1.

    


  • How to pipe Csound output to ffmpeg for conversion without an intermediate file ?

    23 novembre 2020, par Ciro Santilli 郝海东冠状病六四事件法轮功

    On Ubuntu 20.04, Csound 6.13.0, ffmpeg 4.2.4 this plays fine :

    


    git clone https://github.com/csound/csound
cd csound
git checkout 92409ecce053d707360a5794f5f4f6bf5ebf5d24
csound examples/xanadu.csd


    


    and I can save to file with :

    


    csound -o xanadu.wav xanadu.csd
ffplay xanadu.wav


    


    or :

    


    csound -W -o stdout xanadu.csd > xanadu-stdout.wav


    


    and even convert from file :

    


    ffmpeg -i xanadu-stdout.wav xanadu-stdout.ogg
ffplay xanadu-stdout.ogg


    


    or :

    


    cat xanadu-stdout.wav | ffmpeg -f wav -i - xanadu.ogg


    


    or :

    


    csound -W -o stdout xanadu.csd | cat > xanadu-cat.wav



    


    So why does this fail from the direct pipe :

    


    csound -W -o stdout xanadu.csd | ffmpeg -f wav -i - xanadu.ogg


    


    or :

    


    csound -W -o stdout xanadu.csd | cat > xanadu-cat.wav
ffmpeg -y -f wav -i xanadu-cat.wav xanadu.ogg


    


    with :

    


    [wav @ 0x56093284c6c0] invalid start code d[163][3][0] in RIFF header
xanadu-cat.wav: Invalid data found when processing input


    


    So it seems that xanadu.wav and xanadu-cat.wav are different :

    


    $ diff -u xanadu.wav xanadu-cat.wav
Binary files xanadu.wav and xanadu-cat.wav differ


    


    and that makes the conversion fail.

    


    I know about :

    


    csound --ogg -o xanadu.ogg xanadu.csd


    


    which does work, but I just want to pipe into ffmpeg for fun.

    


    Also asked at : https://github.com/csound/csound/issues/1408