Re: [LAU] [OT] a sorting problem with AVSynthesis and mencoder

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-user@...>
Date: Tuesday, November 27, 2007 - 2:44 pm

On Tue, Nov 27, 2007 at 07:01:11AM -0500, Dave Phillips wrote:

sort(1) combined with xargs(1) should do the trick. Try this:

ls *tga | sort -n | xargs mencoder -ovc lavc -lavcopts vcodec=mpeg4:vme=1:keyint=30:vbitrate=1000 -vf scale=800:600 -noskip -mf type=tga:fps=30 -o avs-001.avi

> So, my question is, how do I get mencoder to read the TGA files by their

To get most recent files last, you could do:

ls -rt *tga | xargs mencoder ...

but I'd stick with sort -n instead, because if you accidentally touch
a file in the middle, it will move to the end of the list...

> Otherwise I have to

Or you could use rename(1). For example:

pw@kermit namegunk $ ls
0.tga 11.tga 13.tga 15.tga 17.tga 19.tga 2.tga 4.tga 6.tga
8.tga
10.tga 12.tga 14.tga 16.tga 18.tga 1.tga 3.tga 5.tga 7.tga
9.tga
pw@kermit namegunk $ rename "" 0 ?.tga
pw@kermit namegunk $ ls
00.tga 02.tga 04.tga 06.tga 08.tga 10.tga 12.tga 14.tga 16.tga
18.tga
01.tga 03.tga 05.tga 07.tga 09.tga 11.tga 13.tga 15.tga 17.tga
19.tga
pw@kermit namegunk $ rename "" 0 ??.tga
pw@kermit namegunk $ ls
000.tga 003.tga 006.tga 009.tga 012.tga 015.tga 018.tga
001.tga 004.tga 007.tga 010.tga 013.tga 016.tga 019.tga
002.tga 005.tga 008.tga 011.tga 014.tga 017.tga

... repeat as necessary.

Having done that, your original comand should work.

--

Paul Winkler
http://www.slinkp.com
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] [OT] a sorting problem with AVSynthesis and mencoder, Dave Phillips, (Tue Nov 27, 12:01 pm)
Re: [LAU] [OT] a sorting problem with AVSynthesis and mencoder, Paul Winkler, (Tue Nov 27, 2:44 pm)