[mythtv-users] cutlist parsing help needed.

belcampo belcampo at zonnet.nl
Sat Nov 27 15:36:36 UTC 2010


I have an almost 6 hour Manual recording, several programs, with 
following cutlist.
0-14893,50509-63697,131041-142393,226249-238405,276157-287713,364849-375277,393373-532455

I would like to have 6 individual recordings of them.

1st resulting file I should get with:
ffmpeg -ss (14893*.04) -vframes (50509-14893) -i source.mpg 'several 
options' program1.mp4

2nd
ffmpeg -ss (63697*.04) -vframes (131041-63697) -i source.mpg 'several 
options' program2.mp4

etc.

How could I get the cutlist into variables so I would be able generate 
the commands.

I'm able to define a calc function with
calc ()  { echo "scale=1;$*" | bc -l; }

First -ss $ss1
ss1=$(calc 2nd# of cutlist * .04)
First -vframes $vframes1
vframes1=$(calc 3rd# of cutlist - 2nd# of cutlist)

So the resulting coomand would be:
ffmpeg -ss $ss1 -vframes $vframes1 options program1.mp4
ffmpeg -ss $ss2 -vframes $vframes2 options program2.mp4
etc.

Many thanks in advance for a bash/sed guru, who is able to help me with 
this.

Henk Schoneveld


More information about the mythtv-users mailing list