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 07-31-2004, 02:31 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
Commercial Advance Beta Release

This is intended for users who are familiar with changing .stv files and know how SageTV works. It also won't work,as is, on the SageTV Client because of file access issues

Note: Several other custom STV files also have added support for comskip and Jere_Jones has added several different detection methods and features to the comskip program. His latest version can usual be found near the end of this thread.

I've updated my custom .stv file to implement commercial advance, by reading a .txt file that has a list of the start and end frames for commercials. You'll need to assign buttons for the custom 4 and 5 commands. I suggest using "[" and "]" but anything will work and of course you can also use girder or something else to send these commands. Custom 5 skips ahead to the beginning of the next non-commercial segment. Custom 4 skips back to the previous segment, commercial or non-commercial. Commercials are shown in purple.


Note: At the moment the skips aren’t frame accurate, so you may see a couple seconds of commercial.

The commercial break .txt files are generated by running the enclosed comskip.exe file on the desired mpeg files. I have also added the ability to do this from the options menu of my custom SageTV Recordings. The process runs in the background, so you can do other things while it is working. You will receive a pop up message in SageTV when commercial detection is completed, I would suggest you not start commercial detection on more than one file at a time, but you call run commercial detection on an entire group at once. On my 2.4 GB P4 computer, commercial detection runs at around 200 frames per second (just under 7x normal speed) at full CPU usage. Comskip.exe runs at normal class/idle priority, so you shouldn’t notice a major system slow down. I have also implemented running commercial detection automatically when SageTV is asleep and no programs are scheduled to be recording in the next 15 minutes. This can be enabled on the Settings menu in the Customs Menu, but I haven’t had time to fully test it.

The commercial detection program will be open source. It uses libmpeg2 to read the mpeg2 files and I added commercial detection by rewriting and tweaking some of the commercial detection code from MythTV. Currently, I'm just using the blank scene detection, because the accuracy of the scene change detection was somewhat poor and the CPU usage was high. Any Visual C programmers interested in working on this?

Installation: After downloading, install malore.stv as normal and put comskip.exe and comskip.ini in the main SageTV folder where wiz.bin is.


Update August 2:
• Added Commercial Auto Skip. Turn it off or on in the media player's option menu. If it skips something that isn't a commercial, uses the Custom4 command to jump back. It won't skip the same section twice in a row.
• Background commercial detection (if enabled) will also run when the screen saver is active.
• The delete commands in my custom SageTV Recordings and the Recording Detail Screen will also attempt to delete the supplemental files (.xml,.smi,.txt) for that file.
• If the now_playing_file property is set to a file path, the media player will output the name, episode, duration, and current play position to the file indicated.
• Added [CA] and [CC] after the show name in the description frame to indicate that the commercial advance or closed captioning (.smi) files are available.

Update August 3:
• Stopped showing the time bar after auto skipping, because it wouldn't auto close.
• Added carriage return to the line breaks of the now playing file.
• The now playing file is deleted after leaving SageTV's media player.

Update August 4:
• The SageTV client is no longer prevented from processing commercial in the background.
• Added two settings to the sage.properties file.
- Set background_commercial_processing_awake=true to allow background commercial processing while SageTV is awake.
- Set background_commercial_processing_recording=true to allow background commercial processing while SageTV is recording another show.
• In the Custom Menus menu, the info command (ctrl-I), will bring up an about box with the date my STV was last updated.
• I've made a couple adjustments to the commercial detection settings that I found to work a little better, but rather than spending all my time trying to figure out the perfect, one-size-fits-all settings, I've made most of the black frame detection settings configurable with a settings file (comskip.ini) I also included a file that has close to the original settings.

Update August 14:
• Added adjustment to SageTV's playing time to hopefully better align the marked breaks with playback.
• You can now have background commercial processing ignore shows recorded on specific channels. Edit the sage.properties file and set background_commercial_processing_ignore= a list of channel number seperated by commas (ex. 78,11)
• Changed how the commercial autoskip function was implemented to hopefully work better with pvr-350's.
• The custom 5 command will now start commercial processing on the currently selected episode in my version of SageTV Recordings.
• Added additional levels to the verbose setting of the comskip.ini file.
verbose=1 shows building of commercial breaks on screen
verbose=2 writes building of commercial breaks to file
verbose=3 writes list of black frame breaks
verbose=4 writes list of every black frame detected

1) Download malorebeta.zip for SageTV 2.0 or
Go to Malore's STV Homepage for the latest SageTV 2.1 compatable version.
2) Backup your sage.properties and wiz.bin files, just to be safe.
3) Follow the instructions on Malore's STV Homepage

