Use Yamdi to add keyframes to FLV videos in bulk under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.