SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #121  
Old 03-01-2007, 06:02 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Quote:
Originally Posted by grauchy
What if I've already run comskip earlier? What changes should be made to the batch file to NOT run comskip because I already have a comskip file.

you need to have a vcf comskip file. Normally comskip is configured to produce an edl or txt file. However for the batch file to generate a virtualdub script file it needs a vcf file. If you configure your comskip.ini to produce both vcf and edl formats, then all you need to do is set the batch file to grab the preproduced vcf file. Eg- you may already be producing edl files regularly thru dirmon so why not produce the vcf at the same time. Its a good sugestion and I'll look into incorporating it.
Reply With Quote
  #122  
Old 03-02-2007, 09:13 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
In response to Davephans problem with 16x9 files

Just as I thought- it was the audio all along. Was there anything different in the way in which you captured this mpg? DGindex produced a straight wav instead of an mpa.

So anyway here are the corrections you need to made to the batch file. Under the Set Avisynth commands near the beginning are the following 3 lines:

Code:
FOR %%G IN (%CAPDIR%\*ms.mpa) DO %DC%  -auto -out %CAPDIR%\cutaudio.mpa "%%G"
"%BS%" -core( -input "%CAPDIR%\cutaudio.mpa" -output "%CAPDIR%\%~n2.wav" -2ch -logfilea "C:\besweet\BeSweet.log"  ) -profile( ~~~~~ Default Profile ~~~~~ )
del %CAPDIR%\*.mpa
Change to:

Code:
FOR %%G IN (%CAPDIR%\*.wav) DO %DC%  -auto -out %CAPDIR%\cutaudio.wav "%%G"
"%BS%" -core( -input "%CAPDIR%\cutaudio.wav" -output "%CAPDIR%\%~n2.wav"  -2ch ) -azid( -s stereo -L -3db ) -ssrc( --rate 48000 )
Del  %CAPDIR%\cutaudio.wav
Reply With Quote
  #123  
Old 03-16-2007, 02:00 PM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Just posting to follow up with Davephan if the modification posted above worked or not
Reply With Quote
  #124  
Old 03-16-2007, 08:40 PM
davephan's Avatar
davephan davephan is offline
Sage Icon
 
Join Date: Mar 2004
Location: Minnesota
Posts: 1,911
Quote:
Originally Posted by roxy99 View Post
Just as I thought- it was the audio all along. Was there anything different in the way in which you captured this mpg? DGindex produced a straight wav instead of an mpa.

So anyway here are the corrections you need to made to the batch file. Under the Set Avisynth commands near the beginning are the following 3 lines:

Code:
FOR %%G IN (%CAPDIR%\*ms.mpa) DO %DC%  -auto -out %CAPDIR%\cutaudio.mpa "%%G"
"%BS%" -core( -input "%CAPDIR%\cutaudio.mpa" -output "%CAPDIR%\%~n2.wav" -2ch -logfilea "C:\besweet\BeSweet.log"  ) -profile( ~~~~~ Default Profile ~~~~~ )
del %CAPDIR%\*.mpa
Change to:

Code:
FOR %%G IN (%CAPDIR%\*.wav) DO %DC%  -auto -out %CAPDIR%\cutaudio.wav "%%G"
"%BS%" -core( -input "%CAPDIR%\cutaudio.wav" -output "%CAPDIR%\%~n2.wav"  -2ch ) -azid( -s stereo -L -3db ) -ssrc( --rate 48000 )
Del  %CAPDIR%\cutaudio.wav

Roxy99,

I tried the modification to the script for 16:9 video, and it worked! I ran it on a small 196 meg 16:9 test video file using the HQ two pass script. The AVI file looks good. The size is compressed to 56 megs. I try the script on some larger 4 gig mpeg2 16:9 video files.

I don't know how hard it would be to have the script automatically detect 4:3 or 16:9 aspect ratio.

Thanks again for your help getting the script to work with 16:9 videos!

Dave
Reply With Quote
  #125  
