
Recherche avancée
Autres articles (97)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez 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 (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (7440)
-
FFmpeg Error : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_amix_54
25 mai 2024, par Josh LawsonI'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 :


- 

- Verified all file paths and ensured they exist.
- Escaped file paths to handle spaces in filenames.
- Logged the constructed FFmpeg command and ran it manually, which still produced the same error.








Environment


- 

- React.js : v18.3.1
- Node.js : v22.2.0
- Express : v4.19.2
- FFmpeg : static build via ffmpeg-static (v5.2.0)










-
Unable find an ffmpeg binary for your Android system
22 juillet 2024, par Ayush ThakurWorking on a project where I need to use FFmpeg library in Kotlin to work on some audio files. However I'm unable to initialize the ffmpeg library itself.


this is the error I'm getting


Could not find an ffmpeg binary for your Android system. Did you forget calling: 'new AndroidFFMPEGLocator(this);' ?
2024-07-22 18:48:33.910 11800-11800 PipeDecoder com.example.sangeet E Tried to unpack a statically compiled ffmpeg binary for your architecture to: /data/user/0/com.example.sangeet/cache/ffmpeg
2024-07-22 18:48:33.923 11800-11800 AndroidRuntime com.example.sangeet E FATAL EXCEPTION: main (Ask Gemini)
 Process: com.example.sangeet, PID: 11800
 java.lang.Error: Decoding via a pipe will not work: Could not find an ffmpeg binary for your system



@HiltAndroidApp
class Sangeet: Application(){
 override fun onCreate() {
 super.onCreate()
 provideFirebaseApp(this)
 FFmpegKitConfig.setLogLevel(Level.AV_LOG_INFO)
 FFmpegKitConfig.enableLogCallback { Log.d("ffmpeg",it.message) }
 initializeFFmpegKit()
 }
 private fun initializeFFmpegKit() {
 // This method should be sufficient to ensure FFmpegKit is ready to use
 val ffmpegSession = FFmpegKit.execute("ffmpeg -version")
 if (ReturnCode.isSuccess(ffmpegSession.returnCode)) {
 Log.d("FFmpeg", "FFmpeg is ready to use.")
 } else {
 Log.e("FFmpeg", "Failed to initialize FFmpeg: ${ffmpegSession.failStackTrace}")
 initializeFFmpegBinary()
 }
 }
 private fun initializeFFmpegBinary() {
 val ffmpegBinaryPath = filesDir.absolutePath + "/ffmpeg"
 val binaryFile = File(ffmpegBinaryPath)
 if (!binaryFile.exists()) {
 Log.e("FFmpeg", "FFmpeg binary not found at $ffmpegBinaryPath")
 // Copy or download the FFmpeg binary to this path
 } else {
 Log.d("FFmpeg", "FFmpeg binary found at $ffmpegBinaryPath")
 }
 }
}



Tried using AndroidFFMPEGLocator(this) ; as suggested by the compiler in my code but unknown reference error is coming for the above line of code.


Also tried using FFmpegKit.init(this) function but init is also not being recognised by the compiler


-
lavu/riscv : align functions to 4 bytes
22 juillet 2024, par Rémi Denis-Courmontlavu/riscv : align functions to 4 bytes
Currently the start of the byte range for each function is aligned to
4 bytes. But this can lead to situations whence the function is preceded
by a 2-byte C.NOP at the aligned 4-byte boundary. Then the first actual
instruction and the function symbol are only aligned on 2 bytes.This forcefully disables compression for the alignment and the symbol,
thus ensuring that there is no padding before the function.