ffmpeg cannot find stream but stream does exist

56 Views Asked by At

ima using ffmpeg to add text to the video the problem is this command works some times and some times it just dont feel like working

this the error that iam getting Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_subtitles_0

this the command iam trying to run to add text to the video the srt file is always there when i run the commmand i tryed to run: ffmpeg -i ./vid/${id}.3.mp4 -lavfi "subtitles=${id}.srt:force_style='Alignment=0,OutlineColor=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=18,MarginL=100,Marginv=100'" -c:1 copy ./ready/${id}.4.mp4

this the function:

const addtext=async(id)=>{
  
  return new Promise(async(resolve,reject)=>{
    const command1 =await `ffmpeg -i  ./vid/${id}.3.mp4   -lavfi "subtitles=${id}.srt:force_style='Alignment=0,OutlineColor=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=18,MarginL=100,Marginv=100'"  -c:1 copy ./ready/${id}.4.mp4 `;
    await exec(command1, (error, stdout, stderr) => {
    if (error) {
        reject(`stderr: ${error.message}`)
    }
    resolve(id)
  })
 })  
}

this the error that iam getting Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_subtitles_0

this the command iam trying to run to add text to the video the srt file is always there when i run the commmand i tryed to run: ffmpeg -i ./vid/${id}.3.mp4 -lavfi "subtitles=${id}.srt:force_style='Alignment=0,OutlineColor=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=18,MarginL=100,Marginv=100'" -c:1 copy ./ready/${id}.4.mp4

0

There are 0 best solutions below