Quantcast

convert a sequence of images to a video file

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

convert a sequence of images to a video file

Josh Joy-2
Hi,

I would like to convert a series of images (png files) to a video.

Would something like this work?

ffmpeg -r 29.97 -i /images/picture%.png out.avi

When I try the above, I get

picture%d.jpg: I/O error occurred
Usually that means that input file is truncated and/or corrupted.



Thanks,
Josh
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Josh Joy-2
On Tue, Sep 16, 2008 at 8:21 PM, Josh Joy <[hidden email]> wrote:

> Hi,
>
> I would like to convert a series of images (png files) to a video.
>
> Would something like this work?
>
> ffmpeg -r 29.97 -i /images/picture%.png out.avi
>
> When I try the above, I get
>
> picture%d.jpg: I/O error occurred
> Usually that means that input file is truncated and/or corrupted.
>
>
>
nevermind, I need to do like a %03...where 03 is the number of pictures in
the sequence
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Aurele
Josh Joy a écrit :

> On Tue, Sep 16, 2008 at 8:21 PM, Josh Joy <[hidden email]> wrote:
>
>  
>> Hi,
>>
>> I would like to convert a series of images (png files) to a video.
>>
>> Would something like this work?
>>
>> ffmpeg -r 29.97 -i /images/picture%.png out.avi
>>
>> When I try the above, I get
>>
>> picture%d.jpg: I/O error occurred
>> Usually that means that input file is truncated and/or corrupted.
>>
>>
>>
>>    
> nevermind, I need to do like a %03...where 03 is the number of pictures in
> the sequence
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>  
What's exactly the name of pictures ?  if pitures' names are
picture001.png (for example) you should use picture%03d.png. if the
names are picture0001.png, use picture%04d.png, .......
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
I have a similar problem to this guy, but with JPG files.
The JPGs are numbered 1.JPG to 297.JPG

I'm trying to use the following command:

ffmpeg -f image2 -i %0d.JPG -r 06 -sameq output.mp4

But getting the same error.
Can ffmpeg turn jpgs into mpeg4 videos?

thanks,
Andrew
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Phil Turmel-2
Hi Andrew,

On 01/31/2011 09:27 AM, aljones15 wrote:

>
> I have a similar problem to this guy, but with JPG files.
> The JPGs are numbered 1.JPG to 297.JPG
>
> I'm trying to use the following command:
>
> ffmpeg -f image2 -i %0d.JPG -r 06 -sameq output.mp4
>
> But getting the same error.
> Can ffmpeg turn jpgs into mpeg4 videos?

Yes, and here's a couple things to try:

ffmpeg -f image2 -r 06 -i %d.JPG output.mp4

I moved the -r, so it applies to you input images, and dropped the sameq for test purposes.  You can play with quality or bit-rate settings after you get some output.

If the above doesn't work, try renaming your input files to three digits (001.JPG, 002.JPG ...) and use this:

ffmpeg -f image2 -r 06 -i %03d.JPG output.mp4


HTH,

Phil
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
am now just getting the codec error. installed mjpegtools, but still getting the same error. tried to do it with an alternative video codec and also didn't work.

