Recherche avancée

Médias (91)

Autres articles (89)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (4638)

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


    


  • After uploading .aab file it is not showing app size based on mobile architecture

    11 septembre 2019, par Mani

    In my project i am using assets ffmpeg static binarie files for both 32 and 64 bit it’s working fine in both mobile architectures but i have problem about .aab file size. The app size is increased to 17mb after adding 64 bit file,I am using .aab file for uploading but the size is same for both the architectures.Please tell me how to reduce app size based on mobile architecture thank you.

  • ffmpeg does not draw text

    4 septembre 2016, par Michael Heuberger

    hope one of you can tell me why this ffmpeg command of mine does not draw the desired text. the produced video doesn’t have it. here you go :

    ffmpeg -f image2 -thread_queue_size 64 -framerate 15.1 -i /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-723f-d0aa0bd0-aa9b-f7da27da678f/frames/%d.webp -y -an -vcodec libvpx -filter:v drawtext=fontfile=/home/michael-heuberger/binarykitchen/code/videomail.io/src/assets/fonts/Varela-Regular.ttf:text=www.videomail.io:fontsize=180:fontcolor=white:x=150:y=150:shadowcolor=black:shadowx=2:shadowy=2 -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 -crf 12 -deadline realtime -cpu-used 4 -pix_fmt yuv420p -loglevel warning -movflags +faststart /home/michael-heuberger/binarykitchen/code/videomail.io/var/local/tmp/clients/videomail.io/11e6-723f-d0aa0bd0-aa9b-f7da27da678f/videomail_preview.webm

    the crucial part is this video filter :

    -filter:v drawtext=fontfile=/home/michael-heuberger/binarykitchen/code/videomail.io/src/assets/fonts/Varela-Regular.ttf:text=www.videomail.io:fontsize=180:fontcolor=white:x=150:y=150:shadowcolor=black:shadowx=2:shadowy=2

    does it seem correct to you ? if so, then why am i not seeing any text in the videomail_preview.webm video file ?

    using ffmpeg v2.8.6 here with —enable-libfreetype, —enable-libfontconfig and —enable-libfribidi enabled.

    furthermore, the above command has been produced with fluent-ffmpeg.

    so, any ideas ?