SageTV Community  

Go Back   SageTV Community > SageTV BETA Release Products > SageTV Beta Test Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Beta Test Software Discussion related to BETA Releases of the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. regarding SageTV Beta Releases should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-03-2006, 12:15 AM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
2 pass encoding CBR or VBR?

After doing some reading it sounds like to really take advantage of 2 pass encoding I should be using some sort of variable rate. Currently I'm using a modified MPEG4 Deinterlaced AVI High Quality setting with cropping and 16*9 aspect ratio settings added so that 4*3 letterboxed material is converted to fit a 16*9 screen.

Cutting out the letterboxing significantly reduced the resolution of the avi, but of course the file size is exactly the same due to the CBR. Should I just calculate a new CBR or switch to some sort of variable rate?

If I should switch to something variable can someone give me an example?
Reply With Quote
  #2  
Old 11-03-2006, 03:26 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
With the cutting you reduced the total number of pixels that have to be encoded, so you are not wasting your precious bitrate on the black bands. The video that matters is still the same pixel size, and you end up with better quality encode.

Or we can say it this way: Due to that cut, you can achieve an equivallent quality for the result with a smaller bitrate.

Deciding on CBR v.s. VBR is a separate question. Don't confuse yourself thinking that it arises from that cutting. Personally, I would go for VBR for numerous reasons.

Post your "transcoder/formats/" line here and we may come up with some brilliand ideas.

Last edited by Patilan; 11-03-2006 at 03:30 AM.
Reply With Quote
  #3  
Old 11-03-2006, 06:27 AM
mayamaniac's Avatar
mayamaniac mayamaniac is offline
Sage Icon
 
Join Date: May 2004
Posts: 2,177
I'm experimenting with the SageTV Video Conversion also, so yes, can you post your "transcoder/formats/" line here if you get good results in your tests?
__________________
Mayamaniac

- SageTV 7.1.9 Server. Win7 32bit in VMWare Fusion. HDHR (FiOS Coax). HDHR Prime 3 Tuners (FiOS Cable Card). Gemstone theme.
- SageTV HD300 - HDMI 1080p Samsung 75" LED.
Reply With Quote
  #4  
Old 11-03-2006, 07:16 AM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Yeah I understand that the actual video is the same resolution and I have a higher bitrate applied to the part of the recording that matters. I know using CBR or VBR doesn't arise from the cropping, but to get the same quality as before at a lower bitrate I need to make further adjustments which can be either lowering the CBR or I can go with an appropriate VBR setting.

This is where I'm currently at. It is just the default deinterlaced high quality avi with cropping and 16*9 aspect ratio added. Works perfectly on the shows I've tried so far. I may still have to crop a little more off horizontally for some shows, but so far all have been good.

Code:
transcoder/formats/MPEG4\ Deinterlaced\ and\ Cropped\ AVI=f\=avi;MCompressionDetails\=-vtag xvid -croptop 64 -cropbottom 64 -cropleft 8 -cropright 8 -aspect 16\:9 -deinterlace;[bf\=vid;f\=mpeg4;br\=2000000;][bf\=aud;]
I've read quite a bit about using VBR, but a lot of it is still over my head right now so any help would be great.

Oh and I tried this on MI5 which is letterboxed and plays back as video using smart mode with the Nvidia decoder. I assume for telecined material I shouldn't deinterlace?

Last edited by blade; 11-03-2006 at 09:18 AM.
Reply With Quote
  #5  
Old 11-03-2006, 09:29 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
2-pass implies VBR, the first pass analyzes the video, figuring out which parts need more bits and which can get by with less. The second pass then allocates bits to those parts such that the target bitrate is achieved.

The bitrate setting for 2-pass encoding isn't a constant, it's a target.
Reply With Quote
  #6  
Old 11-03-2006, 04:52 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by blade
Oh and I tried this on MI5 which is letterboxed and plays back as video using smart mode with the Nvidia decoder. I assume for telecined material I shouldn't deinterlace?
I am curious, if you don't deinterlace, is your Nvidia decoder smart enough to recognize it as telecined material when playing in 'smart' mode?

I suspect that answer would be no, since the transcoding does not preserve the interlacing properly, and that will make Nvidia's job harder. But let me know what happens.

And if it turns out to be a 'no', and if you can't ivtc with this transcoder, then yes, deinterlacing is the only thing you can do.

BTW, in your "transcoder/formats/" line I see that you are using the mpeg4 video codec. Have you tried any other codecs? I think you'll get the same quality results with half that bitrare if you use xvid or x264. Personally I am very fond of x264.

Keep us posted.
Reply With Quote
  #7  
Old 11-03-2006, 05:50 PM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Quote:
Originally Posted by Patilan
I am curious, if you don't deinterlace, is your Nvidia decoder smart enough to recognize it as telecined material when playing in 'smart' mode?
The Nvidia decoder only works on mpeg2 so once it is converted to avi it is not used. I was refering to using the Nvidia decoder and smart mode to check my mpeg2 files to see if they are video or telecined before converting them to avi. I have fraps installed so I can playback a video in Sage and it will display the framerate. This allows me to see if I'm dealing with video or telecined film from within Sage.

I have FFDshow installed and it is used for my downloaded avi files and I assume that is what is still being used for the transcoded videos, but I haven't checked yet to be sure.

Quote:
And if it turns out to be a 'no', and if you can't ivtc with this transcoder, then yes, deinterlacing is the only thing you can do.
That was pretty much what I was wondering. I didn't know if the video should be deinterlaced for telecined or if there was something that could be done during playback if I left it interlaced.

