拼抢每4个文件 [英] Grabbing every 4th file

查看:104
本文介绍了拼抢每4个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有16000 JPG从webcan screeb采集我让运行了一年的一端指向后面持平。我想找到一种方法,抓住每4个图像,这样我可以把它放到另一个目录中,以便以后我可以把它们拍成电影。有一个简单的bash脚本或者linux下的其他方式,我可以做到这一点。

I have 16,000 jpg's from a webcan screeb grabber that I let run for a year pointing into the back year. I want to find a way to grab every 4th image so that I can then put them into another directory so I can later turn them into a movie. Is there a simple bash script or other way under linux that I can do this.

它们被命名为像这样......

They are named like so......

框-44558.jpg

frame-44558.jpg

框-44559.jpg

frame-44559.jpg

框-44560.jpg

frame-44560.jpg

框-44561.jpg

frame-44561.jpg

这对于新手需要帮助的感谢。

Thanks from a newb needing help.

似乎已经奏效。
在我origonal POST错误的情侣。实际上有28万的图像和命名了。
/home/baldy/Desktop/webcamimages/webcam_2007-05-29_163405.jpg
/home/baldy/Desktop/webcamimages/webcam_2007-05-29_163505.jpg
/home/baldy/Desktop/webcamimages/webcam_2007-05-29_163605.jpg

Seems to have worked. Couple of errors in my origonal post. There were actually 280,000 images and the naming was. /home/baldy/Desktop/webcamimages/webcam_2007-05-29_163405.jpg /home/baldy/Desktop/webcamimages/webcam_2007-05-29_163505.jpg /home/baldy/Desktop/webcamimages/webcam_2007-05-29_163605.jpg

我跑了。
CP $(LS | awk的'{NR ++;如果(NR%10 == 0)打印$ 0}')../ newdirectory /

I ran. cp $(ls | awk '{nr++; if (nr % 10 == 0) print $0}') ../newdirectory/

这似乎已复制图像。 70-900每天从它的外观。

Which appears to have copied the images. 70-900 per day from the looks of it.

现在我跑
 男人codeR MF://*.jpg -mf W = 640:H = 480:FPS = 30:类型= JPG -ovc lavc使用-lavcopts V codeC = msmpeg4v2 -nosound -o ../output- msmpeg4v2.avi

Now I'm running mencoder mf://*.jpg -mf w=640:h=480:fps=30:type=jpg -ovc lavc -lavcopts vcodec=msmpeg4v2 -nosound -o ../output-msmpeg4v2.avi

我会让你知道电影是如何工作的。

I'll let you know how the movie works out.

更新:影片没有工作。
只有从2007年图像它,即使该目录下有2008年为好。
webcam_2008-02-17_101403.jpg webcam_2008-03-27_192205.jpg
webcam_2008-02-17_102403.jpg webcam_2008-03-27_193205.jpg
webcam_2008-02-17_103403.jpg webcam_2008-03-27_194205.jpg
webcam_2008-02-17_104403.jpg webcam_2008-03-27_195205.jpg

UPDATE: Movie did not work. Only has images from 2007 in it even though the directory has 2008 as well. webcam_2008-02-17_101403.jpg webcam_2008-03-27_192205.jpg webcam_2008-02-17_102403.jpg webcam_2008-03-27_193205.jpg webcam_2008-02-17_103403.jpg webcam_2008-03-27_194205.jpg webcam_2008-02-17_104403.jpg webcam_2008-03-27_195205.jpg

如何修改我的男人codeR线,以便它使用的所有图像?

How can I modify my mencoder line so that it uses all the images?

推荐答案

一个简单的方法是:


$ touch a b c d e f g h i j k l m n o p q r s t u v w x y z
$ mv $(ls | awk '{nr++; if (nr % 4 == 0) print $0}') destdir

这篇关于拼抢每4个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