convert a sequence of images to a video file
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
On Tue, Sep 16, 2008 at 8:21 PM, Josh Joy <joshjdevl at gmail.com> 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
Josh Joy a ?crit :
On Tue, Sep 16, 2008 at 8:21 PM, Josh Joy <joshjdevl at gmail.com> 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 ffmpeg-user at mplayerhq.hu 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, .......
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 -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/convert-a-sequence-of-images-to-a-v... Sent from the FFmpeg-users mailing list archive at Nabble.com.
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
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 -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/convert-a-sequence-of-images-to-a-v... Sent from the FFmpeg-users mailing list archive at Nabble.com.
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.
andrew at 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 <sheen.andy at googlemail.com>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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
-- Andrew Jones Location: Bangkok blog: http://dignifieddevil.wordpress.com/ Cell: +66 0853668737 AIM: liminal18 MSN: aljones15 at hotmail.com
and when I capitalize the D in %03D.JPG I get andrew at 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
Please don't top post... (http://en.wikipedia.org/wiki/Posting_style) On 01/02/2011 12:05, Andrew Jones wrote:
andrew at 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).
same errors again. Are you sure its foo-%02d.jpg and not foo-%02D.jpg Thanks? - Andrew
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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
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 <sheen.andy at googlemail.com>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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
-- Andrew Jones Location: Bangkok blog: http://dignifieddevil.wordpress.com/ Cell: +66 0853668737 AIM: liminal18 MSN: aljones15 at hotmail.com
On 02/02/2011, Andrew Jones <aljones15 at gmail.com> 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
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" <james.darnley at gmail.com> wrote:
On 02/02/2011, Andrew Jones <aljones15 at gmail.com> 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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
On 02/02/2011, Andrew Jones <aljones15 at gmail.com> 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?
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" <james.darnley at gmail.com> wrote:
On 02/02/2011, Andrew Jones <aljones15 at gmail.com> 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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
On 02/02/11 11:38 +0100, James Darnley wrote:
On 02/02/2011, Andrew Jones <aljones15 at gmail.com> 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
How about numbering sequence that doesn't start with 0 or 1? I have lots of file sequences that looks like this: sc_101a1050.png ... sc_101a1100.png Using sc_101a%04d.png gives me error: No such file or directory Please help. Thank you -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/convert-a-sequence-of-images-to-a-v... Sent from the FFmpeg-users mailing list archive at Nabble.com.
On 2012-10-03 1:20 AM, rabit1 wrote:
I have lots of file sequences that looks like this: sc_101a1050.png ... sc_101a1100.png
In Windows, I suggest a rename utility, e.g. <http://fly.srk.fer.hr/~rajko/MRename/> Install, select last file, shift-click on first file, right-click and choose MRename. Enter IMG_\N400 as rename expression. Click "rename all" (files are renamed, so you may wish to work on copies). If you're on Linux, there's probably a one-line perl script to do the same thing... -- Andy
On Tue, 2 Oct 2012 22:20:24 -0700 (PDT) rabit1 <o972187@rtrtr.com> wrote:
How about numbering sequence that doesn't start with 0 or 1?
I have lots of file sequences that looks like this: sc_101a1050.png ... sc_101a1100.png
Using sc_101a%04d.png gives me error:
No such file or directory
Please help. Thank you
You can use the -start_number option: ffmpeg -start_number 1050 -i sc_101a%04d.png ... output Also see the -pattern_type option.
On 2012-10-04 4:37 PM, Lou wrote:
You can use the -start_number option:
That's new :-) please ignore my answer, Lou's is better! -- Andy
Hi, On Wed, Feb 2, 2011 at 3:40 AM, Andrew Jones <aljones15 at gmail.com> 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
Ahhh ok i gotcha. So if i have 292 frames frame one should be 001.jpg and the last one just 292.jpg will try that. That would be %03d.jpg correct? On 2 Feb 2011 21:37, "Ronald S. Bultje" <rsbultje at gmail.com> wrote:
Hi,
On Wed, Feb 2, 2011 at 3:40 AM, Andrew Jones <aljones15 at gmail.com> 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 ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Hi, On Wed, Feb 2, 2011 at 10:20 AM, Andrew Jones <aljones15 at gmail.com> wrote:
Ahhh ok i gotcha. So if i have 292 frames frame one should be 001.jpg and the last one just 292.jpg will try that. That would be %03d.jpg correct?
Yes. If you have them named 001 to 00292, you have two leading zeroes plus a digit without padding zeroes, so it'd be 00%d. If you have 001 to 292, it's %03d. Etcetera. Ronald
Gotcha so basicaly %03d.jpg means a 3 digit number so number one is 001 and the last frame 292. Basically all the frame numbers have to be three digits. On 2 Feb 2011 22:49, "Ronald S. Bultje" <rsbultje at gmail.com> wrote:
Hi,
On Wed, Feb 2, 2011 at 10:20 AM, Andrew Jones <aljones15 at gmail.com> wrote:
Ahhh ok i gotcha. So if i have 292 frames frame one should be 001.jpg and the last one just 292.jpg will try that. That would be %03d.jpg correct?
Yes.
If you have them named 001 to 00292, you have two leading zeroes plus a digit without padding zeroes, so it'd be 00%d. If you have 001 to 292, it's %03d. Etcetera.
Ronald _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Doh! I replied twice! Anyway, thanks for the answers. - a On 2 Feb 2011 22:49, "Ronald S. Bultje" <rsbultje at gmail.com> wrote:
Hi,
On Wed, Feb 2, 2011 at 10:20 AM, Andrew Jones <aljones15 at gmail.com> wrote:
Ahhh ok i gotcha. So if i have 292 frames frame one should be 001.jpg and the last one just 292.jpg will try that. That would be %03d.jpg correct?
Yes.
If you have them named 001 to 00292, you have two leading zeroes plus a digit without padding zeroes, so it'd be 00%d. If you have 001 to 292, it's %03d. Etcetera.
Ronald _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
participants (11)
-
aljones15@gmail.com -
Andy Civil -
ffmpeg@neoprimitive.net -
james.darnley@gmail.com -
joshjdevl@gmail.com -
Lou -
nemsauje@gmail.com -
philip@turmel.org -
rabit1 -
rsbultje@gmail.com -
sheen.andy@googlemail.com