View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Aug 08, 2010 7:47 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
[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


Last edited by Too Many Secrets on Mon Aug 09, 2010 5:52 pm, edited 3 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 08, 2010 8:00 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
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).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 08, 2010 8:41 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
Thanks christ for the quick reply. I tried the above and I get
Code:
find: missing argument to `-exec'
Looking through man pages.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 08, 2010 8:52 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
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:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 6:51 am 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
Too Many Secrets wrote:
As you can see, I had the rebuild and video flags reversed... :oops:

yup. that would definitely do it too! :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 5:33 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 5:40 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
slowtolearn, that was the missing link!

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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 09, 2010 8:34 pm 
Offline
Joined: Mon Dec 24, 2007 9:47 am
Posts: 535
Location: Ottawa, Canada
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.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu