AddBorders greatly increasing bitrate

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

AddBorders greatly increasing bitrate

Postby Twisted871 » Sat Jun 26, 2010 10:15 am

Hey all, I am trying to increase the resolution of a video file from 640x360 to 640x480 while keeping the aspect ratio of the actual clip the same:

Code: Select all
AviSource("clip.avi")
AddBorders(0, 60, 0, 60)


I'm loading the the script into VirtualDub(ver 1.9.9), then saving the resulting video. While the borders are added correctly, the bitrate for the clip increases substantially from 1096 kbps to 11048 kbps. Is there any way to keep the bitrate from changing so much? Thanks for any help.
Twisted871
 
Joined: 26 Jun 2010

Re: AddBorders greatly increasing bitrate

Postby Scintilla » Sat Jun 26, 2010 6:33 pm

You should consider resizing the video to 640x352 first, then add borders of 64 on each side. This way each 8x8 macroblock will contain only borders or only picture, not both.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

Re: AddBorders greatly increasing bitrate

Postby mirkosp » Sat Jun 26, 2010 6:33 pm

I'm guessing the clip you're importing is lossy. The thing is, once you import it in avisynth, any other program, vdub included, won't see it as the original lossy file anymore, but just as a sequence of *your colourspace here* images, and as such if you're trying to direct stream copy, it's not copying the original encode, but the avisynth frames that you can consider as uncompressed. You'll probably have to eat the bullet and re-encode, or perhaps you could do without the letterboxing, if that's an option?
PS: What Scintilla said is also good to keep in mind, although it is not the reason for your bitrate skyrocketing.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: AddBorders greatly increasing bitrate

Postby Scintilla » Sat Jun 26, 2010 6:42 pm

Oh, whoops. I thought you meant you had some lossless source clip that you encoded at 640x360 with the first bitrate resulting, and then you encoded it at 640x480 with the second bitrate resulting. What I said was the only reason I could think of for a bitrate increase, but considering how few blocks it affects, it really shouldn't produce THAT much of an increase.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

Re: AddBorders greatly increasing bitrate

Postby Phantasmagoriat » Sat Jun 26, 2010 7:41 pm

yeah, sounds like you are converting from a lossy to lossless format.
What settings are you saving/re-compressing with?
...some codecs like XviD have the option to set the bitrate.

But the important thing is that you save using setting that are appropriate for your task at hand. For instance, there are codecs that are good for editing, like HUFFYUV (or anything lossless). They produce big files... but are high quality and frame-accurate (which makes them perfect for editing). There are others that are best for internet distribution like x264 or XviD. They produce smaller files... but are not suited for video editing. So yeah, the settings depend on what you are using the video file for.

also, you might find this useful: bestfit( 640,480, "addborders" )
Image
Org Profile | AMVGuide | Phan Picks! | THE424SHOW | YouTube | "Galactic Escape"

"Effort to Understand; Effort to be Understood; to See through Different Eyes."
User avatar
Phantasmagoriat
 
Joined: 06 Feb 2006
Status: ☁SteamPunked≈☂

Re: AddBorders greatly increasing bitrate

Postby Twisted871 » Tue Jun 29, 2010 4:03 am

mirkosp wrote: You'll probably have to eat the bullet and re-encode, or perhaps you could do without the letterboxing, if that's an option?


I'm working on a project where I need to edit together clips of various resolutions(640x480 and 640x360). So to have all of the clips looking normal in the end I need to letterbox the smaller clips.

Phantasmagoriat wrote:yeah, sounds like you are converting from a lossy to lossless format.
What settings are you saving/re-compressing with?
...some codecs like XviD have the option to set the bitrate.


I was using default settings for XviD :oops:. I set the target bitrate to 1096 and the video clip is now only doubling in size which is far more manageable.

Thanks for helping a newbie out, I'm still not very familiar with VirtualDub.
Twisted871
 
Joined: 26 Jun 2010

Re: AddBorders greatly increasing bitrate

Postby Mister Hatt » Tue Jun 29, 2010 11:26 am

Stop using XviD, h264 has been better since around 2004, we're in 2010 here so it's time to upgrade maybe?
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Re: AddBorders greatly increasing bitrate

Postby mirkosp » Tue Jun 29, 2010 12:06 pm

Mister Hatt wrote:Stop using XviD, h264 has been better since around 2004, we're in 2010 here so it's time to upgrade maybe?

h264 in avi isn't very suggestable.
Although, neither is xvid for editing purposes.
Pick a lossless codec... for editing it's either plain huffyuv or lags (premiere doesn't seem to like ffhuffyv12... I'm not sure, though) if you want to go avi. If you want you can try m2ts with an intra-only high bitrate lossy h.264 (lossless h.264 breaks, so yeah...).
So all in all going for lags or huffy avi is probably the best choice for editing in premiere.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: AddBorders greatly increasing bitrate

Postby Mister Hatt » Wed Jun 30, 2010 11:14 am

Sorry why are we suggesting lagarith again? Too lazy to rage so leaving it to Fluff: http://mod16.org/hurfdurf/?p=142

AVI isn't very suggestable for encoding purposes, so my point still stands.
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Re: AddBorders greatly increasing bitrate

Postby mirkosp » Wed Jun 30, 2010 11:39 am

Mister Hatt wrote:Sorry why are we suggesting lagarith again?

>>Premiere/After Effects/Vegas/Alikes
We're suggesting lags because at this point it doesn't matter anymore and because Premiere/AE don't recognize FFHuffYV12 ─ I assume it's the same for vegas etc.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: AddBorders greatly increasing bitrate

Postby Mister Hatt » Wed Jun 30, 2010 11:41 am

Lagarith is a VFW codec though so if your favourite shitty NLE or compositor is able to read it, it can read the significantly smaller source+avs script just as well.
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Re: AddBorders greatly increasing bitrate

Postby mirkosp » Wed Jun 30, 2010 11:48 am

Mister Hatt wrote:Lagarith is a VFW codec though so if your favourite shitty NLE or compositor is able to read it, it can read the significantly smaller source+avs script just as well.

Premiere/AE can do that only with a plugin installed, vegas doesn't have a plugin so it can't load avs without VFAPI/MakeAVIs or similar stuff...
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: AddBorders greatly increasing bitrate

Postby Mister Hatt » Wed Jun 30, 2010 12:38 pm

Start using something better than the junk Adobe/Sony pump out then? Hi Avid/AutoDesk~
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Re: AddBorders greatly increasing bitrate

Postby Kariudo » Thu Jul 01, 2010 12:54 am

Think about the community a little bit. I doubt people are gonna spend ~$2500 for Avid, and I doubt AutoDesk is any better in that regard.
ImageImage
Image
User avatar
Kariudo
Twilight prince
 
Joined: 15 Jul 2005
Location: Los taquitos unidos
Status: 1924 bots banned and counting!

Re: AddBorders greatly increasing bitrate

Postby Mister Hatt » Fri Jul 02, 2010 2:28 am

It sounds like you're suggesting that people actually paid for Premier/AE/Vegas when most of them are dirty pirates...
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Next

Return to Footage Help

Who is online

Users browsing this forum: No registered users and 2 guests