![]() |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Rate Thread | Display Modes |
|
|||
|
Automatically cut commercials! Cutads script posted here.
Hello, fellow SnapStream users.
EDIT: This has been superceded by Version 2, posted in this thread: http://discuss2.snapstream.com/vb/sh...threadid=12421 SnapStream Beyond TV 3.4 (formerly PVS) introduced SmartChapters, which detects the location of commercials. A natural extension of this would be to automatically cut the commercials from the recording, to save disk space make it even more convenient to watch recorded shows. Introducing cutads.pl If you store your videos in Windows Media (WMV) format, here is a solution for you. I have written a Perl script, cutads.pl, which parses the .chapters.xml file in which Beyond TV stores the chapter markers, then constructs the command line arguments necessary to make the freeware asfcut tool remove the commercials from the video! Windows Media Only The asfcut tool only supports WMV format, so this method does not currently work if you use MPEG-2 or DiVX for your Beyond TV shows. However, if you know of any command line tools similar to asfcut that works on those formats, the Perl script could be modified easily enough. Requirements Because this is a Perl script, you need a Perl 5.8 interpreter. It needs to be at least version 5.8 because the .chapters.xml files are UTF-16 encoded, and earlier versions of Perl did not handle unicode. I recommend the free Perl available from http://www.activestate.com (click Languages, ActivePerl, download). It should also work with the cygwin perl if your video file is in the current directory when you run it (to avoid Unix path character conflict). You also need to install the asfcut.exe command-line tool, available from http://www.radioactivepages.com/inde...tails.html</a> Usage You can also see the usage by running the script with no parameters: perl cutads.pl . Examples: perl cutads.pl -i MyMovie.wmv Create a copy called MyMovie.wmv.tmp with the "chapters" removed. perl cutads.pl -i MyMovie.wmv -o MyMovieCut.wmv Same as above, but make the output filename be MyMovieCut.wmv. perl cutads.pl -i MyMovie.wmv -start 130.5 -end 1734.0 The output file will cut 130.5 seconds from the beginning of the file and will end 1734 seconds (just under half an hour) into the file, plus trim the "chapters". This allows you to trim to show start & end. Unfortunately, you must enter these parameters yourself, because the real start and end of the show is not detected by Beyond TV. License A script this simple hardly needs a license . It is freeware, public domain. Do absolutely anything you want with it. Note that asfcut and Perl have their own license agreements.Enjoy! Please post comments and improvements. Last edited by Soundman; 01-27-2004 at 12:24 AM. |
|
|||
|
this is great! would you mind posting a few more details? i've followed your instructions and maybe i need a reboot to get everything working but can you verify what i've done?
1 - i followed you instructions and dl'd activeperl and ran through the install. 2 - i dl'd the cutads.pl file. i placed in in the directory where my tv shows are stored and where the chapters XML file is located. 3 - i opened a DOS prompt in the dir where my tv shows are stored. 4 - ran the command: D:\TV>perl cutads.pl -i Teen Titans-(How Long Is Forever)-2004-01-11-0.wmv 'perl' is not recognized as an internal or external command, operable program or batch file. i'm thinking perl isn't recognized b/c i didn't reboot after the install or maybe i have to define the perl path. i'm going to reboot and see if that resolves the issue. |
|
|||
|
suprfli,
Quote:
Example: Code:
C:\Program Files\Perl\bin\perl.exe cutads-pl -i "Teen Titans-(How Long Is Forever)-2004-01-11-0.wmv" Quote:
To find out what you have, type: Code:
C:\Program Files\Perl\bin\perl.exe -version Code:
This is perl, v5.8.2 built for MSWin32-x86-multi-thread I hope this helps! Soundman Last edited by Soundman; 01-13-2004 at 09:08 PM. |
|
|||
|
Quote:
|
|
|||
|
Hi, All.
I have an update on my progress with the Cutads.pl script. I noticed that the trimmed file created by asfcut.exe loses the episode description and other meta data in Beyond TV's database. This is a major limitation, in my view. So, I added code to copy the meta data by using Beyond TV's web server to GET the "Edit Show" page for the original recording, then POST that same data for the new, trimmed file. I have all the guts of it working, but I need to clean it up and overcome one issue of timing. That is, you can't POST the meta data until Beyond TV has noticed the new file and added it to its database. This can take an unpredictable amount of time. I plan to work this out and post a new version soon. Still no word on an MPEG-2 or AVI tool, though. Regards to all, Soundman |
|
|||
|
was it mpgtx? http://sourceforge.net/project/showf...group_id=22678
|
|
|||
|
Quote:
|
|
|||
|
Quote:
mencoder has a ton of options, but splitting is pretty straight forward. Searching on google should give you the options you need. You might also want to check out ffmpeg and transcode (if you have a linux box availible). |
|
|||
|
does it do it via command line though, that's the question. There are plenty of user-controlled editors that will do the trick. The goal here is to find what that can simply be fed command line options to get the editing that you want done, done.
|
|
|||
|
yes, both of the apps i mentioned are command line based.
A couple of people have compiled mplayer for windows, and offer installers. Searching on google for "mplayer win32" should give you some hits. Here's a link to one of the installers i found: http://www.christianroessler.com/mplayer.php mencoder has a lot of options, but here are the flags you'll probably want to use to split the mpeg: mencoder -ovc copy -oac copy -endpos hh:mm:ss or mencoder -ovc copy -oac copy -ss hh:mm:ss -endpos hh:mm:ss -ss is the time you want to start the clip at -endpos is how long you want the clip to be |
|
|||
|
Good suggestion. I have used memcoder before under Linux (I run mythTV). Works well, pretty fast. If it does the trick under Windows this would be a good solution.
Now is there a way to run memcoder via BTV, via the delayed re-encoding feature (SmartChapters/SmartSqueeze)? Yes, we always want more. I am very happy with BTV. I like mythTV too, but it takes more care and feeding, which is fine. The main problem with mythTV is the stored file format. The program produces a file format called Nuppelvideo (.nuv). Mplayer understands the format, and memcoder is able to transcode the format to other formats. Which is why I used memcoder. |
|
|||
|
The mplayer package given above
(http://www.christianroessler.com/mplayer.php) does not contain memcoder. The following package does include memcoder, http://mplayer.sunset-utopia.homeip.net/ I will check it out tonight, and report back. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automatically removing commercials from Mpeg files | look30 | Beyond TV and Beyond TV Link | 4 | 02-28-2005 04:46 PM |
| Automatically cutting commercials in mpeg2? | salama | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 7 | 02-23-2005 08:13 AM |
| Remove commercials automatically | Hipster421 | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 11 | 01-11-2005 12:43 PM |
| Any way to automatically delete commercials? | loudog3114 | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 1 | 10-18-2004 12:42 PM |
| automatically cutting out commercials | msgon2002 | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 5 | 09-21-2004 06:56 PM |