I'm not sure of what I'll rewrite the script in.  I know a lot more about
transcode now then when I threw together this one.  I pretty much wrote it
as a proof of concept.  Like most hacks it became to useful and it did the
job well enough for me to be happy with.  I've though about redoing it in
perl or C but bash seems to work just as well and most people can understand
it to hack the script when they need to.

I don't remember why I disabled the frame rate stuff.  I do know that I was
confused be cause of the output differences that tcscan and tcprobe would
give me.  Tcprobe would give me a frame rate of 23 and tcscan would give a
frame rate 29.  I never was sure which one to use so I just figured I would
let transcode figure it out.

Awk was a hack.  It was the first thing I though of when I realized that I
couldn't get bash to the required math right.  I hacked together this script
at about 1 am and was probably flying on one wing and a few cups of coffee.
Anyway, I figure out how to do what I need to do with bc but the awk code
works well and I'm to lazy to replace it.  

I need to tighten up the size part of the code anyway.  AutoGK on windows
will nail the proper size with in a few meg.  Mine gets close, as in
tactical nuclear weapon close.  I just looked through last nights work and I
had set the -s to 650 MB.  Most of the files are 649mb to 651mb but a few
where 550mb and 620mb.  Funny thing is they look perfect despite the size
differences.  I'm just chalking it up that transcode knows more about what
is doing than I do.

One of the things about using the batch queue is it will also mail you a
copy of the stdout and stderr when each file is done.  That way you can dig
through them and look for errors.

Jeff 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Francesco Romani
Sent: Thursday, June 29, 2006 5:23 PM
To: [email protected]
Subject: Re: [transcode-users] Script Posting?

On Thu, 29 Jun 2006 16:36:10 -0500
"Jeff Hyche" <[EMAIL PROTECTED]> wrote:

Hi,

> Okay, hear goes.  I hacked together this script in an hour last Chirstmas
> back when I was just learning how to use trancode.  I got it working and
> I've pretty much left it alone since then.  I'm in the process of
rewriting
> it but this script is useful.

For sake of curiosity, are you rewriting the script in bash or in some other
language?

[cut explanation]
> Another good thing about using the batch queue is each file can have
> different parameters.  You can submit one file to be encoded as a divx
then
> turn around, change the script and submit another one to be encoded as a
> mpeg2.

Looks really nice. Thanks for this contribute, I'll upload to wiki ASAP
unless of course take care more quickly.

[...]
> for _target in $*
>   do
>   
>   # Get Video Frame Rate and Code
>   #tcscan -i ${_target} > scan.$$ 2>&1
>   #_frame_rate=`awk '/sequence:/ {print $4}' scan.$$`
>   _frame_rate=`tcprobe -i ${_target} | awk '/frame rate: -f/ {print $4}'`
>   case ${_frame_rate} in
>     23.976) _frame_code=1;;
>     24) _frame_code=2;;
>     25) _frame_code=3;; 
>     29.970) _frame_code=4;;
>     30) _frame_code=5;;
>   esac

Here the new tcprobe raw mode will be useful (avalaible in future 1.1.0) :)

>   # Want to calculate bitrate on the fly because of the time it
>   # it takes to do so
>   echo "_vid_brate=\`echo | awk -v S=\${_S} -v L=\${_L} -v A=\${_A} \
>        '{printf \"%d\", ((S-(A*L))/L)*8}'\`" >> ${_target}.sh

Interesting! (I'm an awk enthusiast even if not so expert ;) )
Maybe bc can be useful here?

Best regards,

-- 
Francesco Romani - Ikitt ['people always complain, no matther what you do']
IM contact    : (email first, Antispam default deny!) icq://27-83-87-867
known bugs    : http://www.transcoding.org/cgi-bin/transcode?Bug_Showcase
tiny homepage : http://fromani.exit1.org (see IDEAS if you want send code!)

Reply via email to