Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (59)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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" ;

Sur d’autres sites (9322)

  • How can I schedule a YouTube livestream entirely from Linux ?

    25 avril 2021, par Dale Wellman

    I have a setup on a Raspberry Pi (with its native camera) that uses a cronjob to start an ffmpeg session with its output streaming to YouTube. I re-use the same stream key each time, which is written into my ffmpeg scripts. This all works perfectly each week, automatically starting and stopping at the desired time.
However, each week PRIOR to that livestream, I have to "manually" go into YouTube Studio and "schedule" a new future event. This is easy enough, since it lets me "reuse" previous settings — all I have to change is the Title, date, and time. But I would love to figure out a way to automate that part of the process, as well. I assume it involves using the YouTube Data API, but I'm not well versed in API's, JSON, etc.
(I do have a strong Linux background, bash scripting skills, and general programming background.)

    


    My final solution just needs to :

    


      

    • create the new scheduled event (maybe 12 hours prior to going live), with Title, Date, Time, "Unlisted" status, category, and so forth — all the usual settings I do manually within Studio
    • 


    • retrieve the assigned URL for the upcoming stream (my script will then email that to me)
    • 


    


    So, basically, I'm asking for help getting started with the API, or whatever method is capable of doing this. I would prefer to code it on the same Pi that does the ffmpeg encoding (although in a pinch, I could create the schedule from another computer, even Windows). Any examples would be great.

    


    So far, all I have done is create my Google project, enable the YouTube Data API in the project, and create my API key. But I'm not sure where to go from there.

    


  • FFmpeg Error : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_amix_54

    25 mai 2024, par Josh Lawson

    I'm working on a project to generate a click track using React.js and FFmpeg. The project includes an Express.js backend where I construct an FFmpeg command to combine multiple audio files (count-ins, vocal cues, and click sounds) into a single track. The final output should be an MP3 file.

    


    However, I'm encountering an error when running the FFmpeg command :

    


    Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_amix_54


    


    How can I correctly construct the FFmpeg command to avoid the "Cannot find a matching stream for unlabeled input pad" error and ensure all inputs are properly processed and mixed ?

    


    Here is the relevant part of my server.js code :

    


    const express = require('express');
const bodyParser = require('body-parser');
const { exec } = require('child_process');
const path = require('path');
const fs = require('fs');
const ffmpegPath = require('ffmpeg-static');
const cors = require('cors');

const app = express();
app.use(cors());
app.use(bodyParser.json());

app.post('/generate-click-track', (req, res) => {
    const { tempo, timeSignature, clickSound, subdivisions, sections } = req.body;
    const clickSoundPath = path.join(__dirname, 'public', 'click-sounds');
    const vocalCuesPath = path.join(__dirname, 'public', 'vocal-cues');

    const beatsPerBar = parseInt(timeSignature.split('/')[0]);
    const beatsPerMinute = tempo;
    let totalBeats = 0;
    const sectionStarts = [];

    sections.forEach((section, index) => {
        if (index > 0) {
            sectionStarts.push(totalBeats);
        }
        totalBeats += section.length * beatsPerBar;
    });

    const outputFilePath = path.join(__dirname, 'output', 'click-track.mp3');
    const tempDir = path.join(__dirname, 'temp');

    if (!fs.existsSync(tempDir)) {
        fs.mkdirSync(tempDir);
    }

    const countInFiles = Array.from({ length: beatsPerBar }, (_, i) => path.join(vocalCuesPath, 'count-ins', `${i + 1}.wav`));

    let ffmpegCommand = '';

    // Add count-in files
    countInFiles.forEach(file => {
        ffmpegCommand += `-i "${file}" `;
    });

    // Add section vocal cues and click sounds
    sections.forEach((section, index) => {
        const vocalCueFile = path.join(vocalCuesPath, `${section.name}.wav`);
        ffmpegCommand += `-i "${vocalCueFile}" `;

        for (let i = 0; i < section.length * beatsPerBar; i++) {
            const clickFile = i % beatsPerBar === 0 ? `${clickSound}-accents.mp3` : `${clickSound}.mp3`;
            ffmpegCommand += `-i "${path.join(clickSoundPath, clickFile)}" `;
        }
    });

    ffmpegCommand += `-filter_complex "`;

    let inputCount = 0;
    countInFiles.forEach((_, index) => {
        ffmpegCommand += `[${inputCount}:0]adelay=${index * (60 / beatsPerMinute) * 1000}|${index * (60 / beatsPerMinute) * 1000}[a${inputCount}]; `;
        inputCount++;
    });

    sections.forEach((section, index) => {
        const delay = (sectionStarts[index] ? sectionStarts[index] : 0) * (60 / beatsPerMinute) * 1000;
        ffmpegCommand += `[${inputCount}:0]adelay=${delay}|${delay}[a${inputCount}]; `;
        inputCount++;

        for (let i = 0; i < section.length * beatsPerBar; i++) {
            const delay = (sectionStarts[index] ? sectionStarts[index] : 0) * (60 / beatsPerMinute) * 1000 + (i * 60 / beatsPerMinute) * 1000;
            ffmpegCommand += `[${inputCount}:0]adelay=${delay}|${delay}[a${inputCount}]; `;
            inputCount++;
        }
    });

    ffmpegCommand += `amix=inputs=${inputCount}:duration=longest" -codec:a libmp3lame -b:a 192k -y "${outputFilePath}"`;

    console.log(`Executing ffmpeg command: ${ffmpegCommand}`);

    exec(`${ffmpegPath} ${ffmpegCommand}`, (error, stdout, stderr) => {
        if (error) {
            console.error(`Error generating click track: ${error.message}`);
            res.status(500).send('Error generating click track');
            return;
        }

        res.download(outputFilePath, 'click-track.mp3', (err) => {
            if (err) {
                console.error(`Error sending file: ${err.message}`);
            }

            // Clean up temp directory
            fs.readdir(tempDir, (err, files) => {
                if (err) throw err;
                for (const file of files) {
                    fs.unlink(path.join(tempDir, file), err => {
                        if (err) throw err;
                    });
                }
            });
        });
    });
});

