Because of the company's business needs, this morning the leader arranged to add a batch of FLV video on the keyframe. Here I use the Yamdi tool, combined with a small script that I wrote, to complete the task successfully. Yamdi installation here does not make a record, directly paste the script. The level is limited, please correct me.
#!/bin/sh Echo-n "Please enter the path from want to convert the video:" Read path If ["$path" = = ""] Then echo "Error:the input is empty." Exit 0 elif [!-D $path] Then echo "Error:sorry,can ' t find this directory." Exit 0 Else CD $path If [$?! = 0] Then echo "Error:the path is in ERROR, please check!" Exit 0 Fi Fi For D in ' ls-d * ' Do CD $path/$d Mkdir-p/outdir$path/$d file= ' ls *.flv ' For I in $file Do /usr/bin/yamdi-i $i-o outfile MV outfile/outdir$path/$d/$i Done Done echo "ok!" |
My situation here is that the video is stored in a level two directory, and after adding keyframes to be saved in the same directory structure, eg:
#./guanjianzhen.sh Please enter the path of want to convert the video:/a/b Ok! |
Note: A is my system directory, b for me to store the first level of FLV video directory, b directory also has a series of two level directory, the level two directory is the video we want to add keyframes.
This article is from "Life Beyond" blog, please be sure to keep this source http://cnlinux.blog.51cto.com/6112794/1433629