LinHES Forums
http://forums.linhes.org/

Batch seektable rebuild? [solved twice, can you make it 3?]
http://forums.linhes.org/viewtopic.php?f=17&t=21273
Page 1 of 1

Author:  Too Many Secrets [ Sun Aug 08, 2010 7:47 pm ]
Post subject:  Batch seektable rebuild? [solved twice, can you make it 3?]

[solutions at bottom of post]

I've been using
Code:
mythcommflag --rebuild --video /path/to/vid
to rebuild a seektable when the Internal player borks a vid on playback. This works fine. BUT, is there a batch solution to this?

I tried
Code:
for f in *.vob # *.avi *.mpg *.nuv;
do mythcommflag --video --rebuild "$f" ;
done
... but to no avail.

TIA

[SOLTUIONS]

These below work to rebuild a seektable of multiple vids.


1. This will find vobs in all sub-directories
Code:
find . -name \*\.vob -exec mythcommflag --rebuild --video {} \;


2. This will work in current directory and should be wrapped in a script.
Code:
for f in *.vob ;
do mythcommflag --rebuild --video $f ;
done

Author:  christ [ Sun Aug 08, 2010 8:00 pm ]
Post subject: 

You might be looking for something more like
Code:
find . -name \*\.vob -exec mythcommflag --rebuild --video {} ;

There are many ways to do this including using ls and sed but I find the above practical because it can traverse a directory structure.

You might have to play with the escaping as I'm doing this from memory.

the -print option on find should let you know what file it is working on.

Oh and in your example "$f" should be just $f (no quotes).

Author:  Too Many Secrets [ Sun Aug 08, 2010 8:41 pm ]
Post subject: 

Thanks christ for the quick reply. I tried the above and I get
Code:
find: missing argument to `-exec'
Looking through man pages.

Author:  Too Many Secrets [ Sun Aug 08, 2010 8:52 pm ]
Post subject: 

OK, went back and revised the original. This seems to be working.

Code:
for f in *.vob ;
do mythcommflag --rebuild --video $f ;
done


As you can see, I had the rebuild and video flags reversed... :oops:

Author:  christ [ Mon Aug 09, 2010 6:51 am ]
Post subject: 

Too Many Secrets wrote:
As you can see, I had the rebuild and video flags reversed... :oops:

yup. that would definitely do it too! :)

Author:  slowtolearn [ Mon Aug 09, 2010 5:33 pm ]
Post subject: 

christ wrote:
You might be looking for something more like
Code:
find . -name \*\.vob -exec mythcommflag --rebuild --video {} ;


Too Many Secrets wrote:
Thanks christ for the quick reply. I tried the above and I get
Code:
find: missing argument to `-exec'
Looking through man pages.


To those interested, christ's solution was missing a character:
Code:
find . -name \*\.vob -exec mythcommflag --rebuild --video {} \;
should do it, and has the benefit of working on .vob files within subdirectories.

Author:  Too Many Secrets [ Mon Aug 09, 2010 5:40 pm ]
Post subject: 

slowtolearn, that was the missing link!

I'll edit the OP to reflect the working code.

Author:  christ [ Mon Aug 09, 2010 8:34 pm ]
Post subject: 

slowtolearn wrote:
To those interested, christ's solution was missing a character:
Code:
find . -name \*\.vob -exec mythcommflag --rebuild --video {} \;
should do it, and has the benefit of working on .vob files within subdirectories.

Thanks for picking that out. As Get Smart would say... missed it by *that* much.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/