Efficient Video Encoding

Discussion about Cock Hero and other sexy videos.

Moderator: andyp

User avatar
kell42
Explorer
Explorer
Posts: 35
Joined: Wed Sep 07, 2011 8:42 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Efficient Video Encoding

Post by kell42 »

Disclaimer: This has the potential to be a touchy subject, as it could easily be taken as criticism of the work done by many of the contributors to the Cock Hero genre.

That is not my intention. I've messed around with video editing enough to know that producing the kind of work we see here is, in large part, labor-intensive, repetitive drudgery. As such, those of you who have the patience for that sort of work deserve gratitude and respect from the rest of us.


That said, let's get to the point. I've just finished re-encoding all of my CH videos, with an average reduction in size of 52%! (Total size of my collection was ~250gb, now it's ~120gb.) With a few exceptions, this has been accomplished with no reduction in quality that I can detect (as shown on a 24" 1080p monitor.)

This suggest to me that we could benefit from a discussion of how to efficiently encode videos, and perhaps establish some voluntary standards to streamline the submission and distribution of new CH videos.

I've only been exploring the subject for a couple of weeks, and I am by no means an expert, but here is some introductory material that I've found helpful.

Basic Overview
Spoiler: show
http://www.slideshare.net/vcodex/introd ... n-13394338
Detailed but Accessible Guide for Efficient Compression
Spoiler: show
http://ericolon.wordpress.com/2013/01/0 ... ny-device/
There are plenty of free programs that do an excellent job of transcoding and compressing video files. I'd recommend these two:

Handbrake (available for PC, Mac, and Linux)
http://handbrake.fr/downloads.php

Format Factory (PC Only)
http://www.pcfreetime.com/

If this generates any interest, I'll post my suggestions for a CH encoding standard, as well as anything else I learn about techniques and/or process.

Thoughts?
User avatar
alchemi183
Explorer At Heart
Explorer At Heart
Posts: 548
Joined: Mon Jan 25, 2010 10:15 am
Gender: Male
Sexual Orientation: Straight
Location: Rocky Mountains

Re: Efficient Video Encoding

Post by alchemi183 »

I'm all for what you're proposing, as long as I wouldn't lose much quality. I will always prefer quality over small file sizes. The reason? Hard disk space is VERY cheap. My last hard drive was 3 TB and cost $120 (USD).

You say that you saved 130 GB of space by reencoding all of your Cock Hero videos. By my calculations, 130 GB of hard drive space costs $5.20. How much time did you spend on it? Is the time you spent on it worth more than $5.20?
User avatar
kell42
Explorer
Explorer
Posts: 35
Joined: Wed Sep 07, 2011 8:42 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Efficient Video Encoding

Post by kell42 »

It's hard to say how much time I spent, since this was part of a larger project that has entailed re-encoding all of my video files. (Total time invested in the project has been about a month, and I've freed up slightly more than 4 TB.)

No question that storage costs are pretty minimal, but there are other advantages to smaller files.

b) It's a lot easier to distribute smaller files. Some people are almost certainly subject to monthly bandwidth caps, or simply live in areas with poor or nonexistent broadband. (I live/work in Afghanistan for about 4 months in 5, and I'm lucky if my download speeds break 5kb/s.)

a) Messing around with multiple external drives is a pain in the butt. I've got a desktop with a total of 12 TB storage space (4 x 3TB drives.) Before I started my re-encoding, I was almost out of space, with no room for expansion, as all the SATA channels on my motherboard are in use. The space I've freed up should last until it's time to build a new computer.

I also think that in many cases, it should be possible to produce smaller files with no loss of quality. Video compression algorithms have improved tremendously since the dawn of internet porn, and a lot of older material could benefit tremendously from re-encoding.
CruelNyx
Explorer
Explorer
Posts: 15
Joined: Mon Nov 04, 2013 2:46 pm

Re: Efficient Video Encoding

Post by CruelNyx »

Dear slaves,

I have one slave who is skilled in the matter and does some computer work for me. I will tell him to give you an advice, since I hate bad quality videos too.

CruelNyx
CruelNyx
Explorer
Explorer
Posts: 15
Joined: Mon Nov 04, 2013 2:46 pm

