Page 1 of 1
subimage specification returns no images with video
Posted: 2014-08-22T11:07:21-07:00
by Jerware
Hi, I asked for help on the Users forum about this problem and it was suggested I report the issue here. First, a link to my initial thread:
viewtopic.php?f=1&t=26144
Basically, when converting a video file to stills, some subimage ranges produce the following non-fatal error:
convert.exe: subimage specification returns no images `video.mpeg' @ error/constitute.c/ReadImage/577.
As linked in the other thread, here is a test video that is only 20 frames long:
http://ledseq.com/downloads/20frames.mp4
Run the following and it works fine:
Code: Select all
convert 20frames.mp4[0-9] -type truecolor -resize 16x16! -quality 100 %06d.bmp
Run the following and you get the error:
Code: Select all
convert 20frames.mp4[10-19] -type truecolor -resize 16x16! -quality 100 %06d.bmp
Despite the error, it appears that any subimage range is successfully extracted. I just want to be sure there's actually nothing wrong, and hopefully find a way to avoid the error before I suggest this command to my own users.
Re: subimage specification returns no images with video
Posted: 2014-08-22T13:06:41-07:00
by fmw42
I only get this message when the first number of a
range is larger than one digit.
This works
Code: Select all
convert 20frames.mp4[0-19] %06d.bmp
convert 20frames.mp4[9-19] %06d.bmp
But this does not
Code: Select all
convert 20frames.mp4[10-19] %06d.bmp
convert 20frames.mp4[11-18] %06d.bmp
However, this works.
Code: Select all
convert 20frames.mp4[10] %06d.bmp
convert 20frames.mp4[11] %06d.bmp
convert 20frames.mp4[18] %06d.bmp
convert 20frames.mp4[19] %06d.bmp
Re: subimage specification returns no images with video
Posted: 2014-08-22T14:08:59-07:00
by snibgo
Multiple digits, by itself, doesn't seem to cause a problem.
My tests suggest that errors arise when last < 2 * first.
But that might be coincidence. Someone needs to run low-level tests with the ffmpeg interface. My development environment can't do that.
Re: subimage specification returns no images with video
Posted: 2014-08-22T15:55:26-07:00
by dlemstra
It seems that ffmpeg does not support specifying a start frame. It only allows you to specify the total number of frames. It will always start at the first index. If you find an option that will allow us to specify the start index please tell us but I could not find it here:
https://www.ffmpeg.org/ffmpeg.html.
Re: subimage specification returns no images with video
Posted: 2014-08-22T17:18:59-07:00
by snibgo
ffmpeg: To get, for example, 12 frames from a movie starting at frame 4 (counting from zero):
Code: Select all
ffmpeg -an -r 1 -i 20frames.mp4 -ss 4 -r 1 -t 12 ox_%06d.png
Output frames will be numbered from 1, ie ox_000001.png to ox_000012.png. [EDIT corrected typo.]
-an: ignore input audio
-r 1: change input frame rate to 1 frame per second (so timestamp calculations are trivial)
-i 20frames.mp4: input filename
-ss 4: start at timestamp 4 seconds
-r 1: output framerate is 1 per second (same as input, so ffmpeg won't resample frames)
-t 12: duration of input in seconds
ox_%06d.png output filename.
Re: subimage specification returns no images with video
Posted: 2014-08-24T10:34:32-07:00
by dlemstra
That looks like it could work. I will give it a try this week and submit a patch if it works.
Re: subimage specification returns no images with video
Posted: 2014-08-24T10:56:01-07:00
by snibgo
I have corrected a typo.
The order of options to ffmpeg is critical. There are two "-r 1" options. The first changes metadata of the input stream. The second would, if different to the first, cause temporal supersampling or subsampling, so the output would have a different number of frames.