|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Delete existing part of show
Scenario: I have watched a live show for a certain time, and at some point I want to delete the corresponding media file (which contains all contents from where I started watching up to now) so that when I start a manual recording on that show the recording will not include the prior part.
I tried the following code, but it doesn't work: Code:
+- currfile = GetCurrentMediaFile() +- CloseAndWaitUntilClosed() +- DeleteFile(currfile) +- Watch(Airing) +- Record(Airing) Any ideas ? Dirk |
#2
|
||||
|
||||
I'm just guessing... maybe it doesn't like to delete things that are currently airing, not just currently recording. Have you tried DeleteFileWithoutPrejudice()?
- 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. |
#3
|
|||
|
|||
Quote:
Dirk |
#4
|
||||
|
||||
Also just guessing: maybe it is still recorded for a few seconds after playback is stopped...
Perhaps a small loop with IsFileCurrentlyRecording(currfile) (and a timeout) before the delete?
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#5
|
|||
|
|||
Quote:
Thanks, Dirk |
#6
|
|||
|
|||
Quote:
BobP. |
#7
|
||||
|
||||
Is this being attempted while still on the playback screen w/the video widget still active?
I can delete a partial recording for a live tv show I just watched, but I tried doing it while on another screen. - 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. |
#8
|
|||
|
|||
Quote:
Dirk |
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
I should have said this before, then, when I thought of it... if you are using a video widget instead of a video background for the menu widget (or switch to using a video widget), put a conditional on its display. When you close the file, turn off the conditional for the widget, refresh, wait a bit, then restart playback & reshow the video widget. You will definitely be inserting a delay from when the user chooses to do this, in case that is an issue for you.
I can't remember whether the v5.0 default STV does this kind of thing on the OSD playback screen, but you could see if it does for an example. Of course, it is still possible that this won't help you at all & nielm's guess works better. You may want to try jumping to another menu first to see if the delete will work then, before adding a conditional to the video widget display. - 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. |
#11
|
|||
|
|||
Quote:
Code:
Drop Prior Video - item widget in popup menu when Record is pressed - DefaultSTV +CloseOptionsMenu() +CloseAndWaitUntilClosed() +MF=GetMediaFileForAiring(Airing) +AddStaticContext("MF", MF) +AddStaticContext("Airing", Airing) +MediaPlayerDummy - link to another menu MediaPlayerDummy +BeforeMenuLoad +DeleteFileWithoutPrejudice(MF) +Wait(5000) +Watch(Airing) +MediaPlayer OSD - link to menu BobP. |
#12
|
||||
|
||||
Quote:
It it were me, I'd probably code it so that the Start Clip and Stop Clip commands (however you invoke them) would simply make a note of the time marks in the currently recording media file. The user could specify as many clips as they like in a given program without interrupting playback. This would work on pre-recorded programs as well as Live TV. The code could also be clever about backing up the start-clip time mark a few seconds to allow for slow reflexes. Then, after the program is over and the file is closed, run a VideoRedo script or something like that to pull out the clips into separate files. That way you can have your cake and eat it, by keeping a full, intact recording of the entire program (if that's what you want) in addition to the specified clips. Seems like a better implementation design than taking the "start record" and "stop record" commands too literally. Just my $0.02.
__________________
-- Greg |
#13
|
||||
|
||||
Quote:
- 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. |
#14
|
|||
|
|||
Quote:
BobP. |
#15
|
|||
|
|||
Quote:
Of course, if someone finds a better way, please share ... Dirk |
#16
|
||||
|
||||
Quote:
To prevent the user frmo using Forward & getting stuck on the temp menu, if you use that, just have it leave that menu automatically if the BeforeMenuLoad hook says it is being reloaded. - 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. |
#17
|
|||
|
|||
Quote:
Thanks for the input ! Dirk |
#18
|
||||
|
||||
If anybody cares, here's some sample code for calling VideoRedo from Java:
Code:
public void ExtractClip(Object mf, long start, long stop, java.io.File fileOut) throws java.lang.reflect.InvocationTargetException, java.io.IOException { java.io.File fileIn = (java.io.File)sage.SageTV.api("GetFileForSegment", new Object[]{ mf, // MediaFile 0 // Segment }); java.io.File fileScript = java.io.File.createTempFile("VRD", ".vbs"); java.io.PrintWriter script = new java.io.PrintWriter(new java.io.FileWriter(fileScript)); script.println("Dim vrd : Set vrd = CreateObject(\"VideoReDo.Application\")"); script.println("Call vrd.FileOpen(\"" + fileIn.getAbsolutePath() + "\")"); script.println("Call vrd.SetCutMode(False)"); script.println("Call vrd.SelectScene(" + Long.toString(start) + ", " + Long.toString(stop) + ")"); script.println("Call vrd.FileSaveAs(\"" + fileOut.getAbsolutePath() + "\")"); script.println("Do While (vrd.IsOutputInProgress())"); script.println(" Call WScript.Sleep(100)"); script.println("Loop"); script.println("Call vrd.Close()"); script.close(); sage.SageTV.api("ExecuteProcess", new Object[]{ "wscript.exe", // CommandString fileScript.getAbsolutePath(), // Arguments null, // WorkingDirectory false // ConsoleApp }); } A more high-tech approach would be to write a Jacob wrapper to expose the VideoRedo API directly in Java. But for this quick hack I'm using VBScript as a poor man's COM wrapper and calling it by way of Windows' built-in script host. (JScript would also work, for you Java purists, but then you'd have to escape the backslashes in the filename strings.) Obviously a freeware editing tool would be better for this purpose than VideoRedo, but VideoRedo is what I have, and I haven't done a lot of research into freeware alternatives, so I thought I'd throw this out there as a proof-of-concept.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|