Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ffmpeg exited with code 1: Error reinitializing filters! #51

Open
deepakpapola opened this issue Aug 18, 2017 · 23 comments
Open
Labels

Comments

@deepakpapola
Copy link

ffmpeg exited with code 1: Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument

@SagiMedina
Copy link

did you find any solution?

@h2non
Copy link
Owner

h2non commented Sep 1, 2017

Ensure you have ffmped compiled with all the required library bindings, such as libass, libmp3lame...

@cvalenzuela
Copy link

I had the same error because my images were not all the same size.
Resize them and try again.

@h2non h2non added the question label Sep 10, 2017
@h2non
Copy link
Owner

h2non commented Sep 10, 2017

yeah, you must use same size image. Note that's documented in the README.

@deepakpapola
Copy link
Author

thanks

@ghost
Copy link

ghost commented Sep 14, 2017

I'm having this issue and I know is due to the caption key in the images node. If I delete the caption finishes ok.

@ghost
Copy link

ghost commented Sep 14, 2017

I solved by installing ffmpeg with all deps on OSX with brew.
If you need all support run:

brew uninstall --ignore-dependencies --force ffmpeg
brew install ffmpeg --with-chromaprint --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-game-music-emu --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-schroedinger --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg

@colinhacks
Copy link

It would be great if the error was more informative. Just run a sanity check on the image sizes before running the ffmpeg command so ffmpeg doesn't fail in such an obscure way.

@jaisharmaimcl
Copy link

I am trying to convert images to video using videoshow all is working fine but the image with caption is not working.

Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

