[FFmpeg-devel] [patch] allow wordexp globs in image2 file sequence import

Víctor Paesa victorpaesa
Tue Jan 4 00:33:34 CET 2011


Hi,

On Sun, Jan 2, 2011 at 23:39, Michael Niedermayer wrote:
> On Sun, Jan 02, 2011 at 08:52:26AM -0500, Brian Olson wrote:
>> 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,
>
> ls, cat, cp, ... need that too
>
> if you would argue concat had a annoying syntax that doesnt integrate nicely
> with the shell then id agree but moving shell functionality into applications
> is a bit uhm, especially if things like concats syntax is just left inconvenient
> and ignored while more hacks to do the same thing are added
> also is the needed stuff available on mingw? osx? bsd?

current mingw does not provide wordexp()
Windows shell (cmd.exe) has a 8192 command line char limit
(http://support.microsoft.com/kb/830473/)

> what about the order of elements of a *.jpg list? is it guranteed to be some
> useable order or just random luck?

http://pubs.opengroup.org/onlinepubs/007908799/xcu/chap2.html#tag_001_013
says filenames would be "sorted according to the collating sequence in effect
in the current locale"

Regards,
V?ctor



More information about the ffmpeg-devel mailing list