[FFmpeg-devel] [patch] allow wordexp globs in image2 file sequence import
Brian Olson
icic
Sun Jan 2 14:52:26 CET 2011
On Jan 1, 2011, at 10:28 PM, Michael Niedermayer wrote:
> On Fri, Dec 31, 2010 at 12:11:26PM -0500, Brian Olson wrote:
>> It seemed cumbersome to me to have to symlink/rename my image sequence files to fit
>> ffmpeg -i prefix%05d.jpg
>> so I hacked libavformat/img2.c to use <wordexp.h> file globbing, and now I can
>> ffmpeg -i '*.jpg'
>> (and other shell-expnsion patterns like ? * [] {})
>>
>> This is my first attempt at submitting to ffmpeg. I hope you like it. Feedback welcome. Hopefully I didn't break the conventions too much.
>>
>> Brian Olson
>> http://bolson.org/
>>
>
>> img2.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
>> 1 file changed, 55 insertions(+), 8 deletions(-)
>> 27ac4fb6e59175875e0fc3ef0c46f21e3bdfe196 img2_wordexp.diff
>
> is there an advantage in this over using the concat protocol?
My reading of the concat: protocol is that it would require all the files to be listed sequentially on the command line, and given enough frames that will simply be impossible. (I think I heard linux exec() has a limit of 64kb of effective command line.) Even if possible it would be inconvenient to type out all those filenames, or write a script to build the command. Stepping through the files internally seems to be the way to go. ffmpeg already can step through a very limited kind of file pattern internally; I think this way is better. It certainly makes my common usage case a lot easier.
Brian Olson
http://bolson.org/
More information about the ffmpeg-devel
mailing list