SageTV Community  

Go Back   SageTV Community > General Discussion > General Discussion
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

General Discussion General discussion about SageTV and related companies, products, and technologies.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-23-2006, 08:57 AM
CB_2005 CB_2005 is offline
Sage User
 
Join Date: Jun 2005
Posts: 39
Convert Sage to Xvid AVI's

Are there any automated methods to take SageTV's mpg's and convert them to AVI's? I've been copying some 500meg Xvid AVI's on to my sage box and they look just as good as the 3gig MPEGs.


I've love to find some type of automated method to convert these files to XVID and still keep Sage 'happy'. I'm aware this can be a time consuming process so I'm sure it will have to be scheduled for when the file is not in use (much like how when I need to scan the file for commercials)
Reply With Quote
  #2  
Old 09-23-2006, 09:20 AM
dvd_maniac's Avatar
dvd_maniac dvd_maniac is offline
Sage Icon
 
Join Date: Mar 2004
Location: New England
Posts: 1,899
AutoGK is the fastest way to accomplish this. Not completely automated but it only takes a few minutes a day to do about 5 recording. Staxrip is another easy program to use. Use AutoGK if you have a dual-core CPU, Use Staxrip if you have a single-core or hyperthreaded.
Both can be found on the www.Doom9.org website.
If you want to cut out the commercials of Xvid files later VirtualDubMod is pretty easy to use for it.
__________________
If this doesn't work right, Then:
"I'm going to blow up the Earth!"
Reply With Quote
  #3  
Old 09-23-2006, 11:37 AM
Sam Sam is offline
Sage Advanced User
 
Join Date: Aug 2006
Posts: 110
Quote:
Originally Posted by dvd_maniac
Use AutoGK if you have a dual-core CPU, Use Staxrip if you have a single-core or hyperthreaded.
Wouldn't it be easier to just setup DirMon2 to watch for recordings then use ffmpeg (or Sage equivalent) to automate the conversion to DivX/Xvid?

What is the advantage to using AutoGK or Staxrip?
Reply With Quote
  #4  
Old 09-23-2006, 01:06 PM
CB_2005 CB_2005 is offline
Sage User
 
Join Date: Jun 2005
Posts: 39
Quote:
Originally Posted by dvd_maniac
AutoGK is the fastest way to accomplish this. Not completely automated but it only takes a few minutes a day to do about 5 recording. Staxrip is another easy program to use. Use AutoGK if you have a dual-core CPU, Use Staxrip if you have a single-core or hyperthreaded.
Both can be found on the www.Doom9.org website.
If you want to cut out the commercials of Xvid files later VirtualDubMod is pretty easy to use for it.

So, if I run AutoGK to convert the files... It there a way to tell Sage to update its database to look for an AVI instead of mpg? I'd like to keep the recordings listed in the 'Sage Recordings' menu instead of the 'imported videos' menu.
Reply With Quote
  #5  
Old 09-23-2006, 05:26 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Judging from the updated Studio API I wouldn't be surprised if 5.1 included some type of auto compression, but (shamless plug ) if it doesn't i'm in the process of updating my DVD burning plugin to do 2-pass xvid/h.264 encoding.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #6  
Old 09-23-2006, 05:51 PM
AngelofDeth AngelofDeth is offline
Sage Aficionado
 
Join Date: Jul 2005
Posts: 359
Quote:
Originally Posted by CB_2005
So, if I run AutoGK to convert the files... It there a way to tell Sage to update its database to look for an AVI instead of mpg? I'd like to keep the recordings listed in the 'Sage Recordings' menu instead of the 'imported videos' menu.
I think as long as you keep the same filename, and just change the extension, Sage will see this and keep it as a recording with all program information.
Reply With Quote
  #7  
Old 09-23-2006, 06:29 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
It will keep the show info... but your time in sage will be messed up. You need to copy over the file modified date. This can be done with a utilty called touch.exe.

I have a batchfile that you can set up in Dirmon2 or just right click on your file to be encode to XVID and do an open with and browse for MPg2avi.bat. You will need touch.exe and SagetTVtransoder.exe that comes with sage. I have touch.exe if anybody needs it.



MPG2avi.bat

IF EXIST c:\encodesageerr.txt goto :end

set encodesettings=-f avi -s 320x240 -vcodec xvid -b 650 -r 29.97 -g 300 -ab 128 -acodec mp3 -vol 256 -async 1

set passes=2

set extension=avi

set sagepath=c:\Program Files\SageTV\SageTV\

set priority=belownormal

set delOriginal=no

rem "set delOriginal above to yes or no.... yes will delete original mpg and replace with encoded file."
rem "if set to no will encode file to tmpEncode directory but will not delete original...."
rem "also if set to no will create a file with .sav so that dirmon will not re-encode it"


