|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
How To: In-place recompression of Sage Recordings
I have had sucess with in-place recompression of Sage recordings: compressing the MPG to AVI, but keeping the file in the Sage Recordings list together with all the show information etc, so I though I would share my method with you.
Warning: You do this at your own risk! This is hacking sage to do something which it may not be intended to do. Any loss of data is not my fault! This uses the 'media file recovery' feature of Sage. This is a feature when the Sage server/service starts up, if it finds any unknown files in the Sage video directory, it tries to match the numeric suffix (-xxxxxxx-0.) to an internal Airing ID in the EPG. If it finds one, then it links the mediafile to the airing and uses the file duration and file timestamp to set the start/end time of the recording. With this feature, you can rename the first part of the filename, or the extension of any Sage recording file while the sage server/service is shut down, and it will still be linked to the airing info in the EPG when Sage restarts. You can also use this feature to replace recordings with ones that have been edited to remove padding and commercials. This is my full sequence of actions. If you don't understand what is going on here, don't try it, unless you are willing to lose the information for the recordings you are working on!
Its a hack (in the traditional sense of the word) I know. I have a plan (!) that at some point I will create a STV+java plugin that will use a 'compression queue' playlist and a command line encoder (ffmpeg or mencoder, os seamonkey's batch file!) to re-compress files, then automatically re-associate them with the airing info once compression is complete, without a need to shut sage down... The only problem is extra features would need to be added to the Sage API to allow me to do this. Good luck! Niel
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki Last edited by nielm; 05-02-2005 at 04:17 AM. |
#2
|
|||
|
|||
Quote:
|
#3
|
|||
|
|||
I agree completely! I've been waiting for this feature for some time now. I'm actually surprised that it isn't built into programs like sage - background, automatic, in-place compression during system idle time. It would be an effective hard drive doubler. (this is coming from someone w/ > 1/3 of a TB but needs MORE)
I also agree about the API part - I'd love to help implement this. |
#4
|
||||
|
||||
Two questions:
-How long does AutoGK take on your system. I found it takes a reallyt long time for me but I think it's supposed to get better the more tiems it does it right? -What kind of quality loss do you get in the picture? any? Are you starting with Mpeg2 Max Quality? |
#5
|
||||
|
||||
Quote:
You don't have to use autoGK, you could use ffmpeg that is included with Cayars' STV, or mencoder but that does not crop the black bars from letterboxed (unless you play with the command line arguments)... (mencoder can do 31fps on my other box - a P4HT 2800Ghz) I don't see any quality loss (starting from DVD standard play PAL), but then I am using TV-out... I am not sure, but I think I see an improvement in quality (with MPEG2 I am using BOB deinterlace at the moment, which results in half the resolution, AutoGK generates progressive output, which would use the full resolution). Anyway it is not noticable enough to comment... Note: I don't have a HUGE screen TV, and I am using my vidcard's S-Video out at 768x576 resolution, so differences in quality tend to be masked I am also not super obsessive about perfect quality
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki Last edited by nielm; 03-16-2005 at 01:48 PM. |
#6
|
||||
|
||||
Quote:
I record in Sage using Best, which is 6mbit/s VBR. Would I get better encoded results using CBR 8mbit/s? |
#7
|
||||
|
||||
wow..this is the sole reason that i chose not to compress recordings! I hated the fact that you lost all the important data when you compressed and moved stuff to the library. I cannot wait to try this out! thanks!
Quote:
__________________
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. |
#8
|
||||
|
||||
All we need now it someone to make this process automated... Perhaps this little program posted on Snapstream forum could assist in some way: http://forums.snapstream.com/vb/showthread.php?t=20628
It monitors a folder and auto compresses using autogk. |
#9
|
||||
|
||||
Quote:
By the way, my 15fps average is the overall time for the whole compression: ie test, first pass and second pass. (total time ~ 1.75 hrs compression time for each hour of video). The individual compression jobs go at about 15fps for the test, 45fps for the first pass and 25 fps for the second. In general, when you intend to transcode, you should always capture at a best bitrate pratical to get the highest quality source, and avoid getting MPEG2 artifacts in the compressed MPEG4 output (think a photocopy of a photocopy: each stage adds noise). But I never know what I am going to recompress and I am too lazy to change the bitrate for each recording
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#10
|
|||
|
|||
nice..!
hmm..... i wonder if my divx encoding batchfile works like this?? when it re-encodes the mpg to a divx avi, it keeps all of the filename fully in tack, (ie SimpsonsMaggiePukes92993-1.avi ) and even puts the files into a new directory with the current date it was encoded (ie encoded\03152005\XXXXXX-0.avi ) actually, yes i think it would.. i have not imported my folder that i save my encoded shows to into sagetv.. i will try it once i get my new cpu and vid card tonight!! its somewhat semi automated since its a batch file (.bat) and it can be setup to run at certain time using good ole windows scheduler.. (ie 4am..) a quick link to the files and info (uses virtualdub for encoding) http://forums.freytechnologies.com/f...ad.php?t=10612 peace seamonkey420 |
#11
|
||||
|
||||
For semi-automated setting of the timestamp, GNU FileUtils' touch has a flag where a timestamp can be set on a file using the timstamp of another file. So you can use the timestamp of the original MPG to set the timestamp of the new AVI:
touch -r file.mpg file.avi
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#12
|
|||
|
|||
I also found that 4NT's touch command works well for this. Of course, what we really need is one big batch file that runs AutoGK, touches the dates, shuts down Sage when it is idle, moves files around, and restarts Sage once daily. If version 3.0 doesn't have some sort of built-in solution that is.
|
#13
|
|||
|
|||
Just a thought Nielm, since you have knowledge of how this works, and the ability to edit the database (i.e. webserver's features), could you somehow create a plug-in to automate this? Perhaps as simple as taking an existing database entry, letting us pick a new filename to associate with it, and then deleting the old file that was associated with it?
|
#14
|
||||
|
||||
It is possible and is one of the things I am thinking about...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#15
|
||||
|
||||
One question I have: I tried this but I didn't recompress, I just cut padding and advertising away. This gives me a much shorter film length. The film shows up nicely in Sage, but the time bar doesn't work right at all. Any way to fix this? Thanks!
Thomas |
#16
|
||||
|
||||
Quick and easy way -- use my webserver to edit show info, check that filestart time is 0 seconds earlier (or later!), then just hit OK -- it re-scans the file and re-determines the length...
(this probably happened because the timestamp on the file did not corespond to airing start time + file duration...)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#17
|
||||
|
||||
Quote:
Quote:
Thanks! Thomas |
#18
|
||||
|
||||
It should be OK, but if there were lots of adverts before you did your cut then you would get a red beginning on the timebar...
Airing: 2hrs from 12pm-2pm Recorded file: 2hrs, timestamp 2pm (so 12pm-2pm) Edited file: 1.5hrs, timestamp 2pm (so 12:30pm-2pm) This would show up as a timebar with the first quarter showing red/not recorded. (you did not mention how the timebar did not work, I was just making a guess!)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#19
|
||||
|
||||
Actually, it's more like: Playback starts at the beginning of the green time bar (which is showing 2 hours length), but the actual playback is starting about 10 or 15 minutes into the show. Then, I hit the 2.5-minutes-back button repeatedly, find the show start somewhere at minus 10 minutes on the time bar and start from there. The advance of time is then faster than real time (when a minute passes there, a minute hasn't passed in real life), so that at the end of the displayed 2 hours, the 1.5-hour-show will be over. This is all on an MVP, and I think the MVP plug-in influences time-bar display
|
#20
|
||||
|
||||
This sounds like Sage has not re-scanned the file to determine it's length -- so it thinks the file is 2hrs long, then on playback sees that it is 1.5hrs, and re-scales the timebar accordingly...
This probably happened because the cut file has exactly the same name+ext as the original, so sage does not bother rescanning it to re-dertermine its length...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|