Re: Efficient Video Encoding

Post by CruelNyx »

Dear slaves,

My slave says the following:

"To obtain the best video quality (form very good original source) one need to use two rules:

1. Use the best quality encoders with their best setup. The best video encoder is x.264 (http://www.videolan.org/developers/x264.html). Combine it with the best sound encoder Opus (http://www.opus-codec.org/downloads/).

Bothe can be downloaded for free.

Use the best settings for both encoders. For the sound use q=6 or around 160kb/s. This combines best quality with minimum size. If encoding music videos, use of course, higher quality.

For the video use maximum quality (custom line parameters):

-----------
cabac=1 / ref=8 / deblock=1:-2:-2 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=0.2:0.0 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-1 / threads=3 / sliced_threads=0 / slices=2 / nr=0 / decimate=0 / mbaff=0 / constrained_intra=0 / bframes=6 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=42 / rc_lookahead=42 / rc=2pass / mbtree=1 / bitrate=1933 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
------------


2.For the optimum size of the video use 1548MB (1.5GB) for 1 hour video.

And don't forget to use MKV container.

Good luck!"

I told you. My slave is skilled.

CruelNyx
User avatar
jackstock
Explorer At Heart
Explorer At Heart
Posts: 711
Joined: Sat Apr 28, 2012 1:05 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above
Location: Canada

Re: Efficient Video Encoding

Post by jackstock »

alchemi183 wrote:You say that you saved 130 GB of space by reencoding all of your Cock Hero videos. By my calculations, 130 GB of hard drive space costs $5.20. How much time did you spend on it? Is the time you spent on it worth more than $5.20?
Some people have slow or capped internet connections though
User avatar
alchemi183
Explorer At Heart
Explorer At Heart
Posts: 548
Joined: Mon Jan 25, 2010 10:15 am
Gender: Male
Sexual Orientation: Straight
Location: Rocky Mountains

Re: Efficient Video Encoding

Post by alchemi183 »

kell42 wrote: If this generates any interest, I'll post my suggestions for a CH encoding standard, as well as anything else I learn about techniques and/or process.
I'm interested in your preferred handbrake settings. Something along the lines of YIFY's settings for 1080p encoding would be good to know.
CruelNyx wrote:The best video encoder is x.264 (http://www.videolan.org/developers/x264.html).
I think that's good advice. I always prefer x.264 encoded video when available.
Last edited by alchemi183 on Wed Nov 13, 2013 2:12 am, edited 1 time in total.
User avatar
kell42
Explorer
Explorer
Posts: 35
Joined: Wed Sep 07, 2011 8:42 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Efficient Video Encoding

Post by kell42 »

Alchemi,

My results with Handbrake have been less than spectacular. There's a configuration file in the first info link I posted that does work well, but it's computationally intensive to the extent that I wouldn't want to use it without a computer dedicated to re-encoding. (I'm running a liquid cooled, overclocked i7-3770K, and encoding with this setting seems to average about 10 hours of number-crunching for every hour of video output.)

The other program I mentioned, Format Factory, seems to produce results that are almost as good, in a much more reasonable time frame.

Unfortunately, it relies a lot more heavily on presets, so I can't give you anywhere near the sort of detail on its settings that I could with Handbrake. That said, here are a couple of screenshots of the configuration I've been using.

Image

Image

***Important Note: If you use Format Factory in multi-thread mode, it will encode faster, but it will also use all of your computer's processing power, to the extent that it will be unusable for anything else.

awesomex,

I have all of your videos (which are fantastic, btw.)

Their current file sizes are:

AwesomeX Edition - 904 MB
AwesomeX Cum Hard Edition - 713 MB
AwesomeX Cum Harder Edition - 1010 MB
AwesomeX Cum Hard With a Vengeance - 673 MB
AwesomeX Fantasy Edition - 681 MB

I used the settings in the screenshots above for all of them, so H.264 codec with CBR encoding, 24 fps, and MP4 container.
User avatar
alchemi183
Explorer At Heart
Explorer At Heart
Posts: 548
Joined: Mon Jan 25, 2010 10:15 am
Gender: Male
Sexual Orientation: Straight
Location: Rocky Mountains

Re: Efficient Video Encoding

Post by alchemi183 »

Great info. Thanks!
Eriol
Explorer
Explorer
Posts: 31
Joined: Fri Dec 07, 2012 10:01 am
Gender: Male
Sexual Orientation: Straight

Re: Efficient Video Encoding

Post by Eriol »

Hello everybody,

I have some video encoding experience and I can understand that CruelNyx's command line parametering a little to much for anyone. But working with CBR bitrate in video encoding is just not efficient (no offense). If you have already have some experience in Handbreak I would suggest you guys this easy and good tutorial for Handbreak 0.9.9:
http://mattgadient.com/2013/06/12/a-bes ... ake-0-9-9/

You only need to configure a few setting and use a slider to setup the quality. And there are a few more, deeper explanation in the site as well if you interested in more. And encoding by this settings does not take half a day. :)

