SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2006, 11:16 AM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
Commercial Skipping in Linux

FYI:

For the Linux users searching for comskip info:

Last night I was able to get comskip and videoredo working on my Fedora Core 4 version using Wine application.

Comskip: copy the comskip.exe and comskip.ini to wine "windows" directory structure: Example
/root/.wine/drive_c/windows

Now from shell prompt.. you type wine comskip test.mpg
It should work...

- also to get Malore's comskip to work in the menu.
Create a comskip.exe file with "wine comskip $1" , and chmod 755 comskip.exe

Videoredo requires mozilla 'Gecko Engine' and Directx installed to work.

Afterwards, you can create a shell script to run in batch.
For Example:

wine cscript.exe //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" "/data/cubs.VPrj" "/var/media/test/cubs.mpg" /t1



Last edited by oddjob; 01-02-2007 at 11:43 AM.
Reply With Quote
  #2  
Old 12-30-2006, 09:38 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Quote:
Originally Posted by oddjob
FYI:

For the Linux users searching for comskip info:

Last night I was able to get comskip and videoredo working on my Fedora Core 4 version using Wine application.

Comskip: copy the comskip.exe and comskip.ini to wine "windows" directory structure: Example
/root/.wine/drive_c/windows

Now from shell prompt.. you type wine comskip test.mpg
It should work...

Videoredo requires mozilla 'Gecko Engine' and Directx installed to work.

Afterwards, you can create a shell script to run in batch.
For Example:

wine cscript.exe //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" "/data/cubs.VPrj" "/var/media/test/cubs.mpg" /t1


How much slower is this running in wine than on a windows system? My mass store runs Linux and would be the best place to run comskip, but I don't want it to hog all the CPU resources on the server.

Thanks,
mike
Reply With Quote
  #3  
Old 12-30-2006, 11:22 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
I have a AMD3500 XP cpu with 1 gig..

[root@homepvr ~]# sar 5 5
Linux 2.6.17-1.2142_FC4 (homepvr) 12/30/2006

11:16:55 PM CPU %user %nice %system %iowait %idle
11:17:00 PM all 85.09 0.00 14.91 0.00 0.00
11:17:05 PM all 86.80 0.00 13.20 0.00 0.00
11:17:10 PM all 90.12 0.00 9.88 0.00 0.00
11:17:15 PM all 94.01 0.00 5.99 0.00 0.00
11:17:20 PM all 94.80 0.00 5.20 0.00 0.00
Average: all 90.16 0.00 9.84 0.00 0.00

I think comskip runs comparable to windows (no difference).
I tried showanalyer and it also ran fine under wine.
Reply With Quote
  #4  
Old 12-31-2006, 11:29 AM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Quote:
Originally Posted by oddjob
I have a AMD3500 XP cpu with 1 gig..

[root@homepvr ~]# sar 5 5
Linux 2.6.17-1.2142_FC4 (homepvr) 12/30/2006

11:16:55 PM CPU %user %nice %system %iowait %idle
11:17:00 PM all 85.09 0.00 14.91 0.00 0.00
11:17:05 PM all 86.80 0.00 13.20 0.00 0.00
11:17:10 PM all 90.12 0.00 9.88 0.00 0.00
11:17:15 PM all 94.01 0.00 5.99 0.00 0.00
11:17:20 PM all 94.80 0.00 5.20 0.00 0.00
Average: all 90.16 0.00 9.84 0.00 0.00

I think comskip runs comparable to windows (no difference).
I tried showanalyer and it also ran fine under wine.
Sorry, I had a slight different question. Does it take as long to run on linux as on windows? Sounds like not that much longer if at all. Gotta love that linux efficiency. :-)

Now all we need is a dirmon equivalent and we are ready to go!

Thanks,
Mike
Reply With Quote
  #5  
Old 12-31-2006, 03:14 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
Again, should be same amount of time.

It works great for me..
I even stuck a ffmpeg line in my script to convert it to my ipod when done.
Reply With Quote
  #6  
Old 01-02-2007, 04:57 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Quote:
Originally Posted by oddjob
Again, should be same amount of time.

It works great for me..
I even stuck a ffmpeg line in my script to convert it to my ipod when done.
Great. Are you also running dirmon through wine, or do you have a cron job that checks for new videos to run comskip on. I'd like for it to work in the same way that dirmon does, so I can get com skip on a program that is presently recording.