Quote:
BTW, in your "transcoder/formats/" line I see that you are using the mpeg4 video codec. Have you tried any other codecs? I think you'll get the same quality results with half that bitrare if you use xvid or x264. Personally I am very fond of x264.
I just modified one of the existing options in Sage since I'm such a newb. I haven't looked into other options yet, when I get a chance I'm going to try and learn enough to make some improvements.
Reply With Quote
  #8  
Old 11-03-2006, 09:58 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by blade
...This allows me to see if I'm dealing with video or telecined film from within Sage.
If you want to see that from within Sage then don't play it with 'fancy' decoder like Nvidia's. Switch to the "InterVideo NonCSS Video Decoder" that comes with Sage. It will show you each and every frame, without doing any tricks on them. If the source has been telecined, then you'll see a 5-frame pattern: 3 good frames followed by 2 jagged frames. Play the same thing with a fancier decoder, and you'll see a 5-frame pattern again, but the 4th and 5th frame will look the same (duplicate). Such decoders do mostly deinterlacing. But if you have a decoder which is capable of doing ivtc on the fly, then for the same video it will output only 4 good frames, no pattern, and you'll have smooth playback.

Quote:
Originally Posted by blade
...if there was something that could be done during playback if I left it interlaced.
I'm afraid not. Once transcoded the damage is done. Plus, you can't really leave it interlaced: Not doing deinterlacing with the transcoder does not mean that the interlacing will be preserved. It only means that the result will look uglier. Either way the original interlacing will be damaged beyond repair.

Quote:
Originally Posted by blade
I haven't looked into other options yet
The options you posted above are not really options for the video codec, they are all options for the ffmpeg muxer. (except the bitrate of course). To try oter codecs you can replace the "mpeg4" in ...;[bf\=vid;f\=mpeg4;...] with "xvid" or with "h264" or something else. And if you like what you see then we can discuss options for the codecs.

BTW, for video codecs other than "mpeg4" you can get rid of that "-vtag xvid" patch.

Let us know how it goes.

Quote:
Originally Posted by blade
...since I'm such a newb.
You are not a newb, you are "Sage Icon". Take this from a newb!
Reply With Quote
  #9  
Old 11-03-2006, 10:59 PM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Quote:
Originally Posted by Patilan
If you want to see that from within Sage then don't play it with 'fancy' decoder like Nvidia's. Switch to the "InterVideo NonCSS Video Decoder" that comes with Sage. It will show you each and every frame, without doing any tricks on them. If the source has been telecined, then you'll see a 5-frame pattern: 3 good frames followed by 2 jagged frames. Play the same thing with a fancier decoder, and you'll see a 5-frame pattern again, but the 4th and 5th frame will look the same (duplicate). Such decoders do mostly deinterlacing. But if you have a decoder which is capable of doing ivtc on the fly, then for the same video it will output only 4 good frames, no pattern, and you'll have smooth playback.
Thanks, I'm slowly learning.

I wasn't talking about looking at the actual frames because all that is still over my head. I was talking about using fraps to display the actual framerate of either 60 fps (video) or 24 fps (film) on top of the video when using the Nvidia decoder and smart mode. The decoder automatically does IVTC when needed. All my content is from analog cable so I assumed any recording that is being played back at 24 fps was telecined.

I'm not planning to use it for long term storage, just freeing up drive space when I get behind and my drives start to fill up. I know I'd be better off just buying another drive or two, but the novelty factor makes it worth tinkering with. The only shows I would consider transcoding would be the few that the Nvidia decoder doesn't use IVTC on. For my purposes I planned to just trust the Nvidia decoder to choose the type of content for me. Even if it is wrong I figure if the show is going to be deinterlaced by the decoder anyway that it wouldn't hurt too much to deinterlace and transcode it.
Reply With Quote
  #10  
Old 11-03-2006, 11:22 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
I was meaning to ask, how do you get sage to record at 60 fps from your analog cable? Aren't all your recordings at 30 fps? Or isn't it just your Nvidia software saying to you 60 lines per second or something instead of frames per second?

Anyway, if it's just about freeing up some space (and what else can it be?) then you may really want to try some other codecs.
Reply With Quote
  #11  
Old 11-03-2006, 11:28 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
They're 480i60, that's 60 fields/second. nVidia's finest will (if it's truely video) deinterlace that to 480p60, 60 frames/second. Remember, true video is not 30 fps, it's 59.94 fields/second, with each field being from a unique instant in time. True interlaced video has a temporal resolution of ~60 fps, and a spacial resolution of something between 240 lines and 480 lines (depending on motion).

If the content is film sourced, it will IVTC it to 480p24, and for some content that's actually progressive but not film, it will, I'll call it "reconstruct" it to 480p30.

In these cases, while the images are still represented as fields, those fields (even and odd) come from the same moment in time. Film has a temporal resolution of 24 fps and a spacial resolution of 480 lines, and progressive video has a temporal resolution of 30 fps, and the same 480 line spacial resolution.

It is then rendered to VMR9 at the appropriate framerate, and Fraps, a Direct3D framerate monitor will display the actual framerate of the content. Film will be rendered at 24 fps, interlaced video at 60 fps, and progressive "video" at 30 fps, and Fraps will show that.

Last edited by stanger89; 11-03-2006 at 11:32 PM.
Reply With Quote
  #12  
Old 11-04-2006, 06:39 AM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
What he said. All I knew was how many fps it showed with film and video. Not all the details of how and why.
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 08:56 AM.


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