Give it a try and if you like it, have a bonus round! ;)
User avatar
Venus
Explorer At Heart
Explorer At Heart
Posts: 358
Joined: Tue Jul 03, 2012 1:28 pm
Location: Germany

Re: Efficient Video Encoding

Post by Venus »

Interesting topic, since I spent a lot time for encoding Infinite Desire 2 to get a small video size with excellent quality.
However your results outclass mine. I got a file size of 2 GB for 1 hour video. You achieved 1.13 GB for 1 hour video. That's hard to believe :-O
Furthermore are you sure the settings in the screen you posted are correct? It says the bitrate is 1.5 MB/s. That would lead to a file size of 5.4 GB for 1 hour video. Maybe I miss something...
I'm curious and will test it myself.

*EDIT*

I tested it. It took 30 minutes to re-encode Infinite Desire 2 and the new file size was 700 MB. How can that be? Answer: there's a "bug"/"typo" in the program. The bitrate of 1536 KB/s is actually 1536 kbit/s. That's a huge difference and explains the good file size. Unfortunately a lower bitrate means lower quality. In my opinion the quality loss is immense. The picture itself isn't as clear and sharp as before. The most impact has been the switch from 60 fps to 24 fps. The video doesn't look to run "smooth" anymore. Especially the beatbar stutters a bit. When the camera movement or the motion in the clip gets faster you can recognize it clearly that there are frames missing.

I will stick to my original render settings. In my opinion 2 GB for 1 hour video is a good trade-off between file size and quality. My priority here is good hd quality rather than very small file size.
Cock Hero - Overwatch 3 is out! viewtopic.php?f=25&t=22817
Eriol
Explorer
Explorer
Posts: 31
Joined: Fri Dec 07, 2012 10:01 am
Gender: Male
Sexual Orientation: Straight

Re: Efficient Video Encoding

Post by Eriol »

@Venus: if you want smaller size with same quality it is not just about bitrate. x264 has a lot of good encoding option for archive smaller size with the same quality, but it require more encoding time.
Furthermore you don't really need exactly precalculated file sizes in cock hero projects because quality is prior over size. So I recommend using RF instead of average bitrate. RF can calculates required bitrate better and more freely so the result will be much more size-quality optimal.

I run through CruelNyx's parameters and they are pretty good indeed (you may pat your slave). However I would recommend some plus quality here and there exchange for time:

bframes=6 -> 16
direct=1 -> auto
subme=9 -> 10
analyse=0x3:0x113 -> all
deblock=1:-2:-2 -> -1:-1 (imho better for us here)
rc_lookahead=42 -> 60

He gives a lot of parameters with default values, you don't need to set those in Handbreak.
There is a few gray area in my knowledge so I don't know the benefits of these parameters:
chroma_qp_offset=-1
slices=2
wpredb=1
wpredp=2
threads=3
sliced_threads=0
@CruelNyx : if your slave could help us understand why these are good for use, pls share.

Some forum pointed out that deadzone is incompatible with trellis so it is not recommended. qpmin>0 is discouraged if adaptive quantization is enabled.

psy_rd is an interesting parameter, default for films is 1.0:0.0. It does not change image quality but human-eye-friendliness. Frankly I don't know the benefits to go with 0.2:0.0 but one can give it a try if it looks better for the actual video or not.

