GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Video encoding tips and tricks (https://gfy.com/showthread.php?t=937513)

PowerCum 11-08-2009 10:55 AM

Video encoding tips and tricks
 
Today I was speaking with one of my content providers and just showed him some of the resampled and processed "shit quality" videos he sold me for nuts some time ago. The guy was completely freaked with the quality so I decided to write some tricks we use here at Galaxy Media for video processing.
Don't expect me to detail the process, these are just raw guidelines that are followed here.


Bitrates:

Everyone knows that if you want to stream a 640x480 or better res video with decent quality you should go to 1.000 - 2.000 kbps bitrates. This assumption is no more true in most of the cases.
Using variable bitrate encoding with burst will allow you to match the same or very similar quality with 500 - 800 kbps bitrates. Just make sure that your VBR settings have enough burst to raise the bitrate when quality is really needed.
The more movement your video has the more bitrate burst it will need. For example a slow moving scene of a solo girl would need practically no burst while a scene with 15 people orgy all moving fast all over the screen jumping around like crazy rabbits would need relatively high burst.


Resolution and resolution resampling:

Converting 320x240 video to 640x480 is easy, but in the process you usually "lose" quality because the pixels convert into square clusters that don't look very good. In these cases applying some filters really cleans the scene and makes it looks like a native 640x480.
These filters are your friends in these cases: Smoothing filter, gama, contrast and brightness correction and noise reduction. A good combination of these + some extra bitrate burst during the high movement parts of the scene will usually do the work.
Take in mind that different resolutions will demand different bitrates. It's not the same to have 640x480 than a 768x576 resolution.


Resampling framerates:

Usually changing the original video framerate is not a good idea unless you want to adapt it to a specific media (mobile phones for example).
If you remove frames you will be removing data and will need less bitrate, but the video will look chunky. This will be even worse for high movement scenes because the video processor will just discard entire frames.
Adding framerate is also bad, but in the opposite way. Resampling an 15 fps video to 30 fps usually adds the same data twice converting the final result in a chunky playing video where most pixels are just big squares. Have you seen a hentai video where the male toon dick is pixelated? Think about that with real actors. Also the final result video will be almost twice bigger than the non resampled one and it's quality will be lower for a human observator


Filtering:

Most people think that video processing is the same as photo processing. They couldn't hit closer to the target and still miss it completely.
Most people love to add a sharpen filter to their processed videos like they do to their pics. That's usually a very bad idea because the slightest defect your video has becomes more accentuated. On high movement scenes it may even look like the video is being played chunky... just like badly encoded CGI efects on action films.
Instead of that you should use a noise reduction filter to eliminate most of the pixelated and borders imperfections. Then combine with brightness, contrast and gamma filters.
Having a good combination of these filters will allow you to lower the bitrate considerably (5 - 15%) losing some technical quality but not losing a human eye observer perceived quality.


Pixel depth:

The human eye practically doesn't distringuish between 32 and 24 bit pixel depth. On the image side, that's 20 - 25% less data and bitrate. Most videos can even be encoded at 16 bit pixel depth without losing quality to the human observer eye.


Sound:

Use same concept as the pixel depth. It's ok to have the sound encoded at 300 kbps, but if you go over 128 kbps most humans will not notice the difference. mp3 encoding at 96 kbps usually does a good work. With aac you can lower the bitrate even more.
Remember to add a sound normalization filter. When you lower the sound bitrate sample there will be moments where the sound volume will jump up and down. Adding a sound normalization filter solves that problem in 99% of the cases.


CUDA "turboprocessors":

A CUDA processor is a native GPU processing unit that can process video in sub real time. The most powerful ones can process a 30 minute scene is 2 or 3 minutes. It's basically a high end graphics card with a stream processor... like this one: http://www.nvidia.com/object/product..._c1060_us.html
The problem with cuda is that you are constrained to 4:3 and 16:9 resolutions and the lack of processing applications. Even that, it's relatively easy to code your own stream processing application that fits your needs and eliminate all these restructions.
The usual problem with the CUDA processing library (at least with the current one) is that it cannot apply filters optimally and the sound usually gets missadjusted a couple of seconds making the final result video funny to watch but not a worthy piece for production site.
Having a first stage of processing to separate the video from the sound, then applying the needed filters to the video part and streaming through the CUDA processor to get the final video with no sound solves the problem. You can process the sound and add it after that in a mixer program. In most cases this is faster than processing the video with just a CPU based video processing application. Also allows some real time transformations and testing on the video part that would take you hours to do on a normal video processing applcation.
CUDA only processed files are usually about 15% bigger than pure CPU or mixed processing results. If you count your bw usage in Gigabit/sec it's something really important to look at. With 1 Gbit line you could save 150 Mbps by using a mixed solution.


Some other day I could post tips about how to build your own CDN network for practically no money.

Davy 11-08-2009 11:01 AM

Thanks for the tutorial.
Why would you convert 320x240 to 640x480, though?
I hope that's not what the content provider sold you?

Waiter 11-08-2009 11:03 AM

thanks for sharing yo !!! :thumbsup

PowerCum 11-08-2009 11:07 AM

Quote:

Originally Posted by Davy (Post 16528163)
Thanks for the tutorial.
Why would you convert 320x240 to 640x480, though?
I hope that's not what the content provider sold you?

Because if you convert it properly you can gain quality and still have relatively low bitrate. Most people wouldn't bother with that, but we do.
Having a HUGE library of scenes licensed from 1998 to now has left us with lots of formats bitrates and funky crap around. We are just reencoding and normalizing everything in our content library at the moment.
Lots of amateur made content using the first digital cameras or still old Hi-8 and VHS cameras requires some extra resampling if you want to put it on a production site nowadays... even if it's a free tube with full scenes like in our case :)

fatfoo 11-08-2009 11:09 AM

Nice long tutorial.

xenigo 11-08-2009 11:09 AM

Not trying to be an asshole, but I don't really see any "tips" here, as much as I see an explanation for these functions. Exception may be where you talked about pixel depth, and sound bitrate.

You seem to like filters, but forgot to mention that each filter will double the length of encoding time.

stickyfingerz 11-08-2009 11:52 AM

Quote:

Originally Posted by PowerCum (Post 16528179)
Because if you convert it properly you can gain quality and still have relatively low bitrate. Most people wouldn't bother with that, but we do.
Having a HUGE library of scenes licensed from 1998 to now has left us with lots of formats bitrates and funky crap around. We are just reencoding and normalizing everything in our content library at the moment.
Lots of amateur made content using the first digital cameras or still old Hi-8 and VHS cameras requires some extra resampling if you want to put it on a production site nowadays... even if it's a free tube with full scenes like in our case :)

No offense, but how do you think you can gain quality by converting a smaller resolution to a larger one... :uhoh

PowerCum 11-08-2009 12:18 PM

Quote:

Originally Posted by stickyfingerz (Post 16528260)
No offense, but how do you think you can gain quality by converting a smaller resolution to a larger one... :uhoh

No offense at all. It's all about what the human visitor may perceive as quality and not about the technical quality as pixels count and such.
The concept is the same as when you interpolate a small pic and make it bigger by artificially raising it's resolution. You can just zoom that pic and have a very similar effect, but the human eye likes more the interpolated pic than the zoomed low resolution original.

You can just resize a 320x240 video to 640x480 into the player, but then the player interpolation is made in real time, if the player interpolates at all, and usually ends with 4x4 pixel squares all over the video.
Processing the video properly will "eliminate" these squares by interpolation, noise reduction and gamma correction. The square pixels will be still there because you cannot get more data to fill them if there is not, but the human visitor eye will barely notice them if it notices them at all.

donnie 11-08-2009 12:22 PM

Nice tutorial! Thank you very much :thumbsup

Just one stupid question... What software do you actually use for encoding?

PowerCum 11-08-2009 12:28 PM

Quote:

Originally Posted by donnie (Post 16528308)
Nice tutorial! Thank you very much :thumbsup

Just one stupid question... What software do you actually use for encoding?

Custom made CUDA encoding stuff, ffmpeg, Sorenson Squeeze and Loiloscope.

stickyfingerz 11-08-2009 01:01 PM

Quote:

Originally Posted by PowerCum (Post 16528300)
No offense at all. It's all about what the human visitor may perceive as quality and not about the technical quality as pixels count and such.
The concept is the same as when you interpolate a small pic and make it bigger by artificially raising it's resolution. You can just zoom that pic and have a very similar effect, but the human eye likes more the interpolated pic than the zoomed low resolution original.

You can just resize a 320x240 video to 640x480 into the player, but then the player interpolation is made in real time, if the player interpolates at all, and usually ends with 4x4 pixel squares all over the video.
Processing the video properly will "eliminate" these squares by interpolation, noise reduction and gamma correction. The square pixels will be still there because you cannot get more data to fill them if there is not, but the human visitor eye will barely notice them if it notices them at all.

I guess you have a sample of this then? Its not going to "increase" the quality I just don't buy that. You may make a larger version that is very viewable and acceptable, but the quality can't get better.

xenigo 11-08-2009 01:04 PM

Quote:

Originally Posted by stickyfingerz (Post 16528386)
I guess you have a sample of this then? Its not going to "increase" the quality I just don't buy that. You may make a larger version that is very viewable and acceptable, but the quality can't get better.

Dude, increasing the resolution won't by itself help... you gotta increase the bitrate, too. :winkwink:

Come on man... you know that. :winkwink:

Les Grossman 11-08-2009 01:08 PM

Nice post. Thanks.

jay23 11-08-2009 01:11 PM

Watch this video

http://tv.adobe.com/watch/max-2009-d...o-using-flash/

I consider this guy to be the best video encoder in the planet.

grumpy 11-08-2009 01:37 PM

thanks for the info although one point, we set bitrate to 2500 for hd

sample link
mms://62.204.69.107/Storage3/demo_169_2500.wmv

Barefootsies 11-08-2009 01:39 PM

Good info.

Jimmy Gunn has some great advise as well. He knows his shit toe be sho.

Bookmarked.

:thumbsup

Pixelbucks Eric 11-08-2009 02:18 PM

bookmarking, just in case

alias 11-08-2009 02:28 PM

Quote:

Originally Posted by PowerCum (Post 16528179)
Because if you convert it properly you can gain quality and still have relatively low bitrate. Most people wouldn't bother with that, but we do.
Having a HUGE library of scenes licensed from 1998 to now has left us with lots of formats bitrates and funky crap around. We are just reencoding and normalizing everything in our content library at the moment.
Lots of amateur made content using the first digital cameras or still old Hi-8 and VHS cameras requires some extra resampling if you want to put it on a production site nowadays... even if it's a free tube with full scenes like in our case :)

Nice, thanks for the tips. I have been doing 320x240 at 900 bitrate for mobile.

TheSenator 11-08-2009 02:29 PM

Here is a Flash bitrate calculator.

http://www.adobe.com/devnet/flash/ap...tor/index.html


All times are GMT -7. The time now is 11:18 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123