NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 28 29 30 31 32 … 93 Next »
Rename Recording

 
  • 0 Vote(s) - 0 Average
Rename Recording
ZaDDaZ
Offline

Member

Posts: 96
Threads: 6
Joined: Mar 2005
#131
2005-07-24, 05:44 AM
I'm very sorry for the delay, but I have to keep my business afloat and develop free software after that. Here is my first release of RecordingsManager. It combines all the functionality of these three utilities:
  • RenameRecordings
  • MaxRecordings
  • ComSkipHelper

Along with combining the functionality of all of those, it adds in the following extras:
  • Ability to turn enable/disable any of the functions
  • Ability to change configuration file on the fly and have new settings take effect immediately
  • Comskip of in-progress recordings
  • Excluding programs from comskip based on channel or program name
  • Monitoring of folders for comskip detection
  • Options to turn off and/or control comskip process monitoring
  • Custom formatting of renamed files (this allows the use of any property on the ScheduledRecording, Programme or Channel for a recording)
  • Enhanced logging - uses standard GBPVR logging functions

I'm including the archive here with the executable, debug file and sample config file. To use, put the files in your GBPVR folder and add a call to RenameRecordings in your PostProcessing.bat file and/or RecordingStatus.bat.

I've been testing this for a while now and I can't find any functions that are causing problems. The coolest thing to do is to change the format for renaming files and all your files are renamed almost instantly. For the rename format, here are the rules:

There are 3 main elements: ScheduledRecording, Programme (or Program for us in the US) and Channel. When one of these elements is found, it should have an attribute called "Property" which is the property to retrieve on the element. It MUST be the correct case as I'm using reflection to find the method name. Since this can be a somewhat inconvenient way of retrieving values, I added some shortcut elements:

Title, TitleName, ProgramName - Program title
SubTitle, Episode, EpisodeName - Program episode name
ChannelName - (obvious)
ChannelNumber - (obvious)
StartTime - Start date/time of program
EndTime - End date/time of program

Further, if an element that doesn't match any of these exists, it will search the 3 main elements for a property with the element name.

All elements can optionally contain a Format attribute which should be a .NET format string. The one and only parameter to the format string is the value of the element, so "*{0}*" would cause the value to be surrounded by asterisks. If an attribute called SkipIfNotFound is set to true and the attribute results in no value, it will be skipped entirely. This is really only useful along with a format string.

I plan on creating a plugin for the config UI to allow configuration of all of these options.

I really like the option of putting this in the RecordingStatus.bat file, but I noticed that this is called by the system tray utility. So, if the tray utility isn't running because no one is logged into the machine, it doesn't get called. Also, when it does, it shows up on the desktop, which I find inconvenient. It would be nice if the GBPVR service called RecordingStatus.bat instead of the system tray utility.

The StayAliveMinutes indicates how long the application should keep running after it has ran out of things to do. This is useful to cause the application to poll for an extended period. This utility only allows one instance of itself to run. If another instance is started, it will detect the first instance, tell it to check and exit. The RefreshIntervalSeconds is the time to wait after renames have taken place before trying to continue. This is needed because of a latency issue with the database file. 10 seconds seems to work for me on this setting, but if you get files renamed and then get files not found soon after in your log, you may need to increase this time.

OK, I've written entirely too much here. I hope that everyone likes this. I'm going to work on the WiKi page for this and put all this info there as well. If anyone does run across issues, please let me know. Include info from the RecordingsManager.exe.log file as this should contain everything, including accurate stack traces in case of any exceptions.

ZaDDaZ
ZaDDaZ
Offline

Member

Posts: 96
Threads: 6
Joined: Mar 2005
#132
2005-07-24, 08:47 PM
It should support any version of comskip that runs via launching comskip.exe with the filename that needs to be comskipped as the one and only parameter. Please let me know how everything works out, I'm working on the plugin for configuration as having to author an XML file is a simple task for me, I'm sure its not the easiest thing for everyone.

Also, I would like to make this support comclean. I've seen some posts for this, but I don't see where I can download it anywhere. I need to know how it works as far as what files it creates and such. Any direction on this would be appreciated.