Old 03-17-2007, 06:44 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
There are a whole bunch of parameters I'd like to automate but need to learn C# to program. It would be a good project.
Reply With Quote
  #126  
Old 03-21-2007, 08:22 PM
xj-boonie's Avatar
xj-boonie xj-boonie is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Minnesota
Posts: 110
Quote:
Originally Posted by davephan View Post
Roxy99,

I tried the modification to the script for 16:9 video, and it worked! I ran it on a small 196 meg 16:9 test video file using the HQ two pass script. The AVI file looks good. The size is compressed to 56 megs. I try the script on some larger 4 gig mpeg2 16:9 video files.

I don't know how hard it would be to have the script automatically detect 4:3 or 16:9 aspect ratio.

Thanks again for your help getting the script to work with 16:9 videos!

Dave
I'm eager to try this, but am wondering if there is a way to have a 16:9 and 4:3 version to pick between the 2 depending on the source.
Reply With Quote
  #127  
Old 03-22-2007, 09:39 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Auto detection is something I want as well. Erik, I hope you are following this thread because maybe you can help.

The source is always 4:3 material for SD. So when I manually set the batch to create a 16:9 avi output, I am cutting out the black bars, the padding, that the broadcast inserted to make the 16:9 source a 4:3 source.

There is no metadata in the mpg2 stream that I am aware of that signals that the video source is a black bar padded 4:3 video (ie 16:9 without the bars). Hence an autodetect parameter must be present.

If Erik can put in his comskip a feature which can output a flag in txt format that says basically 'hi I'm a 4:3 video with blck bars' then the batch file can detect the existence of that file and branch to the right script line for croping.

I will pm Erik about it.

Erik, from you I would need the comskip file to output a log file as follows:

Sourcename169.log or Sourcename43.log

For example:

If I am converting CSIepisodename.mpg which happens to be black barred 16:9 then comskip should produce a text file named CSIepisodename169.log
We know comskip is scanning the mpg for black bars already, so this should not be a problem.
Reply With Quote
  #128  
Old 03-22-2007, 09:51 AM
erik erik is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 467
The standard log file create when verbose=1 writes the following line
Dominant aspect ratio: 1.7800
where the number 1.7800 is replaced by the actually measured dominant aspect ratio.

Maybe you can grep this data from the log file?
__________________
Support Comskip, visit the forum and donate at http://www.comskip.org/
Reply With Quote
  #129  
Old 03-22-2007, 09:59 AM
erik erik is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 467
If you want to know the exact location of the video you also may set verbose=10
and grep the lines that look like
Frame: 3107 Ratio: 2.33 MinY: 226 MaxY: 854 MinX: 226 MaxX: 1686
Frame: 3756 Ratio: 1.34 MinY: 10 MaxY: 1078 MinX: 234 MaxX: 1678
Frame: 5687 Ratio: 1.78 MinY: 10 MaxY: 1078 MinX: 10 MaxX: 1910
Frame: 6615 Ratio: 1.37 MinY: 10 MaxY: 1078 MinX: 226 MaxX: 1686
Frame: 7854 Ratio: 1.78 MinY: 10 MaxY: 1078 MinX: 10 MaxX: 1910
Frame: 27653 Ratio: 1.86 MinY: 154 MaxY: 934 MinX: 234 MaxX: 1678
Frame: 29637 Ratio: 0.00 MinY: 10 MaxY: 1078
Frame: 30094 Ratio: 1.78 MinY: 10 MaxY: 1078 MinX: 10 MaxX: 1910
Frame: 45455 Ratio: 1.37 MinY: 10 MaxY: 1078 MinX: 234 MaxX: 1686
Frame: 47610 Ratio: 1.78 MinY: 10 MaxY: 1078 MinX: 10 MaxX: 1910

These lines signal all the detected AR changes. a ratio of 0.00 signals a undefined AR.
Due to a don't care border of 10 the values never get to 0,1088,1920 etc.
Once you know which part of the video you want to keep you also can decode the area of the video.
Now of course I could look into how to dump this in a simpler to read format.....
__________________
Support Comskip, visit the forum and donate at http://www.comskip.org/
Reply With Quote
  #130  
Old 03-22-2007, 10:00 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Quote:
Originally Posted by erik View Post
The standard log file create when verbose=1 writes the following line
Dominant aspect ratio: 1.7800
where the number 1.7800 is replaced by the actually measured dominant aspect ratio.

Maybe you can grep this data from the log file?
That's great news! Thanks erik. I am not at home so can you post a sample log file where this parameter is present and I'll be able to start analyzing it. Is dominant aspect ratio ever an oddball number like 1.7804, or 1.7794 etc? If so I would have to QGREP and then do numeric operations on it.

Thanks

Last edited by roxy99; 03-22-2007 at 10:10 AM.
Reply With Quote
  #131  
Old 03-22-2007, 10:08 AM
erik erik is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 467
This is the data surrounding the mentioned line
Code:
Logo fraction:              0.6748      
Maximum volume found:         7453
Average volume:                760
Sound threshold:               500
Silence threshold:             100
Minimum volume found:            0
Average frames with silence:    48
Black threshold:                25
Minimum Black level found:      13
Average brightness:            521
Uniformity level:                0
Average non uniformity:        239
Maximum gap between logo's:    181
Suggested logo_threshold:   0.6750
Suggested shrink_logo:	         5
Max commercial size found:      49
Dominant aspect ratio:      1.7800
Score threshold:            1.0500
Framerate:                  29.97
Total commercial length:    0:5:7.47
Block list after weighing
----------------------------------------------------
  #     sbf  bs  be     fs     fe    sc      len   scr cmb   ar                   cut bri  logo   vol  sil corr stdev        cc
  0:+0    0   0   0      1   3113   0.10  103.837  0.11   0 1.78            L      a    951+ 0.84  625- 51+  0.000    95           
  1:--    2   1   1   3114   3437   2.00   10.777  0.06   0 2.33          A          b  672= 0.00 2027= 97=  0.000    67           
  2:--    1   1   0   3438   3754   4.50   10.544  0.07   2 2.33          A  C     a    397! 0.00 1633= 95=  0.000    39           
  3:--    1   1   0   3755   3885   2.25    4.338  0.05   2 1.37             C       b  396! 0.00 1565= 93=  0.000    39           
  4:--    2   1   1   3886   5384   3.00   49.983  0.04   1 1.37          A  CN      b  437- 0.00 1801= 97=  0.000    43           
  5:--    6   2   4   5385   5681   9.00    9.877  0.16   1 1.37          A  C S   a b  626= 0.00  893+ 480  0.000    62           
  6:--   19   5  14   5682   6600   3.00   30.631  0.29   0 1.78               S   a b 1188= 0.00  501! 52+  0.000   118           
  7:--   14  14   0   6601   7848   2.00   41.608  0.13   0 1.37          A        a   1151= 0.00 1585= 94=  0.000   115           
  8:++    5   1   4   7849  26714   0.00  629.463  0.02   0 1.78           EL        b  189= 0.97  456= 37=  0.000    18           
  9:--   24   4  20  26715  27631   3.00   30.564  0.05   0 1.78               S   a b  658= 0.00  484! 42-  0.000    65           
 10:--   21  21   0  27632  28102   6.00   15.682  0.15   0 1.85          A    S     b 1104= 0.00 1764= 90=  0.000   110           
 11:+-    4   1   3  28103  44521   0.00  547.814  0.05   0 1.78           EL        b  434- 0.79  715- 38!  0.000    43           
 12:--   18   4  14  44522  45439   3.00   30.597  0.29   0 1.78               S   a b 2093= 0.00  598! 58=  0.000   209           
 13:--   15  15   0  45440  46353   6.00   30.464  0.38   0 1.37          A    S     b 1845= 0.00 1715= 91=  0.000   184           
 14:--    1   1   0  46354  47616   2.00   42.109  0.31   0 1.37          A        a   2306= 0.00 1491= 92=  0.000   230           
 15:+0   10   1   9  47617  50139   0.10   84.151  0.06   0 1.78            L      a b  412- 0.47  895+ 50+  0.000    41           
 16:--   11   9   2  50140  51036   6.00   29.897  0.13   0 1.37          A    S     b  630= 0.00 1409= 87=  0.000    63           
 17:--   11   2   9  51037  51951   6.00   30.497  0.05   0 1.37          A    S     b  442- 0.00 1795= 93=  0.000    44
__________________
Support Comskip, visit the forum and donate at http://www.comskip.org/
Reply With Quote
  #132  
Old 03-22-2007, 11:31 AM
grauchy grauchy is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 90
I've been using this batch file for about a week and I find it to be pretty useful. A couple of glitches I'm trying to work out though.

First
The avi files come out perfectly and I'm able to play them back. But inside SageTV when I try to play them back SageTV thinks that they are shorter (time wise) than they really are. I think it has to do with the fact that the file is now smaller.

How do I make SageTV just forget about the the old size and just playback the full file? I stops playback before the end cause it thinks the file is over.

Second
I already have ShowAnalyzer and it can produce whatever cut, edl, txt, log file is needed for commercial processing. Is there anyway to get this batch file to take advantage of that? It seems a waste to send the file for commercial processing all over again.
Reply With Quote
  #133  
Old 03-22-2007, 12:21 PM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Quote:
Originally Posted by grauchy View Post
I've been using this batch file for about a week and I find it to be pretty useful. A couple of glitches I'm trying to work out though.

First
The avi files come out perfectly and I'm able to play them back. But inside SageTV when I try to play them back SageTV thinks that they are shorter (time wise) than they really are. I think it has to do with the fact that the file is now smaller.

How do I make SageTV just forget about the the old size and just playback the full file? I stops playback before the end cause it thinks the file is over.

Second
I already have ShowAnalyzer and it can produce whatever cut, edl, txt, log file is needed for commercial processing. Is there anyway to get this batch file to take advantage of that? It seems a waste to send the file for commercial processing all over again.
To answer your first question do not try to mimic the existence of the mpg in your regular recordings. Ideally it would be nice to leave it just there but I guess its a no go.
Your new AVI file should be in a media import directory and from there played back.

Your second question- can you configure show analyser to produce a 'vcf' file? If so then you can place 'rem' in front of the comskip line in the batch file. You will need to modify the batch to also move and copy the proper vcf file from the Soucr folder to the Temp folder where all the processing is done. I'll have to add an 'If Exist' branch in the batch to search for the valid vcf file and copy/paste. Something I'll have to get around to doing.

Last edited by roxy99; 03-22-2007 at 12:23 PM.
Reply With Quote
  #134  
Old 03-22-2007, 03:12 PM
grauchy grauchy is offline
Sage Advanced User
 
Join Date: Jan 2007
Posts: 90
Thanks for the quick reply.

1) I put the avi file in the media import folder not the recordings folder but SageTV still only wants to playback the first part of the file. I must be doing something wrong I just can't figure out what it is.

2) ShowAnalyzer - Looks like .vcf is not an option, Thanks for the info though.
Reply With Quote
  #135  
Old 03-24-2007, 08:10 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Version 1.4 of HQ2pass added to post 1

The batch file now reads the comskip log file to determine the aspect ratio based on the line:
Dominant Aspect ratio: xxxxx

I have define 1.9600 to be widescreen because on my system, 16:9 cropped videos are detected by comskip as having an aspect ration of 1.9600.
(Erik, why is that so?).

This value can only be set by trial and error. 1.9600 works on my setup but YMMV so you need to run a test. Take a known widescreen mpg and run comskip. Look in the comskip log file for the value that appears in the line Dominant aspect ratio:

For instance, if your log file says Dominant aspect ratio for widescreen is 1.8400, then you need to modify the Set command for Wide in the batch file.

Code:
Set Wide=Dominant aspect ratio:      1.9600
Change it to

Code:
Set Wide=Dominant aspect ratio:      1.8400


When changing the command Set Wide=xxx, be sure to leave the same spaces or else the detection string won't work

(All the set commands are at the beginning of the batch file HQConvert2Pass.bat).

I have left ver 1.3 until everyone is comfortable with 1.4. Remember, 1.9600 is a point value. There is no arithmetic comparisson for >1.7500 for example. That would be nice but the batch file is using a string comparison.


Good luck
__________________
http://www.hydranterouge.com
Reply With Quote
  #136  
Old 03-27-2007, 09:31 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
[B]Smart stretch mode[/B]

Just an update. Very soon I'll post a new batch file that employs a smart stretch on 4:3 sources for people with 16:9 widescreen. The new script will stretch 4:3 sources in a non-linear fashion to maintain the correct aspect ratio on the center with gradual stretchin at the ends to eliminate pillar boxes.
__________________
http://www.hydranterouge.com
Reply With Quote
  #137  
Old 03-29-2007, 01:09 PM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Smart stretch mode for 16:9

Its now there on page 1. Download version 1.5 and extract all files to c:\Project.

If you are asked weather or not to over-write files in c:\Project answer 'Yes' to all.

Remember to reconfigure your Set commands in HQConver2Pass.bat according to your directories.

That is personalize these directories to your setup

Code:
Set CUTDIR=c:\Project\Converted
set CAPDIR=c:\Project\misc
set VDir=c:\VirtualDub
SET WORKDIR=c:\PROJECT
set SDIR=c:\Project\source

In processMPG.bat

Code:
FOR %%f IN (c:\Project\Source\*.mpg) DO call HQConvert2pass.bat %%f c:\Project\misc\%%~nf.mpg
Replace c:\Project\Source with your source directory
and C:\Project\Misc with your temp directory (on same physical drive as Source)

PS- If you downloaded 1.5 on March 29, then please redownload today, I fixed a bug.
PPS- BTW, I can't take credit for the resize function. Believe it or not I got it from a Star Wars fan site ( See http://www.originaltrilogy.com/forum...42&STARTPAGE=1. Moth3r is the author of the function.)
__________________
http://www.hydranterouge.com

Last edited by roxy99; 04-06-2007 at 05:04 PM.
Reply With Quote
  #138  
Old 04-02-2007, 05:00 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Anyone try the new update yet?
__________________
http://www.hydranterouge.com

Last edited by roxy99; 04-02-2007 at 07:50 AM.
Reply With Quote
  #139  
Old 04-02-2007, 08:07 AM
Apap's Avatar
Apap Apap is offline
Sage Advanced User
 
Join Date: Apr 2006
Location: Florida
Posts: 216
Quote:
Originally Posted by roxy99 View Post
Anyone try the new update yet?
I havent tried the latest update yet but so far this program works great on my SD recordings with stereo mpg audio. It doesnt seem to work with my HD recordings with AC3 audio yet but i saw a post about that.

Does your latest update incorporate the AC3 fix into it or will I have to modify it myself?

Thanks for your excellent work so far. This program rocks and has been just about perfect in commercial removal and the video quality is great!

Apap
Reply With Quote
  #140  
Old 04-02-2007, 08:25 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Quote:
Originally Posted by Apap View Post
I havent tried the latest update yet but so far this program works great on my SD recordings with stereo mpg audio. It doesnt seem to work with my HD recordings with AC3 audio yet but i saw a post about that.

Does your latest update incorporate the AC3 fix into it or will I have to modify it myself?

Thanks for your excellent work so far. This program rocks and has been just about perfect in commercial removal and the video quality is great!

Apap

AC3 is another kettle of fish. If Dgindex produces an AC3, then yes, the program should give the user the choice NOT to make an mp3. However with a batch script program flow is awkward to control. So I may have to make a different batch just for dealing with AC3.

When Dgindex produces a stereo mpa, then the only logical thing to do is make an mp3.

I invite you to modify it yourself if you can in the meantime and please share the modified batch file with us. You would be helping me out alot.
__________________
http://www.hydranterouge.com
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 09:57 AM.


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