enjoy,
malore

Last edited by malore; 02-02-2005 at 01:19 PM.
Reply With Quote
  #2  
Old 07-31-2004, 02:56 PM
ErsatzTom's Avatar
ErsatzTom ErsatzTom is offline
Sage Expert
 
Join Date: Dec 2003
Location: Southwest Florida
Posts: 712
Send a message via AIM to ErsatzTom
I'll help in any way I can.

t
__________________
Thomas Micheline
duff@sage-community.org
http://www.sage-community.org/
Reply With Quote
  #3  
Old 07-31-2004, 04:18 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
Had to make a minor update.

Anyone wanting to help with my scene detection program should download libmpeg2 and be able to compile the mpeg2dec test program which is the basis of my program.
Reply With Quote
  #4  
Old 07-31-2004, 04:38 PM
Deadbolt's Avatar
Deadbolt Deadbolt is offline
Sage Expert
 
Join Date: Nov 2003
Posts: 687
very very cool! can't wait to try it!

Edit: Malore: Where in the options is the selection to do this? All I see is "create .xml for mpeg" and "create shows.xml"

Last edited by Deadbolt; 07-31-2004 at 05:03 PM.
Reply With Quote
  #5  
Old 07-31-2004, 05:20 PM
Fluffdaddy Fluffdaddy is offline
Sage Icon
 
Join Date: Nov 2003
Location: Philly, Pa
Posts: 1,004
malore

Thanks for your time and effect. Commercial Advance is the only thing about Sage I miss and want dearly...............Yes even e-nuff to pay for it
__________________
We’re doomed. It will never work
Reply With Quote
  #6  
Old 07-31-2004, 05:51 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
Deadbolt: It should show up right after the .xml option when viewing the options menu in my custom version of SageTV Recordings (to set this, Custom Menus --> Settings -> Sage Recordings Style -> malore) If you switched the STV file without restarting SageTV, see if restarting it helps. Also be sure to download from the link on the first post and not from my usual site.


Last edited by malore; 07-31-2004 at 05:59 PM.
Reply With Quote
  #7  
Old 07-31-2004, 06:54 PM
Deadbolt's Avatar
Deadbolt Deadbolt is offline
Sage Expert
 
Join Date: Nov 2003
Posts: 687
I had switched to the Maldude .stv, but switched back to pure Malore goodness afterward. Now I have upgraded to your beta. I don't see the commercial detect item. I have restarted SageTV, and even rebooted. No help. I deleted the mldude stuff and still no help. Any ideas? I have run comskip manually on a file, and have the .txt file, but it is not recognized in SageTV.

Is there a good way to clear all .stv stuff except originalv2.stv and then reload your beta? Maybe this is the best option.

Again, thanks for you efforts! Your skin alone has enhanced my (and my wife's) Sage experience imeasurably. Now, this commerical skip is another revolutionary step. I bet someone automates it soon..auto process new recordings, and also auto skip (so you don't even need to hit Custom 5) --- an we will be in heaven.
Reply With Quote
  #8  
Old 07-31-2004, 07:19 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
Deadbolt, if one of the options in Custom Menus --> Settings isn't Background Commercial Processing then for some reason you're not using the beta version. Having other .stv files around shouldn't matter as long as the sage.properties file points to the correct .stv file. You might want to extract malore.stv from the malorebeta.zip file again and replace the one in the originalv2 folder again while SageTV isn't running.

Last edited by malore; 07-31-2004 at 07:33 PM.
Reply With Quote
  #9  
Old 07-31-2004, 07:46 PM
mightyt's Avatar
mightyt mightyt is offline
Sage Icon
 
Join Date: Jul 2004
Location: CA.
Posts: 1,293
Hope this is not uncool to ask ...

Is this implimentable witrh MlbDude?
Reply With Quote
  #10  
Old 07-31-2004, 09:18 PM
chrysek chrysek is offline
Sage Aficionado
 
Join Date: Jun 2004
Location: New York
Posts: 289
Send a message via AIM to chrysek Send a message via Yahoo to chrysek
Sorry for this but I cant get this to work Ok, I did put malore.stv and png file into C:\Program Files\Frey Technologies\SageTV\STVs\OriginalV2 directory.
comskip.exe is in C:\Program Files\Frey Technologies\SageTV directory
when I go to commercial detect it does came up with a window saying "Commercial Detection Failed". I think I did everything ok. I am trying it on a client system, not on sage server, maybe that is the problem? but I did put those files in the exactly same location on the server pc.

Any ideas why it would fail? Is there a way to see some kind of debuging logs for it? Do I need to install anything else except those 3 files?