Thanks,
mike
Reply With Quote
  #7  
Old 01-02-2007, 10:30 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
I've never used Dirmon. I can see on Windows how useful it can be
but on my linux pc, I can easily write shell script to do what I want.

FYI:
Using Sagetv commerical skip button from Menu. The following script will find and remove all commercials and rebuild mpeg from targeted video.

I created a 'comskip.exe' in /usr/local/bin directory.

#!/bin/bash

wine comskip $1

# Below I'm correcting problem output with comskip.
# Comskip for windows tries to create a windows directory structure.
# Videredo discovers mpeg location from VPrj file, so it should reflect linux filesystem not windows
FILENAME=$(ls -1 $1| cut -d'.' -f1)
TMPFILE=$FILENAME.tmp

echo "<Version>2" > $TMPFILE
echo "<Filename>$FILENAME.mpg" >> $TMPFILE

egrep "Cut|SceneMarker" $FILENAME.VPrj >> $TMPFILE

cp -rp $TMPFILE $FILENAME.VPrj

######## Below is Optional for using VideoRedo #######

# VideoRedo
wine cscript.exe //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" $FILENAME.VPrj $FILENAME.tmp /t1

cp -rp $FILENAME.tmp $FILENAME.mpg
rm -rf $TMPFILE $FILENAME.log $FILENAME.logo.txt $FILENAME.txt

Last edited by oddjob; 01-04-2007 at 08:29 PM.
Reply With Quote
  #8  
Old 01-02-2007, 11:58 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Thanks for the script. But what dirmon does is continuously scan a set of directories and whatever new recording shows up in the filesystem, it triggers a run of comskip, even if it's not complete yet.

Do you trigger your comskip manually, or do you have a script that scans directories periodically?

thanks,
mike
Reply With Quote
  #9  
Old 01-03-2007, 12:46 AM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
Quote:
Originally Posted by mikesm
Thanks for the script. But what dirmon does is continuously scan a set of directories and whatever new recording shows up in the filesystem, it triggers a run of comskip, even if it's not complete yet.

Do you trigger your comskip manually, or do you have a script that scans directories periodically?

thanks,
mike
Sounds like a nifty tool!
Right now, nothing written with a scheduler. .. but what you descibed is basically a small amount of code running from crontab or inittab. you can do a 'find' command to check modification timestamps on files and when condition is met run this script.
Reply With Quote
  #10  
Old 01-03-2007, 05:40 AM
Jere_Jones's Avatar
Jere_Jones Jere_Jones is offline
Sage Fanatic
 
Join Date: Apr 2004
Location: Jacksonville, FL
Posts: 993
When I was doing research for DirMon, one of the things I found was that linux as a built in ability to notify a program of when a directory changes. That ability doesn't exist in Windows (hence the constant polling). A linux tool to do what DirMon does shouldn't be that hard (for someone who knows linux, i.e. not me )

Jere
__________________
Death to commercials!!!
Latest ShowAnalyzer Beta version: 0.9.7
Reply With Quote
  #11  
Old 01-03-2007, 11:40 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Quote:
Originally Posted by Jere_Jones
(for someone who knows linux, i.e. not me )

Jere
Linux and windows are like 2 different religions. Its very rare for someone to be practicing both religions.
Reply With Quote
  #12  
Old 01-04-2007, 12:48 PM
Box8489 Box8489 is offline
Sage User
 
Join Date: Apr 2005
Location: Denmark, Europe
Posts: 33
Send a message via MSN to Box8489
Hi guys,

I am complete new into Linux, but somehow have I managed to setup a Ubuntu Linux system, running Sagetv with Nielms webserver and automated EPG grabber update - Awesome hmm ?
I have also managed to get Showanalyzer to work super within Wine as stated earlier here in the thread and the Comskip plugin detects the txt. files perfectly.

But If some hardcore Linux guy could help with a script or similar that could trig the Showanalyzer to run automatically when a new show has been recorded - would I be more than thankful..

Any ideas ?

Thanks in advance:
Michael Mondrup.
Reply With Quote
  #13  
Old 01-04-2007, 02:56 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Quote:
Originally Posted by Box8489
Hi guys,