-
A
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Phil Turmel-2
In reply to this post by Phil Turmel-2
[Top-posting repaired.  Please don't do that on this list.]

On 01/31/2011 10:07 AM, Andrew Jones wrote:
> On 31 Jan 2011 22:00, "Phil Turmel" <[hidden email]> wrote:

[cut]

>> Yes, and here's a couple things to try:
>>
>> ffmpeg -f image2 -r 06 -i %d.JPG output.mp4
>>
>> I moved the -r, so it applies to you input images, and dropped the sameq
> for test purposes. You can play with quality or bit-rate settings after you
> get some output.
>>
>> If the above doesn't work, try renaming your input files to three digits
> (001.JPG, 002.JPG ...) and use this:
>>
>> ffmpeg -f image2 -r 06 -i %03d.JPG output.mp4

> Tried both methods doesn't work
> Is that %03d
> Jpg or %o3d.jpg? The o threw a could not find codec error.

Digit, not the letter.  Please cut-n-paste the complete console output of the above commands so we can see what's going on.

Phil
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Andy Sheen
In reply to this post by aljones15


On 31/01/2011 15:33, aljones15 wrote:
>
> am now just getting the codec error. installed mjpegtools, but still getting
> the same error. tried to do it with an alternative video codec and also
> didn't work.
>
> -
> A

Sounds like you are not specifying the codec you want. Try something like:

ffmpeg -y -r 6 -i %02d.jpg -b 2400k -vcodec mpeg4 test.mp4

And as has been said by Phil, please cut and paste the complete command
and output it generates from that command.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
andrew@liminal:~/Pictures/party+stop$ ffmpeg -y -r 6 -i %02d.jpg -b 2400k
-vcodec mpeg4 test.mp4
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice
Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr
--enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
--enable-libgsm --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
--disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl
--enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394
--enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3
%02d.jpg: I/O error occurred
Usually that means that input file is truncated and/or corrupted.


same error with %03d.JPG, &02d.JPG %d.JPG

I might add... this seems to be a really common error.
Do you think a batch convert to PNG might help?
Does ffmpeg have trouble with jpeg?

-
Andrew

On Mon, Jan 31, 2011 at 11:08 PM, Andy Sheen <[hidden email]>wrote:

>
>
> On 31/01/2011 15:33, aljones15 wrote:
>
>>
>> am now just getting the codec error. installed mjpegtools, but still
>> getting
>> the same error. tried to do it with an alternative video codec and also
>> didn't work.
>>
>> -
>> A
>>
>
> Sounds like you are not specifying the codec you want. Try something like:
>
> ffmpeg -y -r 6 -i %02d.jpg -b 2400k -vcodec mpeg4 test.mp4
>
> And as has been said by Phil, please cut and paste the complete command and
> output it generates from that command.
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>



--
Andrew Jones
Location: Bangkok
blog: http://dignifieddevil.wordpress.com/
Cell: +66 0853668737
AIM: liminal18 MSN: [hidden email]
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
and when I capitalize the D in %03D.JPG I get

andrew@liminal:~/Pictures/party+stop$ ffmpeg -y -r 6 -i %02D.jpg -b 2400k
-vcodec mpeg4 test.mpeg4
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice
Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr
--enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
--enable-libgsm --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
--disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl
--enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394
--enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Mar  4 2010 12:35:30, gcc: 4.4.3
[image2 @ 0x9ae62c0]Could not find codec parameters (Video: mjpeg)
%02D.jpg: could not find codec parameters
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Andy Sheen
In reply to this post by aljones15
Please don't top post... (http://en.wikipedia.org/wiki/Posting_style)

On 01/02/2011 12:05, Andrew Jones wrote:

> andrew@liminal:~/Pictures/party+stop$ ffmpeg -y -r 6 -i %02d.jpg -b 2400k
> -vcodec mpeg4 test.mp4
> FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice
> Bellard, et al.
>    configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr
> --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
> --enable-libgsm --enable-libschroedinger --enable-libspeex
> --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
> --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl
> --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394
> --enable-shared --disable-static
>    libavutil     49.15. 0 / 49.15. 0
>    libavcodec    52.20. 1 / 52.20. 1
>    libavformat   52.31. 0 / 52.31. 0
>    libavdevice   52. 1. 0 / 52. 1. 0
>    libavfilter    0. 4. 0 /  0. 4. 0
>    libswscale     0. 7. 1 /  0. 7. 1
>    libpostproc   51. 2. 0 / 51. 2. 0
>    built on Mar  4 2010 12:35:30, gcc: 4.4.3
> %02d.jpg: I/O error occurred
> Usually that means that input file is truncated and/or corrupted.
>
>
 > same error with %03d.JPG,&02d.JPG %d.JPG
>

try calling them something like foo-001.jpg foo-002.jpg etc... and then try

ffmpeg -y -r 6 -i foo-%02d.jpg -b 2400k -vcodec mpeg4 test.mp4

if that fails, try

ffmpeg -y -r 6 -f image2 -i foo-%02d.jpg -b 2400k -vcodec mpeg4 test.mp4

> I might add... this seems to be a really common error.
> Do you think a batch convert to PNG might help?
> Does ffmpeg have trouble with jpeg?
>

It certainly didn't (I've used the command I sent to create a sequence
of JPEGs into a film in the past).
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
same errors again.
Are you sure its foo-%02d.jpg and not foo-%02D.jpg

Thanks?

-
Andrew
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Andy Sheen


On 01/02/2011 12:38, Andrew Jones wrote:
> same errors again.

Strange... Try a later version of ffmpeg (the one you are running is
quite old...).

> Are you sure its foo-%02d.jpg and not foo-%02D.jpg

Yes. I cut/pasted the command from my internal wiki site where I capture
all these obscure commands for future use.

>
> Thanks?
>
> -
> Andrew
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
compiled ffmpeg from git, but now it doesn't recognize files.


file names

foo-001.JPG to foo-00292.JPG

 ffmpeg -f image2 -i foo-%06d.JPG a.mpg
FFmpeg version git-e86e858, Copyright (c) 2000-2011 the FFmpeg developers
  built on Feb  1 2011 21:14:59 with gcc 4.4.3
  configuration:
  libavutil    50. 36. 0 / 50. 36. 0
  libavcore     0. 16. 1 /  0. 16. 1
  libavcodec   52.108. 0 / 52.108. 0
  libavformat  52. 94. 0 / 52. 94. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 74. 0 /  1. 74. 0
  libswscale    0. 12. 0 /  0. 12. 0
foo-%06d.JPG: No such file or directory

I also tried it with the following:

img001.jpg to img00122.jpg

sudo ffmpeg -f image2 -r 06 -i img%3d.jpg output.mp4
FFmpeg version git-e86e858, Copyright (c) 2000-2011 the FFmpeg developers
  built on Feb  1 2011 21:14:59 with gcc 4.4.3
  configuration:
  libavutil    50. 36. 0 / 50. 36. 0
  libavcore     0. 16. 1 /  0. 16. 1
  libavcodec   52.108. 0 / 52.108. 0
  libavformat  52. 94. 0 / 52. 94. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 74. 0 /  1. 74. 0
  libswscale    0. 12. 0 /  0. 12. 0