If the setting above is fast enough in your CPU you may try changing these settings to gain some hdd space:
merange= up to 64.
fast_pskip=0 has negligible effect but one can give it a try.

Based on these settings I made a screenshot for you, how to configure HandBreak:
Image

You need to insert the yellow marked options manually. Moreover you need to set in Picture tab, Anamorphic to Strict and Filters tab Detelecine: Default and Decomb: Default. After that you can save these setting as a preset if you don't want to lose it.

These options must be enough for encoding cock hero projects. For image quality you need the Video tab and select Constant Quality. Here you can play with the RF value, the smaller value results better quality. A good base is around 21-20. Use a small segment of your video to determine the required picture quality. If you need superior quality go for 20-18 (or if the source is SD quality). If your project's filesize is to large, go around 23-21 (or if you have HD quality source).

One more thing: use the source videos if available not your finished project videos. Encoding something hardly gives the same picture quality so using the source can result better quality-size ratio then encoding a finished cock hero video again.
User avatar
kell42
Explorer
Explorer
Posts: 35
Joined: Wed Sep 07, 2011 8:42 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Efficient Video Encoding

Post by kell42 »

Ok, just finished re-encoding Heavenly Bodies 2 with handbrake, using the settings posted by Eriol, with a constant quality RF of 20. Went from a file size of 1.87 GB, to 1.35 GB, with no loss of quality that I can discern. Total encoding time was slightly more than 4 hours.

Here are screenshots of the original, and the re-encoded version. Both were taken with VLC maximized (but not full-screen) on a 24" 1080p monitor, and then cropped to remove the taskbar.

Original
Image

Re-encode
Image
User avatar
Venus
Explorer At Heart
Explorer At Heart
Posts: 358
Joined: Tue Jul 03, 2012 1:28 pm
Location: Germany

Re: Efficient Video Encoding

Post by Venus »

Yeah 1.35 GB sounds reasonable for this Video.
My formula for good HD Video encoding in 720p is 500 MB for 15 minutes.
CH HB 2 has a duration of ~38 min so 1.27 GB would be optimal regarding my formula. Therefore 1.35 GB is very good.

I use XMedia Recode to encode video files. For Infinite Desire 2 I exported a loss-less video at first which was several hundred GB big and then encoded it with XMedia Recode. The final result was a file with a duration of 58.5 minutes and a size of 1.95 GB (that's exactly 500 MB for 15 minutes). I don't know how good it is at re-encoding. If I re-encode a file it is usually a .mkv to .mp4 because my video editing tool can't handle .mkv and there I don't notice a quality loss.

I tested HB 2 and got this result:

Re-encode (XMedia Recode)
Image

The new file Size is 1.22 GB. The re-encoding process took 45 minutes on my machine. The quality looks like the same (or a little bit worse, since the file is smaller). I only adjusted the bit rate and used standard settings, so I think that it might be possible to achieve better results when tweaking the other settings.
Cock Hero - Overwatch 3 is out! viewtopic.php?f=25&t=22817
User avatar
Jupiter
Explorer At Heart
Explorer At Heart
Posts: 128
Joined: Wed Jul 17, 2013 5:37 pm
Location: Space

Re: Efficient Video Encoding

Post by Jupiter »

kell42 wrote:Ok, just finished re-encoding Heavenly Bodies 2 with handbrake, using the settings posted by Eriol, with a constant quality RF of 20. Went from a file size of 1.87 GB, to 1.35 GB, with no loss of quality that I can discern. Total encoding time was slightly more than 4 hours.
Though I can see the appeal to smaller file size, I don't typically leave my computer on for a solid 4 hours (laptop). Saving roughly half a gig would take me ~4 extra hours to prepare the video, but only makes about a 20-30 minute difference when distributing the torrent. For incredibly large files (like the big megapacks on Emp) using this is a good idea. A series of videos that would have been ~100GB was reduced to about 70 using handbrake. The point is this really isn't worth the average user's time. I delete most things thing after a few views. If you're going to keep a mountain of porn on your computer then it's a very useful program.
Post Reply

Who is online

Users browsing this forum: Ggsauces and 85 guests