I am complete new into Linux, but somehow have I managed to setup a Ubuntu Linux system, running Sagetv with Nielms webserver and automated EPG grabber update - Awesome hmm ?
I have also managed to get Showanalyzer to work super within Wine as stated earlier here in the thread and the Comskip plugin detects the txt. files perfectly.

But If some hardcore Linux guy could help with a script or similar that could trig the Showanalyzer to run automatically when a new show has been recorded - would I be more than thankful..

Any ideas ?

Thanks in advance:
Michael Mondrup.
This is the dirmon functionality that we were talking about before.

Oddjob, since it sounds like you are a hardcore linux hacker, any chance of getting something equivalent running on linux? Or maybe porting dirmon to work under wine?

thanks,
mike
Reply With Quote
  #14  
Old 01-04-2007, 03:30 PM
Box8489 Box8489 is offline
Sage User
 
Join Date: Apr 2005
Location: Denmark, Europe
Posts: 33
Send a message via MSN to Box8489
Hi Mike,

Yeah I think you're right:

Quote:
Originally Posted by oddjob
I've never used Dirmon. I can see on Windows how useful it can be
but on my linux pc, I can easily write shell script to do what I want.
We need help from the Linux gurus on this one..

Oddjob - Do you accept the challenge?

Regards:
Michael M.
Reply With Quote
  #15  
Old 01-04-2007, 05:55 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
Quote:
Originally Posted by Box8489
Hi Mike,

Yeah I think you're right:


We need help from the Linux gurus on this one..

Oddjob - Do you accept the challenge?

Regards:
Michael M.
Hi Mike,
My Programming experience is limited to script writing in shell,perl and expect. My main role during the day is unix administrator.

So if your asking for a simple script that checks for new video's to process, that I can do.

But, I have a feeling your looking for a gui application like dirmon, in that case... you would need to convince one of the many talented people in the forum, to join the dark side... and install the linux version of sagetv.
Perhaps they can write STV or something..

Last edited by oddjob; 01-04-2007 at 06:27 PM.
Reply With Quote
  #16  
Old 01-05-2007, 08:28 AM
Box8489 Box8489 is offline
Sage User
 
Join Date: Apr 2005
Location: Denmark, Europe
Posts: 33
Send a message via MSN to Box8489
Hi Oddjob,

Quote:
Originally Posted by oddjob
So if your asking for a simple script that checks for new video's to process, that I can do.
Yes, this is exactly what I'm asking for.
I do not need a gui. My Showanalyzer and the following detection/marking in Sage of the commercial parts is working like a charm, but today I have to start Showanalyzer from Wine manually and load the mpg file for processing.

Regards:
Michael M.
Reply With Quote
  #17  
Old 01-05-2007, 12:58 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Perhaps we could coax Jere into porting dirmon2?

Thanks,
Mike
Reply With Quote
  #18  
Old 01-05-2007, 01:07 PM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
great idea!

I second it!
Reply With Quote
  #19  
Old 01-06-2007, 12:24 AM
oddjob's Avatar
oddjob oddjob is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 184
Quote:
Originally Posted by mikesm
Perhaps we could coax Jere into porting dirmon2?

Thanks,
Mike
Actually Dirman2 runs in wine.
You need to create symbolic link within the wine directory structure.

I store my videos in /data
so I created symlink in /root/.wine/drive_c/windows
ln -s /data data

I also created a symlink for showanalyzer
ln -s "/root/.wine/drive_c/Program Files/Dragon Global/ShowAnalyzer/ShowAnalyzer.exe" ShowAnalyzer

FYI: Unix does'nt like spaces (see Program Files directory name).

thats it

Last edited by oddjob; 01-06-2007 at 12:40 AM.
Reply With Quote
  #20  
Old 01-06-2007, 01:19 PM
mikesm mikesm is offline
Sage Icon
 
Join Date: Jul 2003
Posts: 1,293
Dirmon runs in wine too? Really? Is it efficient? I mean it is constantly running scanning disks?

Wow, Wine has come a long way since I last played with it. Doesn't dirmon2 register as a service in Windows?

PS what is the syntax you use for running dirmon in wine? Do you have it set to start up on boot as well?


thanks,
mike
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.