img%3d.jpg: No such file or directory

did the compile somehow go wrong?

-
Andrew

On Tue, Feb 1, 2011 at 7:45 PM, Andy Sheen <[hidden email]>wrote:

>
>
> On 01/02/2011 12:38, Andrew Jones wrote:
>
>> same errors again.
>>
>
> Strange... Try a later version of ffmpeg (the one you are running is quite
> old...).
>
>
>  Are you sure its foo-%02d.jpg and not foo-%02D.jpg
>>
>
> Yes. I cut/pasted the command from my internal wiki site where I capture
> all these obscure commands for future use.
>
>
>> Thanks?
>>
>> -
>> Andrew
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>>
>>  _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
>



--
Andrew Jones
Location: Bangkok
blog: http://dignifieddevil.wordpress.com/
Cell: +66 0853668737
AIM: liminal18 MSN: [hidden email]
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

James Darnley
On 02/02/2011, Andrew Jones <[hidden email]> wrote:
> compiled ffmpeg from git, but now it doesn't recognize files.
>
>
> file names
>
> foo-001.JPG to foo-00292.JPG
>
> img001.jpg to img00122.jpg

FFmpeg won't read either of those sequences.  Does anyone here
understand the printf format?

%d will read a regular sequence (i.e. 1 onwards).
%03d will read a sequence with TWO leading zeros (i.e. 001 onwards,
010 onwards, 100 onwards).
Then what will %06d do?

Further requirements:
The sequence must start with any of 0 1 2 3 4
The sequence must be continuous
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
I tried it with foo-%01d.jpg to foo-%08d.jpg  and img%01d.jpg all the way to
img%08d.jpg. it didn't work. Mencoder seems to be working though.

On 2 Feb 2011 17:39, "James Darnley" <[hidden email]> wrote:

> On 02/02/2011, Andrew Jones <[hidden email]> wrote:
>> compiled ffmpeg from git, but now it doesn't recognize files.
>>
>>
>> file names
>>
>> foo-001.JPG to foo-00292.JPG
>>
>> img001.jpg to img00122.jpg
>
> FFmpeg won't read either of those sequences. Does anyone here
> understand the printf format?
>
> %d will read a regular sequence (i.e. 1 onwards).
> %03d will read a sequence with TWO leading zeros (i.e. 001 onwards,
> 010 onwards, 100 onwards).
> Then what will %06d do?
>
> Further requirements:
> The sequence must start with any of 0 1 2 3 4
> The sequence must be continuous
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

James Darnley
On 02/02/2011, Andrew Jones <[hidden email]> wrote:
> I tried it with foo-%01d.jpg to foo-%08d.jpg  and img%01d.jpg all the way to
> img%08d.jpg. it didn't work. Mencoder seems to be working though.

Do either of those actually match your sequence?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

aljones15
For the ones named img001.jpg i believe the squence should be img%02d.jpg or
img%03d.jpg, both were tried.

On 2 Feb 2011 17:51, "James Darnley" <[hidden email]> wrote:
> On 02/02/2011, Andrew Jones <[hidden email]> wrote:
>> I tried it with foo-%01d.jpg to foo-%08d.jpg and img%01d.jpg all the way
to
>> img%08d.jpg. it didn't work. Mencoder seems to be working though.
>
> Do either of those actually match your sequence?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

ffmpeg-5
In reply to this post by James Darnley
On 02/02/11 11:38 +0100, James Darnley wrote:

> On 02/02/2011, Andrew Jones <[hidden email]> wrote:
> > compiled ffmpeg from git, but now it doesn't recognize files.
> >
> >
> > file names
> >
> > foo-001.JPG to foo-00292.JPG
> >
> > img001.jpg to img00122.jpg
>
> FFmpeg won't read either of those sequences.  Does anyone here
> understand the printf format?
>
> %d will read a regular sequence (i.e. 1 onwards).
> %03d will read a sequence with TWO leading zeros (i.e. 001 onwards,
> 010 onwards, 100 onwards).
> Then what will %06d do?

There's a concept called 'zero-padding' that you need to understand.  

%04d means four digit padding.  Meaning, the frame numbers are padded
on the left with as many zeros as it takes to make the frame number
four digits.  It would read a sequence like...

        0001.jpg ... 0099.jpg ... 0292.jpg

It does NOT mean...

        0001.jpg - 0000292.jpg

A %06d would be...

        000001.jpg ... 000099.jpg ... 000292.jpg

Just a plain %d would match numbers with no padding like...

        1.jpg ... 99.jpg ... 292.jpg


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert a sequence of images to a video file

Ronald S. Bultje-3
In reply to this post by aljones15
Hi,

On Wed, Feb 2, 2011 at 3:40 AM, Andrew Jones <[hidden email]> wrote:
> img001.jpg to img00122.jpg
>
> sudo ffmpeg -f image2 -r 06 -i img%3d.jpg output.mp4

img%03d.jpg. Don't rename your images for every experiment, you're
likely confusing yourself with which filename and which command go
together.

Ronald
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
12
Loading...