Link to home
Start Free TrialLog in
Avatar of ClintonK
ClintonKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ffmpeg gives error "Invalid data found when processing input" when concatenating jpg files

I have a server running Ubuntu 18.04 LTS.
I have a directory with a number of jpg files taken with an IP camera. I am trying to concatenate the jpg files into a single mpg video file using ffmpeg with the following command:

ffmpeg -f concat -i /tmp/myjpegs  /tmp/myvideo.mpg

I get the error message:
/tmp/myjpegs: Invalid data found when processing input

There is nothing else in the /tmp/myjpegs folder apart from the sequence of jpg files.

This the the output from the command:

  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
/tmp/myjpegs: Invalid data found when processing input
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tip: You can also try this.

cat /tmp/myjpegs* >  /tmp/myvideo.mpg

Open in new window


As I recall, .mpg containers can be directly concatenated.

I'd try this first + see if it works. I did some looking + couldn't find a definitive answer online + I don't have any .mpg footage available to test.

My suggestion is you try the Linux cat command first + see if that works.
Avatar of ClintonK

ASKER

Thanks, that was the key to the solution. Now that I have created a text file containing the names of the jpegs all works fine. (I had to add -safe 0 to the command line).

BTW. cat jpegs to mpg didn't seem to work.

Cheers for the help.
Glad you got this working!