app.listen(3001, () => {
    console.log('Server running on http://localhost:3001');
});


    


    I can't include the full error messge as it is too long, but if anyone needs it, I'm happy to link to a text file that includes it.

    


    What I have tried :

    


      

    1. Verified all file paths and ensured they exist.
    2. 


    3. Escaped file paths to handle spaces in filenames.
    4. 


    5. Logged the constructed FFmpeg command and ran it manually, which still produced the same error.
    6. 


    


    Environment

    


      

    • React.js : v18.3.1
    • 


    • Node.js : v22.2.0
    • 


    • Express : v4.19.2
    • 


    • FFmpeg : static build via ffmpeg-static (v5.2.0)
    • 


    


  • compile ffmpeg decode only without audio codecs

    28 juillet 2016, par Rob

    I work on a media manager and use ffmpeg.exe to extract screenshots.
    With the latest size of ffmpeg.exe exceeding 35MB, I am attempting to build ffmpeg without the majority of its functions, to allow only saving of a frame of video.

    I had thought disabling many of the filters, Audio Codecs etc would shrink the size of ffmpeg to something more manageable.

    Following this guide
    https://pracucci.com/compile-ffmpeg-on-windows-with-visual-studio-compiler.html
    to allow building of ffmpeg using Visual Studio 2015, I have come to the part of ./configuration and hit a wall.
    With so many options and no idea what all of them mean or do, I am asking if someone in the community can give me laymans instructions.

    I also know that I need to build x264, and possible x265 (HEVC), but am not sure if there is anything other codecs needed.
    In the end, I and am hoping to just have the one file, ffmpeg.exe for use in the media manager project.

    The code I use to get a screenshot is as follows

    Public Shared Function CreateScreenShot(ByVal FullPathAndFilename As String, ByVal SavePath As String, ByVal sec As Integer, Optional ByVal Overwrite As Boolean = False) As Boolean
       If Not File.Exists(SavePath) Or Overwrite Then
           Try
               IO.File.Delete(SavePath)
           Catch
               Return False
           End Try
           If IO.File.Exists(FullPathAndFilename) Then
               Dim myProcess As Process = New Process
               Try
                   Dim seconds As Integer = sec
                   myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
                   myProcess.StartInfo.CreateNoWindow = False
                   myProcess.StartInfo.FileName = Utilities.applicationPath & "\Assets\ffmpeg.exe"
                   Dim proc_arguments As String = "-ss " & seconds.ToString & " -i """ & FullPathAndFilename & """ -vframes:v 1 -an " & """" & SavePath & """"
                   myProcess.StartInfo.Arguments = proc_arguments
                   myProcess.Start()
                   myProcess.WaitForExit()
                   If File.Exists(SavePath) Then Return True
               Catch ex As Exception
                   Throw ex
               Finally
                   myProcess.Close()
               End Try
           End If
       End If
       Return False
    End Function

    I hope this is sufficient information, and appreciated any help or suggestions.