Just a note that I forgot. In order for the in-progress thing to work, you should put the tool in the RecordingStatus.bat file. That will cause it to start when something starts getting recorded. Another option is to make the StayAliveMinutes over one day and put it in the PostUpdateEPG which will cause the utility to always stay running. The main thing here is that the utility needs to be running when recording starts, not just when its completed.
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#133
2005-07-24, 09:15 PM
There's a thread somewhere on comclean.
Basically, it's a command line editor (mpgtx), that cuts on I frames, and then re-encodes the finished mpg.
It relies on the comskip generated .txt file (the default) for it's cut points.
The bold portion is where renamerecordings get's the filename.
One can either delete the old original recording, replacing it with the cut, renamed one, or keep the old, renamed to filename_original.mpg., and have the renamed new cut one as well.
Here's comclean.bat:
Code:
@echo off
Rem comclean.bat Version 0.0.1
Rem Adapt to your framerate times 100 (PAL=2500/NTSC=2997)
set framerate=2997
Rem Adapt to where mpgtx.exe can be found
set mpgtx="c:\Program Files\devnz\gbpvr\mpgtx.exe"

rem Initialize the variables
set start=0
set duration=0

rem Set the command line start
set cmdline=%mpgtx% -j -f -o "%~dpn1_clean.mpg" "%~dpn1.mpg"
set cutpoints=

rem Process all the lines from the Comskip output file
for /F "usebackq tokens=1,2,3*" %%i in ("%~dpn1.txt") do call :processline %%i %%j
rem Output last clip
call :totime %start%
set cmdline=%cmdline%  [%tim%-]
echo Resulting cutpoints: %cutpoints%
rem echo %cmdline% >"%~dpn1.bat"
rem echo exit >>"%~dpn1.bat"
rem start /wait /low call "%~dpn1.bat"
@echo on
%cmdline%
@echo off
[b]echo Resulting cutpoints: %cutpoints%
Rem RENAME the old .mpg file and rename the new one to the old name
REM delete /Q "%~dpn1.mpg"
move "%~dpn1.mpg" "%~dpn1_original.mpg"
move "%~dpn1_clean.mpg" "%~dpn1.mpg"
goto :eof[/b]

:processline
rem Skip useless lines
if "%1"=="FILE" goto :eof
if "%1"=="-------------------" goto :eof
rem Output the clip information for the show part
set /a length=%1-%start%
set /a duration=%duration%+%length%
call :totime %length%
set cutpoints=%cutpoints% %tim%

if "%1"=="0" goto :nostartshow
call :totime %start%
set cmdline=%cmdline% [%tim%
call :totime %1
set cmdline=%cmdline%-%tim%]
:nostartshow
rem Remember start of next clip
set start=%2
goto :eof

:totime
set tim=
if "%1"=="0" goto :eof
set /A position=%1 *100 / %framerate%
set /A hours=%position% / 60 /60
set /A hrest = %position% - %hours%*60*60
set /A minutes=%hrest% /60
set /A seconds = %hrest%  - %minutes%*60
set tim=%hours%:%minutes%:%seconds%
goto eof
:eof
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
ZaDDaZ
Offline

Member

Posts: 96
Threads: 6
Joined: Mar 2005
#134
2005-07-25, 02:24 AM
This sounds pretty cool. I found the mpgtx tool, but am hesitant to us it during regular recordings myself. I will give it a try and am excited about using it to burn stuff to DVD.

If you look at the configuration file, it has a RunComClean option that does nothing. It looks like I need two other settings to go with this to get this all working.

First, the command line to run. Simple enough, with a <FileName> element that will be replaced by the file name.

Second, a way to determine if comclean has already been run on a file. This is required because I need to be able to, at any point, look at a file and determine if comclean needs to be run or not. I currently look for the .txt file to determine if comskip has already been run. I think an option for a comclean extension would work well. After I detect that comclean has completed for a file, I'll create an empty file with the extension specified.

I do have one question, would it be better to implement the logic inside of the batch file you have in the application and simply expect mpgtx.exe to be in the GBPVR folder or allow the specification of the location of the program? Just a thought...
rockstar
Offline

Junior Member