This is great stuff I am so ancious to try it.

Chris

PS: just a little update:
it does not work from sage client machine, but it does work on sageserver.
on the client machine I did run in the dos window command:
C:\Program Files\Frey Technologies\SageTV>com
087-0.mpg
mpeg2dec-0.4.0 - by Michel Lespinasse <walken
20921 frames in 334.77 sec (62.49 fps), 60 la
20951 frames decoded in 335.29 seconds (62.49
1 - start: 853 end: 7626

C:\Program Files\Frey Technologies\SageTV>
and it did work, so I guess this function was not implemented on a SageTV client box but on the server only.

Love this tool...
__________________
Intel Pentium 4 3.0ghz 800mhz FSB, D.VINE 4 w/VFD display Case, GIGABYTE "GA-8IPE1000 PRO-G" i865PE Chipset Motherboard, Dual DDR 400 1024mb RAM (2x512mb), Windows XP Pro SP2 + SageTV 4.1.12 + Java j2re-1.5._02, ATI 9600 128mb DVI out, 200gb OS Drive, 2x160gb EIDE and 7x400gb SATA Video storage hard drives, Hauppauge PVR-250 to Time Warner HD Digital Cable Receiver, Hauppauge PVR-250 to Dish Network Receiver, Hauppauge PVR-350 to Time Warner Cable redy input, ATI HDTV card, USB-UIRT w/Hauppauge remote.

Last edited by chrysek; 07-31-2004 at 09:43 PM.
Reply With Quote
  #11  
Old 07-31-2004, 09:31 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally posted by chrysek
I am trying it on a client system, not on sage server, maybe that is the problem?
Please note the 2nd sentence of malore's original post, which says:
Quote:
Originally posted by malore
It also won't work,as is, on the SageTV Client because of file access issues
Edit: See malore's comments, below. Maybe I should remove this post now that malore has said how to use it on the client... but then the next post would seem strange.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.

Last edited by Opus4; 08-01-2004 at 12:01 AM.
Reply With Quote
  #12  
Old 07-31-2004, 10:07 PM
chrysek chrysek is offline
Sage Aficionado
 
Join Date: Jun 2004
Location: New York
Posts: 289
Send a message via AIM to chrysek Send a message via Yahoo to chrysek
Ah, sorry about that, I did miss that statement But I love this feature. It is the coolest thing..
__________________
Intel Pentium 4 3.0ghz 800mhz FSB, D.VINE 4 w/VFD display Case, GIGABYTE "GA-8IPE1000 PRO-G" i865PE Chipset Motherboard, Dual DDR 400 1024mb RAM (2x512mb), Windows XP Pro SP2 + SageTV 4.1.12 + Java j2re-1.5._02, ATI 9600 128mb DVI out, 200gb OS Drive, 2x160gb EIDE and 7x400gb SATA Video storage hard drives, Hauppauge PVR-250 to Time Warner HD Digital Cable Receiver, Hauppauge PVR-250 to Dish Network Receiver, Hauppauge PVR-350 to Time Warner Cable redy input, ATI HDTV card, USB-UIRT w/Hauppauge remote.
Reply With Quote
  #13  
Old 07-31-2004, 10:08 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
You can make playback on the client work, if the client has a copy of the .txt file in the same location on the client machines as it appears on the server. So if on the server the file for the show being played is C:/videos/show-0.mpg and you've already generated the C:/videos/show-0.txt commercial file. Just copy all the .txt files to C:/videos on the client machine. If your server stores everying on a drive other than C:, you might be able to just setup a mapped drive with the same drive letter and have everything work without any additional effort.

Last edited by malore; 07-31-2004 at 10:12 PM.
Reply With Quote
  #14  
Old 07-31-2004, 11:30 PM
insomniac's Avatar
insomniac insomniac is offline
Sage Icon
 
Join Date: May 2003
Location: Concord, Ca.
Posts: 1,104
Quote:
Originally posted by malore
You can make playback on the client work, if the client has a copy of the .txt file in the same location on the client machines as it appears on the server. So if on the server the file for the show being played is C:/videos/show-0.mpg and you've already generated the C:/videos/show-0.txt commercial file. Just copy all the .txt files to C:/videos on the client machine. If your server stores everying on a drive other than C:, you might be able to just setup a mapped drive with the same drive letter and have everything work without any additional effort.

When I setup my Video directories, I configured them by unc (even on the server). e.g.

drive 1 = \\server\sage
drive 2 = \\server\sage1
drive 2 = \\server\sage2

Wouldnt this work as a permanent solution? Or do you think this is broke and will require copying the txt files over still?

I would just install it and try it tonight, but my WAF is going down from being on the PC too much

I.
__________________
If you're not cheating, your not trying...

My sage rigs:
Server - Windows 2003, Intel 865 PERLL w/ P4 3.2g 1gb ram, 3-PVR250, 3-PVRUSB's, 1 Skystar2, 1 twinhan 102g, 1 starbox DVB-S Cards. Evo network QAM encoder. 1.2TB storage 6.x server + MTSAGE for DVB
Client 1/Master BR - MediaMVP running a 30" Olevia LCD TV.
Client 2/Front Room - Shuttle ST61G4 XPC 1gig ram, 60gb HD, BTC9019 wireless keyboard/mouse & Harmony 880. 6.x client. GF6600GT driving a Sony WEGA 55" rear projection tv.
Reply With Quote
  #15  
Old 07-31-2004, 11:50 PM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
insomniac, that sounds like that would work to me. I don't have the SageTV client, but I can run comskip.exe using a unc path without any problems.
Reply With Quote
  #16  
Old 08-01-2004, 06:34 AM
Deadbolt's Avatar
Deadbolt Deadbolt is offline
Sage Expert
 
Join Date: Nov 2003
Posts: 687
Malore, got it working!

Beautiful! Thanks!
Reply With Quote
  #17  
Old 08-01-2004, 07:31 AM
Jere_Jones's Avatar
Jere_Jones Jere_Jones is offline
Sage Fanatic
 
Join Date: Apr 2004
Location: Jacksonville, FL
Posts: 993
Very impressive. So far I've tried it on a variety of shows and when it works, it works great! It seems there is no middle ground. IOW, it either does a great job or a crappy job depending on the show. BTW, it works much more often than not.

I think that signal quality makes a large difference too. I recorded a couple shows that were very noisy and comskip didn't write a single frame number. But that was to be expected because there were NO black frames. There were noisy black frames, but not entirely black.

I think I have found a bug though. If you start to watch the show before the commercial detection is complete then the marked commercials don't show up and you can't skip using custom4 or 5.

Overall this is a GREAT JOB!!

Question: When custom4 says jump to the next non-commercial, is it jumping to a frame number or a time derived from the frame number?

Jere

Last edited by Jere_Jones; 08-01-2004 at 07:46 AM.
Reply With Quote
  #18  
Old 08-01-2004, 08:35 AM
ToxMox's Avatar
ToxMox ToxMox is offline
Sage Icon
 
Join Date: Oct 2003
Location: NJ
Posts: 1,980
Malore,
Great work!
So the background commercial processing only goes when sage is sleeping? I never sleep my Sage. How about if the Sage screensaver kicks in and there isn't anything scheduled in the next 15 minutes that it also starts background commercial detection.
So far I've only tested it on World Series of Poker and it works great. I'm waiting for it to process some more files.
Reply With Quote
  #19  
Old 08-01-2004, 09:03 AM
kny3twalker kny3twalker is offline
SageTVaholic
 
Join Date: Feb 2004
Posts: 3,074
Hey can we get an icon for when a show has been commercial skipped so we know that it has been done or after it has been started

really enjoying this feature by the way


also since it has been a while since I have used your STV
when I choose preview window rather than video background
I get video on top of the menu screens where there is no place for it
it sometimes overlaps menu titles and the blue bar dissappears behind it

and is there a reason that you made it so we can only use this option with the one view of the recording?
Reply With Quote
  #20  
Old 08-01-2004, 10:09 AM
malore's Avatar
malore malore is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Iowa
Posts: 877
Quote:
Originally posted by Jere_Jones
I think that signal quality makes a large difference too. I recorded a couple shows that were very noisy and comskip didn't write a single frame number. But that was to be expected because there were NO black frames. There were noisy black frames, but not entirely black.
See if the attached version works better, run it manually on the problem file.
Quote:
Originally posted by Jere_Jones
I think I have found a bug though. If you start to watch the show before the commercial detection is complete then the marked commercials don't show up and you can't skip using custom4 or 5.
That's no bug, that's a feature. It only reads the commercial skip file when the show is first loaded, so to get it to load the .txt file again, you would have to switch to another show and back again.
Quote:
Originally posted by Jere_Jones
Question: When custom4 says jump to the next non-commercial, is it jumping to a frame number or a time derived from the frame number?
It jumps to a time derived from the frame number and SageTV's times don't seem to be 100% accurate, so my commercial skipping looks less accurate.

Edit:
Removed the attachment, because it is no longer needed.

Last edited by malore; 08-04-2004 at 10:28 PM.
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:03 PM.


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