Advertisement

08.27.2008 at 01:02PM PDT, ID: 23683362
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

edit bash script to finish wait 5 minutes then repeat itself forever

Asked by toben88 in Shell Scripting

Tags: ,

Hi I have a shell script that encodes files. I need it to wait five minutes and look for new files to encode again.

Here is my psuedocode and the actual code.

/bin/bash
encode all video in a directory
wait 5 minutes start over

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
#!/bin/bash
 
rm -f /home/smartdata/www/files/encode/mp4/*.log
for movie in /home/smartdata/www/html/files/encode/mp4/*.* ; do
    NEWNAME=`basename $movie`
    ORIGINALPATH=$movie
    NEWNAME="${NEWNAME%.*}.mp4"
    NEWPATH=/home/smartdata/www/html/files/encoding/mp4/$NEWNAME
    FINALPATH=/home/smartdata/www/html/files/encoded/mp4/$NEWNAME
    COPYPATH=/home/smartdata/www/html/files/encode/mp4/copy/$NEWNAME
 
    echo Processing $movie
    echo -- New name is $NEWNAME
    echo -- New path is $NEWPATH
    echo -- Final path is $FINALPATH
    echo -- Original path is $ORIGINALPATH
ffmpeg -i "$movie" -y -an -pass 1 -vcodec libx264 -s 416x312 -b 500kb -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me epzs -subq 1 -trellis 0 -refs 1 -bf 16 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 500kb -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 "$NEWPATH"
 
ffmpeg -i "$movie" -y -threads auto -acodec libfaac -ab 64k -pass 2 -vcodec libx264 -s 416x312 -b 500kb -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me umh -subq 6 -trellis 1 -refs 4 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 500kb -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 "$NEWPATH"
mv $NEWPATH $FINALPATH
mv $ORIGINALPATH /home/smartdata/www/html/files/encode/mp4/finished/
done
 
Now help me tell script to wait 5 minutes and repeat
[+][-]08.27.2008 at 01:11PM PDT, ID: 22328700

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Shell Scripting
Tags: bash script shell, unix linux bash shell repeat wait
Sign Up Now!
Solution Provided By: omarfarid
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.27.2008 at 02:03PM PDT, ID: 22329208

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.27.2008 at 02:09PM PDT, ID: 22329249

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.27.2008 at 02:11PM PDT, ID: 22329267

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628