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

Re: Efficient Video Encoding

Post by kell42 »

Jupiter wrote: 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.
That's fair, and I certainly didn't mean this thread to imply that the rest of us have any right to dictate how CH creators should work.

However, there have been quite a few CH videos posted that are huge, despite being made up of videos that are not especially high-quality. Perhaps that was an intentional decision on the part of the author, but I think it's more plausible that there are some CH creators who simply don't know much about video compression.

The whole point of this is to give those people a resource on the subject, and I think that's a goal at which we've succeeded admirably.
BozoJoe
Curious Newbie
Curious Newbie
Posts: 1
Joined: Tue Nov 12, 2013 4:30 pm

Re: Efficient Video Encoding

Post by BozoJoe »

Thanks to the above posters, this is really useful information. I have a question.

Most of the advice posted refers to recoding a video, so what should creators be using as their benchmark for encoding settings? I am pretty ignorant of video compression but I have made a few videos in Adobe Premiere (just compilations and stuff, no CH... not yet anyway!) and I am often not sure what kind of settings I should use.

If I wish to create a project, I usually use the bitrate of the highest quality video I used within that project. But as for the encoder, I never know which one is most efficient/fastest/best quality or anything like that.

Any tips for the parameters to use at the beginning of the process would be really handy. 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 »

Jupiter wrote: 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.
No offense but if someone spend days or even weeks with creating a cock hero video the persone can leave the computer 4 hours up and running at least 1 last time in the end of the project. You go to the store and the gym and the the time while you are home it is finished. :)

And kell42 tested only with RF20. With RF22 the quality may slightly differs but the size should go down more.
But if you have real concerns with time you can always try to lower the settings:
rc_lookahead: 60 -> 42
Max B-Frames 16 -> 8
Motion Estimation Range: 32 -> 24
Partition Type: all -> “most” (default)
Subpixel ME & Mode Decision: 10 -> 9

You don't need to apply all of them, and they priority is from up to bottom. So first you should try rc_lookahead.
BozoJoe wrote:Thanks to the above posters, this is really useful information. I have a question.

Most of the advice posted refers to recoding a video, so what should creators be using as their benchmark for encoding settings?
Using the highest available can't be wrong. After you finished I suggest to make a short mini compilation of your video. Take out the parts where there is a lot of movement, originally pixelerated parts, and most HD parts. Very light and very dark parts, etc. 3-5 minutes is more then enough and you shouldn't care about sound cuts here. Try to encode the video with different RF settings to find the highest you are happy with. After that encode the whole video with this settings.
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 »

Eriol wrote:
Jupiter wrote: 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.
No offense but if someone spend days or even weeks with creating a cock hero video the persone can leave the computer 4 hours up and running at least 1 last time in the end of the project. You go to the store and the gym and the the time while you are home it is finished. :)
No I actually literally can't. As mentioned above, I work from a laptop. When I close it it stops most of the processes to save electricity. It only takes my computer about 30 mins to export a 30 min video, and only a little bit longer to distribute the torrent to a few people. I typically only get an hour of free time for this type of work.
binder71
Explorer
Explorer
Posts: 16
Joined: Sun Jul 24, 2011 10:08 am

Re: Efficient Video Encoding

Post by binder71 »

Hi all, :wave:

I installed the app, but could not find where to set the recommended settings into the UI Interface. Would be great if anybody can help me and share some screenshots here with the settings to applied on the different tabs :-)

thanks in advace
User avatar
doremi
Experimentor
Experimentor
Posts: 1207
Joined: Sat Apr 23, 2016 11:09 pm
Gender: Male
Sexual Orientation: Straight
Contact:

Re: Efficient Video Encoding

Post by doremi »

binder71 wrote: Sun Apr 24, 2022 11:20 am I installed the app, but could not find where to set the recommended settings into the UI Interface.
Are you talking about HandBrake, binder71? If so, it has had several versions since that thread, and options may have been renamed or moved elsewhere. Their options a pretty good by default. You just need to adjust a few of them for maximum efficiency. Check out my signature for more details.
:-)
[APP] Cock Hero Slideshow Player - Thinking about a script feature for [APP] Cock Hero Video Player :icecream:
If your video is too fat, there's a solution!
Spoiler: show
The generated output of your video editor may be bloated, too big for not any significant benefit. One thing you can do is use HANDBRAKE with the H.264 (x264), RF18 Constant Quality and Web Optimized / Fast Start options, all other options by default. You'd be surprised how smaller the video becomes, without any impact to the quality.
:yes:

LINKS:

HandBrake, The open source video transcoder
https://handbrake.fr/