rem ........Do Not Touch Below................................................
if Not exist %~f1 exit
Title Encoding %~f1
if NOT exist %~f1 goto :filemissing
if NOT exist "%sagepath%SageTVTranscoder.exe" goto :transmissing
if Not exist "%sagepath%touch.exe" goto :errtouch
md %~d1\tmpEncode
del "%~d1\tmpEncode\%~n1.%extension%"
dir %~f1>>"%~d1%~p1%~n1%.encoding"
if /I %passes% EQU 1 start /d"%sagepath%" /b /w SageTVTranscoder.exe -i %~f1 %encodesettings% -priority %priority% "%~d1\tmpEncode\%~n1.%extension%"
if /I %passes% NEQ 1 start /d"%sagepath%" /b /w SageTVTranscoder.exe -i %~f1 %encodesettings% -pass 1 -passlogfile %~d1\passestoencode%passes%.txt -priority %priority% "%~d1\tmpEncode\%~n1.%extension%"
if /I %passes% NEQ 1 start /d"%sagepath%" /b /w SageTVTranscoder.exe -i %~f1 %encodesettings% -pass 2 -passlogfile %~d1\passestoencode%passes%.txt -priority %priority% "%~d1\tmpEncode\%~n1.%extension%"
if errorlevel = 1 goto :errtrans
"%sagepath%touch.exe" -r %~f1 "%~d1\tmpEncode\%~n1.%extension%"
if errorlevel = 1 goto :errtouch
if /I "%delOriginal%" EQU "yes" if exist "%~d1\tmpEncode\%~n1.%extension%" del "%~f1"
if /I "%delOriginal%" NEQ "yes" dir %~f1>>"%~d1%~p1%~n1%.sav"
if /I "%delOriginal%" EQU "yes" move "%~d1\tmpEncode\%~n1.%extension%" "%~d1%~p1"
del %~d1\passestoencode%passes%.txt-0.log
:end
exit
:errtrans
echo "Error SagetvTranscoder Syntax error see below " >>c:\encodesageerr.txt
echo %encodesettings% >>c:\encodesageerr.txt
del %~d1\passestoencode2.txt-0.log
exit
:errtouch
echo "Error Touch.exe not found in %sagepath%" >>c:\encodesageerr.txt
exit
:filemissing
echo "Error Input file %~f1 not found check input and try again." >>c:\encodesageerr.txt
del %~d1\passestoencode2.txt-0.log
exit
:transmissing
echo "Error SagetvTranscoder.exe not found in %sagepath%" >>c:\encodesageerr.txt
del %~d1\passestoencode2.txt-0.log
exit
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 09-23-2006 at 06:33 PM.
Reply With Quote
  #8  
Old 09-23-2006, 11:15 PM
Sam Sam is offline
Sage Advanced User
 
Join Date: Aug 2006
Posts: 110
Quote:
Originally Posted by nyplayer
set encodesettings=-f avi -s 320x240 -vcodec xvid -b 650 -r 29.97 -g 300 -ab 128 -acodec mp3 -vol 256 -async 1
Wouldn't reducing to 320x240 really reduce the quality of the playback, especially when played on something over 20"?

Or is this one of those compromises where reducing the size to 320x240 means the 650k bitrate has enough more information per frame that by the time you expand it to full screen you still have a better picture than leaving the size to match the original?

What size and bitrates are others using for SD shows in xvid format?
Reply With Quote
  #9  
Old 09-24-2006, 12:36 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Sam: yes and yes.

Random rule of thumb for Xvids = 0.25 bits per pixel... Obviously for talking-head-type news shows, this can be lower, and for high action sports/movies this should be higher... (as with all rules of thumb, this can devolve into a religious war as to whether it should be 0.2 or 0.3!)

320x240x.25x30=576Kbps=260Mbytes/hr
640x480x.25.30=2300kbps=1035Mbytes/hr

AutoGK (when you specify exact file size) automatically resizes the video so that there are enough bits per pixel to minimise the compression artifacts..


(as an aside, it just shows how bloody amazing video compression is: 0.25 bpp down from 24 bpp == a compression ratio of 99% from raw 8bit RGB video!)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 09-24-2006 at 12:41 AM.
Reply With Quote
  #10  
Old 09-24-2006, 11:01 PM
dvd_maniac's Avatar
dvd_maniac dvd_maniac is offline
Sage Icon
 
Join Date: Mar 2004
Location: New England
Posts: 1,899
Quote:
320x240x.25x30=576Kbps=260Mbytes/hr
640x480x.25.30=2300kbps=1035Mbytes/hr
What are others getting for compression and recommendations for improvement?
I record with Max Mpeg-2. I use Staxrip 1-pass X264 HighProfile Constant Quality with Quant 22, 5 B-frames, 6 ref frames and 40kbps audio. I average around 190MB for a 44minute show and it takes about 40 minutes to encode on my AMD X2 4600. I have Dirmon2 and VideoReDo create an Ad-Scanned project file automatically after a show is finished recording. Once every couple of days I check the break points and edit out commercials and use Staxrip's Batch feature. If I have about ten shows then it takes me about 20 minutes(actual User Time) to cut comms and import into Stax batch process.

I watch them on a 47" DLP, 36"SDTV and a 57" HDTV and do not notice any difference from the mpeg-2 files.

What are others here doing for compression setup?
__________________
If this doesn't work right, Then:
"I'm going to blow up the Earth!"
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 06:13 AM.


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