at ChildProcess.<anonymous> (C:\Users\Newsx\videoshow-master\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

@ghost
Copy link

ghost commented May 26, 2018

What the image caption is?

@jaisharmaimcl
Copy link

Captions are simple i am trying on example file.

Caption is - This is a sample subtitle

@jaisharmaimcl
Copy link

Complete file is ---

var videoshow = require('../')

var audio = __dirname + '/../test/fixtures/song.mp3'

var options = {
loop: 5,
captionDelay: 350,
transition: true,
useSubRipSubtitles: false, // Use ASS/SSA subtitles instead
subtitleStyle: {
Fontname: 'Verdana',
Fontsize: '26',
PrimaryColour: '11861244',
SecondaryColour: '11861244',
TertiaryColour: '11861244',
BackColour: '-2147483640',
Bold: '2',
Italic: '0',
BorderStyle: '2',
Outline: '2',
Shadow: '3',
Alignment: '1', // left, middle, right
MarginL: '40',
MarginR: '60',
MarginV: '40'
}
}

var images = [
{
path: __dirname + '/../test/fixtures/step_1.png',
caption: 'This is a sample subtitle'
}, {
path: __dirname + '/../test/fixtures/step_2.png',
caption: 'Another sample text',
loop: 5
}, {
path: __dirname + '/../test/fixtures/step_3.png',
caption: 'Fast caption',
captionStart: 2,
captionEnd: 3
}, {
path: __dirname + '/../test/fixtures/step_4.png',
loop: 3
}, {
path: __dirname + '/../test/fixtures/step_5.png',
caption: 'Bye bye'
}
]

videoshow(images, options)
.audio(audio)
.save('video.mp4')
.on('start', function (command) {
console.log('ffmpeg process started:', command)
})
.on('error', function (err) {
console.error('Error:', err)
})
.on('end', function (output) {
console.log('Video created in:', output)
})

@ghost
Copy link

ghost commented Jun 9, 2018

I don't remember how I fixed that error, but I do that properties are very weak coded. Sometimes less properties and more stable ideas make the code work. I remember I was playing a lot with them but finally I think it was a code issue... I unsuscribe from this thread. Good luck.

@jaisharmaimcl
Copy link

Hi All is it possible to add different font color and alignment for particular image

@wfrsilva
Copy link

_handle.onexit (intern

Same error

ffmpeg process started: ffmpeg -i C:\Users\Avell\AppData\Local\Temp\videoshow-6e3ea757-642e-4cea-9b83-e64f3724b5d3 -i C:\Users\Avell\AppData\Local\Temp\videoshow-f15cb5e9-e760-4a88-b727-b2ebc1784115 -i C:\Users\Avell\AppData\Local\Temp\videoshow-caf16361-2a7b-47ff-bd97-5d5f8e9d85dd -i C:\Users\Avell\AppData\Local\Temp\videoshow-0dbef774-cca6-4996-8527-736414ada824 -i C:\Users\Avell\AppData\Local\Temp\videoshow-1673f4b8-d71e-4b64-b838-74ece8d165fb -i C:\Users\Avell\AppData\Local\Temp\videoshow-0e8bdf8c-9243-4d1d-8805-4b41c9cfc081 -i C:\Users\Avell\AppData\Local\Temp\videoshow-aeac442c-8f09-46fa-9a20-cf18281130a3 -y -filter_complex concat=n=7:v=0:a=0 video.mp4
ffmpeg process started: ffmpeg -i C:\Users\Avell\AppData\Local\Temp\videoshow-b6618835-47f2-4d75-93f3-21d4b0e5e6e0 -y -b:a 128k -ac 2 -r 25 -b:v 1024k -vcodec libx264 -filter:v scale=w=640:h=trunc(ow/a/2)*2 -f mp4 -vf subtitles='C:\Users\Avell\AppData\Local\Temp\videoshow-b8d225a8-e84e-47e1-bcfb-ac4ca9a1ad0f.ass' -pix_fmt yuv420p video.mp4
Error: Error: ffmpeg exited with code 1: Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

at ChildProcess.<anonymous> (C:\Users\Avell\Google Drive\robovideoyoutube\video-maker\node_modules\videoshow\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

ffmpeg stderr: undefined

@mifi
Copy link
Contributor

mifi commented Apr 22, 2020

For anyone interested, I created a tool which is similar to this one, but also supports videos and a lot more transitions, animations and components Hopefully useful for some of you: https://github.com/mifi/editly

@ghost
Copy link

ghost commented May 13, 2021

I am trying to convert images to video using videoshow all is working fine but the image with caption is not working.

Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

at ChildProcess.<anonymous> (C:\Users\Newsx\videoshow-master\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

How have you solved your problem?

@Immanuel-john
Copy link

I had the same error because my images were not all the same size.
Resize them and try again.

Same size means, are you telling about the image file size or image dimensions? Kindly clarify

@h2non
Copy link
Owner

h2non commented Dec 9, 2021

Used images must have symmetric width and height pixel dimensions.

@manindercingh
Copy link

manindercingh commented May 12, 2022

hey i also facing this issue :
Failed to inject frame into filters network : Invalid argument
command is : "-y -i " + input.mp4 + " -vf eq=brightness=0.06:saturation=2 -c:a copy " + output.mp4"
this command used to apply filter in the video

any one please help!

@yangfan-coder
Copy link

yangfan-coder commented Apr 20, 2023

I have encountered the following error, and after investigation, I have found that it is caused by an issue with the @ ffmpeg installer/ffmpeg package. May I ask if there is a good solution?

The pseudocode is as follows:

const ffmpeg = require("fluent-ffmpeg");
const ffmpegPath = require("@ffmpeg-installer/ffmpeg");
ffmpeg.setFfmpegPath(ffmpegPath.path);
...
 ffmpeg()
    .input(vpath)
    .input(watermarkImg)
    .inputOptions("-filter_complex", "overlay=100:10")
    .on("error", function (err) {
      console.log("fail: " + err.message);
    })
    .on("end", function () {
      console.log("success ");
    })
    .save(`${outputFolder}/demo.mp4`);

The error is as follows:

Error: ffmpeg exited with code 1: Error reinitializing filters!
Failed to inject frame into filter network: No such file or directory
Error while processing the decoded data for stream #0:0
Conversion failed!

@Wizzel1
Copy link

Wizzel1 commented Jan 4, 2024

@yangfan-coder did you find a solution?

@yangfan-coder
Copy link

@yangfan-coder你找到解决办法了吗?

Unfortunately, there was no such thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests