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
  #1  
Old 05-25-2005, 11:31 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Can windows media encoder use other (xvid) codecs?

I read in the notes that it can, however it was worded in such a way that it sounded like it was more .. "MS approved" codecs.

The reason I ask, is that I want to automate transcoding and commercial cutting, and I've had poor success with ffmpeg so far. I really like the WME interface and useability at least for me.

Thoughts? flames?

Cory
Reply With Quote
  #2  
Old 05-26-2005, 02:03 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
I believe that WME is WMV only...
Thoughts: Alternatives:

Cutting: Videoredo -- can be scripted, works with everything you can throw at it, and I believe comskip generates VideoRedo project files. Downsde: costs $ (but is worth it IMHO!)

Encoding: Autogk -- easiest for autodetect of crop margins and interlaced/Telecine content, and resizing video to get ideal bits/pixel in the 0.15-0.25 range (except that autoGK is not scriptable, but I have a girder group that works around this)

Alternative encoder: mencoder -- It is a pain to get the correct options: you need to know a lot about encoding, and you have to manually select crop margins, deinterlacing/IVTC and resizing if required, but is much faster than AutoGK --my AthlonXP3200+ can do encoding at 2xrealtime -- and if run in low priority has less impact on the system.
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 05-26-2005 at 03:50 AM.
Reply With Quote
  #3  
Old 05-26-2005, 04:43 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hi Niel

Thanks for the notes and confirmation -- I had the sinking feeling that WME was going to be WMV only. I'm stuck on divx or xvid because my DVD player supports those but not WMV (sigh.. someone had advised me to wait, and get a lite-on that supported both, but I was impatient, and "why would you want to use a proprietary MS format like WMV anyways").

I'm pretty much sold on VideoRedo for the reasons you mention. I haven't gotten to the point of automating that part yet, mainly because I really really like malore's STV and I'm sortof stuck on the idea of being able to use the channel-ignore, and kick-off from the STV but just change the command line options to output both formats at the same time (this is probably not realistic unfortunately...). I hate the idea of running something as time and disk intensive as comskip twice just to output a second 2k file.

Realistically if I was pie-in-the-sky'ing I'd want a button on malore's options page to "compress now" and/or "compress and cut now" with the option of using the channel ignore and selection features, and configurable command line. A guy can dream, anyways

I *have* messed around with autogk a little bit a few months ago, but I had some config problems, so I might give it another try. mencoder sounds like a real option, except I know next to nothing about compression terminology -- I'm sure i'll end up learning about this at some point though

(light bulb) Niel -- I'm using your imported menus, and I know they have a "external command" option. Is there a way I can link that to show selection so I have the filename to pass in do you think? Should I just get used to the idea that compression in my setup is going to be a manual process? The implementations that I've heard of in STV's have been a part of STV's that have features or looks that are showstoppers for me.

Either way, thanks for the education. I'll investigate some of those options and see what I can come up with

Cory
Reply With Quote
  #4  
Old 05-27-2005, 06:09 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Niel -- I'm using your imported menus, and I know they have a "external command" option. Is there a way I can link that to show selection
Nope, sorry. Some of the STVs do have a button in detailed info which generates a 'compression job' XML file for the show -- you still need to run an external program to start the compression using the info in the file

Mencoder info:
http://www.mplayerhq.hu/homepage/design7/info.html#docs
http://gentoo-wiki.com/HOWTO_Mencode...coding_Options

Example mencoder command lines from my playing:
Code:
start /belownormal /min mencoder.exe VideoFile.mpg -o VideoFile.avi -info name="Video Title" -ovc xvid -xvidencopts bitrate=1000 -oac mp3lame -lameopts cbr:br=128 -vf kerndeint,pp=ac,scale=640:480
This deinterlaces, does some high quality filtering, resizes to 'square' NTSC resolution, then encodes to 1000kbps video + 128kbps audio in a single pass, and embeds the video title (with -info) into the AVI file.

This should give you ~500KB/hr files with ~0.15 bits/pixel (which is resonably high compression), and should be OK for TV shows. (PAL people would need to scale to 768:576 to keep the same vertical resolution as the capture)...

For testing, mencoder accepts the -frames n argument to only encode the first n frames.

If you want to crop the black bars on letterbox shows mplayer can autodetect where to crop:
Code:
mplayer.exe Video.mpg -vo null -nosound -benchmark -frames 20 -vf cropdetect=30 -sstep 30
This looks at the first 10 minutes of video, looking at a frame every 30 secs and produces output with lines showing the -vf crop command to use (eg -vf crop=700:428:10:70). You then run player again with this crop argument to see how much to scale by
Code:
mplayer.exe Video.mpg -vo null -nosound -benchmark -frames 1 -vf crop=700:428:10:70
-- there will be a line showing how much the output is being scaled to preserve the aspect ratio:
Code:
VO: [null] 700x428 => 570x428 Mpeg PES
, which you can then use in the scale= filter...

For encoding films broadcast in NTSC, you may want to do inverse TeleCine (Telecine is an evil process where 4 film frames (24fps) are interlaced into 5 TV frames (30Fps))... There are many options for doing this in Mencoder, but because I am in PAL land, I don't have to worry about them!
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 05-27-2005 at 07:01 AM.
Reply With Quote
  #5  
Old 05-27-2005, 05:39 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hi Niel

You read my mind. I was playing with mencoder last night, and even though I managed to find some documentation (no -? for help.. bah) it wasn't pretty. You've given me exactly what I need, thank you

Cory
Reply With Quote
  #6  
Old 05-30-2005, 12:37 AM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hi Niel

Thanks for those command lines. I'm not sure what I was doing differently, but my results now are much much better.

Can I presume upon your generosity once more for an example of the two pass method (for better output quality) ? I am not cropping, resizing, or deinterlacing (I am compressing for archiving to DVD to be played on my xvid enabled DVD player back to my TV ... so deinterlacing isn't necessary, right?)

I did some two pass experiments, but they all failed at the 2nd pass. Mind you, I was using the "-sameq" option, as well as vbr mp3 I believe. Anyways, if you feel like it maybe you could give me your two pass version? thanks!

Last question: you're using CBR mp3 -- wouldn't vbr be better?

Cory
Reply With Quote
  #7  
Old 05-30-2005, 03:22 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Mencoder's kerndeint is a much better deinterlacer than the one in ffmpeg -- its the one that AutoGK uses as well, better deinterlacing before encoding can give much better quality, as 'combing' interlacing artifacts are a nightmare to encode

VBR MP3 may give better quality, but VBR is not fully supported by the AVI file format (it can cause audio sync problems in some players), so I always use CBR to be on the safe side... Anyway, it's not high quality Dolby digital sound you are re-encoding, but a relatively low bandwith audio stream that has already been encoded at ~384kbps in MPEG2-Audio format, so any difference in quality may not be noticable.

Again, play and see what happens.

For 2-pass, you run the same commandline twice with pass=1 in the xvidencopts (no bitrate specifcation is required for the first pass), then once that is complete, run the same command line in the same directory but with the bitrate specified and pass=2 (see mencoder docs for more info)
Code:
-xvidencopts pass=1:bitrate=1000
There are some small speedups -- you don't need to encode audio in the first pass (-nosound in place of -oac, -lameopts), and you dont need to keep the generated pass 1 avi output file (there is a small xvid-twopass.stats that contains the pass-1 frame complexity information)

With 2-pass mode, if you want to, you can choose a specific file size for the video portion by specifying a negative bitrate: to get the final file size, you will need to add the size of the audio portion plus something for the AVI file format overheead. Personally, I don't care about fitting a video exactly onto a 1/4DVD or 1 CD, so I have not played with this.
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 05-30-2005 at 03:24 AM.
Reply With Quote
  #8  
Old 05-31-2005, 12:00 AM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hi Niel

This is great info, thanks very much for the clarification and education.

I will try deinterlacing and see if I can see the difference -- I had assumed that because it was going back to an interlaced output that it wouldn't matter. I will definitely give the two pass a try with the speedups -- the docs mentioned this, but I couldn't figure out what could safely be removed.
I'm just finishing my one pass suite of bitrates to compare and see where my sweet spot is-- seems like I agree with your estimation of the 1000 kbps so far, maybe a little higher for certain applications.

I'm not sure what you mean by not keeping the original avi output in a two pass scenario -- it will just be overwritten, yes? Should I be doing something special there? Some way to turn off the generation of the output for better I/O ?

I agree on the specific file sizes -- with this kind of compression ratio, its hard not to be happy with what you get already

Thanks again for all the help, you've saved me a tonne of frustration.

thx

Cory
Reply With Quote
  #9  
Old 05-31-2005, 05:24 AM
dvd_maniac's Avatar
dvd_maniac dvd_maniac is offline
Sage Icon
 
Join Date: Mar 2004
Location: New England
Posts: 1,899
What would be some of the advantages of running mencoder in Command Line rather than just using AutoGK? If you have to wait to run the second pass until after the 1rst pass and then delete the output of the 1rst. I thought the CLI was to be able to automate everything?
I use AutGK and usually once a day I just add whatever new recordings I want to archive to the queue.
__________________
If this doesn't work right, Then:
"I'm going to blow up the Earth!"
Reply With Quote
  #10  
Old 05-31-2005, 06:55 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
  • you cannot add jobs to AutoGk on command line (without hacks)
  • latest AutoGk versions (>1.6) contain adware
  • Mencoder encodes faster and causes less overhead on the system (in my experience).
  • you can still automate a 2-pass mode via command line: you just have a batch file that runs the 2 passes - you don't have to delete the pass-1 output file, just overwrite it
and finally, a command line tool allows the encoding to be scripted from within Sage, so when I get round to it, there my be 'true' embedded re-encoding of sage recordings...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #11  
Old 05-31-2005, 10:51 AM
GbrNole GbrNole is offline
Sage Fanatic
 
Join Date: Aug 2003
Location: Fort Myers, FL
Posts: 844
a bit off topic here but i have found my best autogk version to be 1.22

i use this version but installed the latest xvid 1.1.01 beta 2 codec and the latest virtual dub. i found that my encode speed got about 15% faster.

the other benefit is that i can still encode from rips created by dvd shrink and there's no adware!!!
Reply With Quote
  #12  
Old 05-31-2005, 12:19 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Niel you are making me salivate when you talk about integration my friend!!!

Mencoder is working really great for me. As well, good results (excellent, actually) scripting two pass encoding.

Just a note to anyone passing by, when you script two pass, its useful to know the batch command START /WAIT which will make sure commands run consecutively.

Cory
Reply With Quote
  #13  
Old 06-01-2005, 12:21 AM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
Cnovak, can you post your whole script?

I am asking even though people have given their version, so I can pick and choose over the weekend
Thanks
Reply With Quote
  #14  
Old 06-01-2005, 02:11 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
cnovak... It might take a while
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #15  
Old 06-02-2005, 01:18 AM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
For whoever asked, this is a copy of the script I am using (right this minute as a matter of fact). However, I post it for educational purposes only -- I'm happy to discuss how you might put to to work, and how it can be improved, but be aware that this is by no no no means a polished product -- it just does what it needs to, and there are a lot of "flexibility" modifications that I still need to make now that I have it working correctly.

But, here it is anyways. The expectations of the script are that it will operate on ALL mpg files in whatever is your current directory. It will output to E:\compress. Both of which can be changed, of course, but this is something that is hacked together a bit, and is fragile from the respect of dealing with different situations. Only try to use this if you aren't scared of batch -- otherwise you will likely just frustrate yourself and there are scripts posted that are much more robust that have been posted.

Niel: :/

thx

Cory



== cut here
FOR %%i in (*.mpg) do call :loop %%i
goto end

:loop
if EXIST E:\compress\%1 goto :EOF
echo Started %1 pass 1 encode %DATE% %TIME% >> c:\output\log.txt
start /belownormal /min /WAIT mencoder.exe %1 -o E:\compress\%1 -info name="%1" -ovc xvid -xvidencopts pass=1 -nosound -vf kerndeint,pp=ac
echo Finished pass 1 of 2 pass spedup deinterlace 1000kbps %DATE% %TIME% %1 >> C:\output\log.txt
start /belownormal /min /WAIT mencoder.exe %1 -o E:\compress\%1 -info name="%1" -ovc xvid -xvidencopts pass=2:bitrate=1000 -oac mp3lame -lameopts cbr:br=128 -vf kerndeint,pp=ac
echo FINISHED 1000kbps 2 pass spedup deinterlace P4 %DATE% %TIME% >> C:\output\log.txt

goto :EOF
:end
echo 

(the last character is a ctrl-g to beep)
Attached Files
File Type: txt xcompress.txt (686 Bytes, 214 views)

Last edited by bluenote; 06-02-2005 at 05:26 PM.
Reply With Quote
  #16  
Old 06-02-2005, 02:33 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
-vf kerndeint=ac
should that not be
-vf kerndeint,pp=ac
(=ac is not a valid option to the kerndeint filter)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #17  
Old 06-02-2005, 05:27 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
I edited the text of my post to reflect that, thank you niel. I wanted to take out the resize/crop, but the deint seemed to produce good results .. unfortunately I have trouble with the mencoder command line. thank you!

Cory

PS. copy and paste the text from the prev. message if you want to experiement with that snippet of code, I havent updated the file
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 04:02 AM.


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