I am running ffmpeg script that captures webcam video and microphone audio and then uses video compression before saving the audio/video mp4 file. The script works on my desktop but cause error on my Pi. ffmpeg does not crash but instead says two erros. 1) Queue input is backward in time. 2) Non-monotonous DTS in output stream 0:1; previous: 232, current: 218: changing to 232. This may result in incorrect timestamps in the output file.

ffmpeg command :

 ffmpeg -f v4l2 -thread_queue_size 5000 -framerate 25 -video_size 
 640x480 -i /dev/video0 -thread_queue_size 5000 -f alsa -i plughw:1,0 
 -c:v libx264 -ac 1 -ar 44100 -c:a aac -y 

Is there a fix or does the Pi no have enough ram or something? My ram levels are jumping between 80-98 percent when I run this command.

1 Answer 1


The bash script was causing crashing becauses it was being fired through nodeJs spawn process. The process size was to big and caused crash. Fixed by configuring spawn process configurations.

  • And what exactly did you do?
    – RalfFriedl
    Commented Jul 26, 2019 at 18:51
  • Appended the following options to my spawn process child; detached:true and stdio:ignore
    – sirshakir
    Commented Jul 27, 2019 at 4:07
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Commented Apr 23, 2020 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.