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

Michael Niedermayer michaelni
Tue Jan 4 06:19:11 CET 2011


On Sun, Jan 02, 2011 at 11:39:48PM +0100, 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?
> what about the order of elements of a *.jpg list? is it guranteed to be some
> useable order or just random luck?

Theres another question i have unless i missed it. For what use case is this
intended?
Files that are supposed to represent frames of a movie should in general be
numbered. The only immedeatly obvious case (to me) where one would want to
make a movie of non-numbered files is a slideshow of random pictures.

Also has a simple
cat *.jpeg | ffmpeg -i -
been considered ?

Iam not objecting to this wordexp stuff as such but to me it feels a lot like
a can or worms. If it would work consistently accross platforms, be simple and
more in line of the numbered images then it would be less ugly IMHO


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110104/9ec9c72e/attachment.pgp>



More information about the ffmpeg-devel mailing list