SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV Customizations (http://forums.sagetv.com/forums/forumdisplay.php?f=27)
-   -   Commercial Skipping in Linux (http://forums.sagetv.com/forums/showthread.php?t=22404)

oddjob 12-30-2006 11:16 AM

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



mikesm 12-30-2006 09:38 PM

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

oddjob 12-30-2006 11:22 PM

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.

mikesm 12-31-2006 11:29 AM

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

oddjob 12-31-2006 03:14 PM

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.

mikesm 01-02-2007 04:57 PM

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

oddjob 01-02-2007 10:30 PM

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

mikesm 01-02-2007 11:58 PM

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

oddjob 01-03-2007 12:46 AM

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.

Jere_Jones 01-03-2007 05:40 AM

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

roxy99 01-03-2007 11:40 AM

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.

Box8489 01-04-2007 12:48 PM

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.

mikesm 01-04-2007 02:56 PM

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

Box8489 01-04-2007 03:30 PM

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? :hi:

Regards:
Michael M.

oddjob 01-04-2007 05:55 PM

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? :hi:

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..
:)

Box8489 01-05-2007 08:28 AM

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.

mikesm 01-05-2007 12:58 PM

Perhaps we could coax Jere into porting dirmon2? ;)

Thanks,
Mike

oddjob 01-05-2007 01:07 PM

great idea!

I second it!

oddjob 01-06-2007 12:24 AM

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
http://pages.prodigy.net/bob_smith/Screenshot.png

mikesm 01-06-2007 01:19 PM

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


All times are GMT -6. The time now is 06:03 PM.

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