For future reference, here's the original Hanbrake post by Eriol:
viewtopic.php?f=25&t=12815&hilit=Handbrake#p164242
Interesting for further details about the process.
:thumbsup:
So many projects to kill, so little time. :-)
binder71
Explorer
Explorer
Posts: 16
Joined: Sun Jul 24, 2011 10:08 am

Re: Efficient Video Encoding

Post by binder71 »

Yes talking about handbreak and having new version 1.5.1.
Are you setting the values via the UI or through shell commands?
Would be great if you can share screeners from UI, where those settings are located.
User avatar
47dahc
Explorer At Heart
Explorer At Heart
Posts: 286
Joined: Mon Aug 03, 2020 1:43 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: Efficient Video Encoding

Post by 47dahc »

doremi wrote: Sun Apr 24, 2022 4:41 pm Check out my signature for more details.
:-)
Been using Handbrake for a minute and have built many presets and have one of those set as my default right now and don't remember which stock preset was the default when HB was originally installed. Curious what stock preset to use with your signature settings since all the stock presets have different settings. Using Handbrake 1.5.1?
Creator of MetroVerter The Metronome to Tcode converter
My Guide on How to create and mix estim surround videos
My guide on Setup TeaseAI - Awakening with Restim
User avatar
LondonGent
Explorer At Heart
Explorer At Heart
Posts: 280
Joined: Fri Jul 31, 2020 9:47 am

Re: Efficient Video Encoding

Post by LondonGent »

Disappointed to see that this thread doesn't mention FFMPEG yet.

It's a free command line program (which Handbrake is actually built on top of) but if you're not scared of the command line it's by far the simplest and most powerful option.

If you've got an NVIDIA graphics card, they have a very capable video encoder built in to them that is massively faster than using your CPU to do the same thing.

This is a good starting point for anyone giving it a try:

Code: Select all

FFMPEG.exe -y -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid -i "c:\pathto\input.mp4" -c:v hevc_nvenc -cq 28 -rc:v vbr -b:v 5M "c:\pathto\output.mp4"
  • "-hwaccel cuda -hwaccel_output_format cuda" tells FFMPEG to use your GPU instead of CPU.
  • "-c:v h264_cuvid" is the encoding of the input video (in this case h264, which is the standard for most mp4 videos)
  • "-i "c:\pathto\input.mp4" " is the source video you want to reencode (adjust accordingly)
  • "-c:v hevc_nvenc" is the encoding you want for the output (in this case h265 aka hevc, a more modern codec that reduces file sizes). Use h264_nvenc if you want to keep it in h264 for compatibility reasons.
  • "-cq 28 -rc:v vbr -b:v 5M" tells the encoder to use constant quality variable bit-rate encoding. This makes a huge difference to both size and quality - it allows the frames that need it to have a large file size, then makes up the difference by using small filesizes when the video doesn't need it. Replace the 28 with a smaller number for higher quality or a larger number for a smaller file.
  • " "c:\pathto\output.mp4" " is what you want the reencoded video to be called.
You can even run it on every video in a folder by wrapping the whole thing in a for loop like this:

Code: Select all

FOR %f IN (*.mp4) DO ffmpeg.exe -y -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid -i "%~f" -c:v hevc_nvenc -cq 28 -rc:v vbr -b:v 5M "%~nf_h265%~xf"
User avatar
doremi
Experimentor
Experimentor
Posts: 1207
Joined: Sat Apr 23, 2016 11:09 pm
Gender: Male
Sexual Orientation: Straight
Contact:

Re: Efficient Video Encoding

Post by doremi »

47dahc wrote: Fri Sep 02, 2022 6:16 pm Been using Handbrake for a minute and have built many presets and have one of those set as my default right now and don't remember which stock preset was the default when HB was originally installed.
My inclination would be to use the default settings of the actual version you are using, then change the specific options mentioned. Defaut settings may change over different HandBrake versions, but I guess the developers did that for a reason. And for more details about specific settings, I recommend Eriol's post linked in my signature.
:smile:
[APP] Cock Hero Slideshow Player - Thinking about a script feature for [APP] Cock Hero Video Player :icecream:
If your video is too fat, there's a solution!
Spoiler: show
The generated output of your video editor may be bloated, too big for not any significant benefit. One thing you can do is use HANDBRAKE with the H.264 (x264), RF18 Constant Quality and Web Optimized / Fast Start options, all other options by default. You'd be surprised how smaller the video becomes, without any impact to the quality.
:yes:

LINKS:

HandBrake, The open source video transcoder
https://handbrake.fr/

For future reference, here's the original Hanbrake post by Eriol:
viewtopic.php?f=25&t=12815&hilit=Handbrake#p164242
Interesting for further details about the process.
:thumbsup:
So many projects to kill, so little time. :-)
Post Reply