Posts: 22
Threads: 2
Joined: Dec 2004
#135
2005-07-25, 05:15 PM
I'll give recordingsmanager a try. I tried the renamerecordings.exe from page 12, but my recordings are still being erased. I'm left with only the last recording in any given subdirectory. I hope to have better luck with recordingsmanager.
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#136
2005-07-25, 05:50 PM
@ rockstar. Some other plugin you have is deleting (or moving) your recordings.
RenameRecordings simply renames the file, last step in postprocessing.bat

@ ZaDDaZ. I use comclean on everything. I have conservative settings in comskip ver 0.64 for everyday use, but I'm working on perfecting 0.69, and 0.71 as well.
What configuration file are you referring to, that has a "RunComClean" option...?

The commandline to run comclean is just "comclean <filename.ext>"
You may have to specify comclean's folder, such as "c:\program files\devnz\gbpvr\comclean"

By default, the files are in the gbpvr folder, and I think should stay there, so you could probably expect them to be there, and not worry about having to specify a different location. This is providing your addon will be run from postprocessing.bat, or be run once the recording, and comskip, have finished somehow.
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
ZaDDaZ
Offline

Member

Posts: 96
Threads: 6
Joined: Mar 2005
#137
2005-07-26, 01:23 PM
I will test comclean out, and for now, I'm just going to allow you to specify the command line in the config file. There is an option called RunComClean in the current config file, but it doesn't do anything.

Rockstar, there were some versions of RenameRecordings that would make it look like recordings were deleted. It was because GBPVR is constantly checking to see if any recordings in the database have been manually deleted and if it detects that, it deletes the database record. The latest version of RenameRecordings (bless me if I know where it is) and RecordingsManager do not suffer from this problem as they just insert a new row in the database instead of trying to modify the existing record. If you use Video Archiver plugin, you won't even notice this because it shows all the files in the folders anyways.
lambda379
Offline

Junior Member

Posts: 2
Threads: 0
Joined: Jan 2004
#138
2005-08-04, 11:46 AM
ZaDDaZ - I know you have implemented an .xml file to configure RecordingManager. Which works great, but I don't use ComSkip or MaxRecordings. But, I do use RenameRecordings. Way back in post #121, (http://forums.gbpvr.com/showpost.php?p=3...tcount=121) you discussed implementing an option to configure RenameRecordings much the same way. Is it possible to configure RenameRecordings to customize the name format? That way I could run RenameRecordings in PostProcessing.bat after scanning for commercials with VideoReDo.

Thanks for the great work!
turkey
Offline

Member

Posts: 206
Threads: 17
Joined: Sep 2005
#139
2005-09-13, 05:48 PM
The recordings manager is great, and it is working perfectly, but I am having problems setting up the file names correctly. What I really want it to do is name the files in this format:

Show Title - s**e** - Episode Name

It is doing the title and episode correctly, but can it also add in the season number and episode number? If it could, this application would be absolutely perfect.

Thanks to all who know more than me and coded these plugins!
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#140
2005-09-13, 05:58 PM
Any plugin to do this, would have to rely on the information from the TV guide (zap2it or xml). If the guide doesn't contain this info, then it can't be done.
The only way around it, would be to poll the database at tv.com (for example) and somehow get the season and episode info imported, and output it with renamerecordings. A daunting task to say the least, probably impossible.
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (31): « Previous 1 … 12 13 14 15 16 … 31 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 713 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 475 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 1,137 2023-11-09, 02:14 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,523 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 3,078 2019-09-19, 01:08 PM
Last Post: jcole998
  Get recording length from stream skogl 46 14,542 2019-08-15, 09:34 PM
Last Post: sub
  Unexpected result when deleting a pending recording scJohn 5 3,883 2018-05-06, 10:09 PM
Last Post: sub
  How to best verify success when adding a recurring recording drmargarit 1 2,884 2017-03-02, 03:13 PM
Last Post: mvallevand
  Change recording filename programmatically immediately before recording starts? craigrs84 5 6,227 2015-07-13, 09:28 PM
Last Post: patco444
  Recording a specific episode based on season and episode number cbgifford 26 10,798 2014-12-19, 10:28 PM
Last Post: cbgifford

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode