Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 26-09-2017, 05:59
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Some tips on recoding videos(h264,h265, bik, bk2)

Preface:
Today, rarely anyone recode game materials, including videos. While I myself always appreciated untouched quality, I still advocated for videos(only) recoding and I do that for my own backups. The question is, is it worth it?
For at least some games I say definitely yes if you can save significant space(from 1gb up). And that can only apply if you can recode it so that it look good enough.

What would you say about this quality?:
rcmpbk2.png

^That is a screenshot of a video stretched on fullHD monitor. Its resolution is only 640x360, or 1/3rd of original resolution. Is it good enough? Now about size, its about 20% of original space, or ~80% less than original - is it good enough now for such saved space?

To give you more specific examples, my recoded video folder of Ghost Recon Wildlands is only 1.42GB size, Quantum Break videos(not the streamed ones) have around 10GB, I got them to 2GB(but I also nulled 4k ones). It is not atypical for me to see a video that originally had say 300MB to get it to like 25-35MB. An intro of game Last Day Of June had I think 160MB+? Or more, well I got it to(get ready) ~10MB. While still looking more or less like this one. Bottom line is you can save several gigs while keeping very reasonable quality of videos if you go this route.

Even better, with my tips you should be able to get approximately same quality and size ratio on all modern formats: bik, bk2, h264, h265. Older are different subject not worth bothering anymore.

Solution:
The trick is to:
- find proper resolution
- target specific bitrate instead of quality preset.

Upon many testings I found that 640x360 is the best lowest resolution before getting "too far". This resolution is exact 1/3 of 1920x1080 so even a bit less than half. It is also same ratio. Next I found that the best bitrate for this res. on any mentioned formats was 320k. This is it.

One interesting discovery I found was during recoding mentioned Last Day Of June intro. H264 vs h265. We often read how h265 is superior that it can give you much smaller size with same quality(or better quality on same size) than h264 right? This I tested once ago and found to be true, I always got better results with h265, until I tried differently with that intro video recently. You see, you do get better results if you use quality presets(crf...), but my recent discovery left me stunned:

I recoded said video into both h264 and h265 for comparison but I targeted specific bitrate(again 640x360, 320k) instead of crf preset. What I got was both videos having +- exact same size(except maybe few kb) and they look same! I honestly couldnt see a difference, there probably was some but so small you really have to look for it. It was same to me, same size and same quality. So much for h265.

With that said, I found this consistent, bink formats same good results and so on.

So my advice is:
- do recode vids if they have 2gb or more (FitGirl...^_^)
- use exact 640x360 resolution *and* 320k bitrate on *any* mentioned format
- if some of vids have a different resolution but still same ratio(1280x720 to be specific), also do the same as above
- if some videos do have other ratio or smaller resolution(be wary that many games do mix), use 320k bitrate but *keep original resolution*
- for too small size vids it may not be worth it, sometimes you may get bigger size than original(apply to 1,2-mb size vids) so compare them and use smaller!
- you can try also downsampling/capping audio to 32000Hz and on bink formats *use compression and set it to level "4" and not any other*
- if you get a crash on bk2 videos(during compression) that have mono 8bit silent sound track and no audio when played, compress them without audio
- on bink set "peek data" rate at 1.0(important)
- on bink also set preview frames to 64(max)
- use ffmpeg for h264 and h265, use HW acc. nvidia lib if you can(I do) and set its preset to "slow"
- on SW ffmpeg for h264 and h265 I dont remember exactly but I think I used presets "slowest" for h264 and "slower" for h265, I think "slower" or "slow" for both will be just fine though
- using "baseline" preset for h264 is good enough and necessary to play in WMP and default codecs(on Win 7 at least) - i use that, some games didnt output anything when WMP also cant!
- never ever use crf/quality presets, always target bitrate
- I never bother with extra settings and filters(e.g. denoise, deblock or whatever - just leave codec's default)

EDIT: Make sure you read my post #18 on this thread where I describe how to preserve multi-audio tracks of bink videos after recoding!

EDIT2: Following(constantly updated) are the currently recommended bitrates for different codecs(Resolution remain same for all: 640:-1):
- bik, bk2: 320k
- h264: 768k - 1280k
- vp8: 768k - 1280k
- vp9: 320k
- mpeg4: 1280k
- divx: 1280k
- wmv8: 1280k

- aac: 64k
- vorbis: 64k
- opus: 64k
- mp3: 96k - 128k

Last edited by elit; 11-04-2018 at 08:24.
Reply With Quote
The Following 12 Users Say Thank You to elit For This Useful Post:
1234567890123 (26-09-2017), 78372 (26-09-2017), Chayan Manna (26-09-2017), ChronoCross (09-10-2017), EzzEldin16 (22-11-2017), gozarck (09-10-2017), Gupta (26-09-2017), KaktoR (26-09-2017), knife16 (17-11-2017), oltjon (26-09-2017), pakrat2k2 (10-10-2017), Simorq (26-09-2017)
Sponsored Links
  #2  
Old 09-10-2017, 13:33
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
There is one interesting experience I want to share here.
I started playing Quantum Break for which I recoded videos. It also contain 4k versions aside of 1080 of same cinematics that I nulled(created same filenames with 0 bytes).

Interestingly, during gameplay I started noticing strange behavior, no logo intros, something felt "missing" etc. Thus I checked FitGirl version what she did. She made 4k vids exact same as 1080, which mean 2 files with exact same resolution and size. I tried it and... it worked.

I dont know why QB insist on playing some of 4k videos on my 1080 screen despite having 1080 versions of them. And what those are used for, if at all. But thats how it is. What FitGirl did was actually very clever because when you compress 2 same files with different filenames, they get deduped with srep. Compressing 2 of them result in same size as compressing one of them.

I wanted this for others to know, if a game contain 1080 and 4k videos of same content, dont rely on it using 1080 only. Rather than nulling 4k's to 0 bytes, duplicate them from 1080(preferably recoded) versions to same size and resolution as compression tools will take care of it anyway.
Reply With Quote
The Following User Says Thank You to elit For This Useful Post:
EzzEldin16 (18-11-2017)
  #3  
Old 09-10-2017, 18:19
gozarck's Avatar
gozarck gozarck is offline
Registered User
 
Join Date: Nov 2013
Location: Argentina
Posts: 162
Thanks: 253
Thanked 449 Times in 111 Posts
gozarck is on a distinguished road
Nice topic!.
check this settings to test.
just drag a video into bat file to test.
-added x265 really easy GUI. and very good results.

Kbps x Resolution table.
Recomended bitrate for each resolution.(Quality and resolution Balance).
Attached Images
File Type: png TableKBPSXRESOLUTION.png (58.3 KB, 345 views)
Attached Files
File Type: 7z GOZARCK_VideoTest_H264.7z (18.21 MB, 156 views)
File Type: 7z DivX265GUI_GOZARCK.7z (10.94 MB, 164 views)
__________________
-the science of the useless-

Last edited by gozarck; 09-10-2017 at 19:09.
Reply With Quote
The Following 9 Users Say Thank You to gozarck For This Useful Post:
78372 (09-10-2017), Chayan Manna (10-10-2017), elit (09-10-2017), EzzEldin16 (09-10-2017), felice2011 (09-10-2017), knife16 (17-11-2017), oltjon (10-10-2017), pakrat2k2 (10-10-2017), Simorq (10-10-2017)
  #4  
Old 09-10-2017, 19:15
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Thanks! Looking at .bat files I noticed high bitrate(800) and no resolution scaling, I think this was designed for movies. From your table bitrate is way too high to save space, its better then not recode at all IMO.

For games, my script is way more simple and do batch process, I just uncomment whatever I need and/or adjust existing lines:

AV_proc.zip

Last edited by elit; 09-10-2017 at 19:18.
Reply With Quote
The Following 2 Users Say Thank You to elit For This Useful Post:
gozarck (09-10-2017), Simorq (10-10-2017)
  #5  
Old 09-10-2017, 20:03
gozarck's Avatar
gozarck gozarck is offline
Registered User
 
Join Date: Nov 2013
Location: Argentina
Posts: 162
Thanks: 253
Thanked 449 Times in 111 Posts
gozarck is on a distinguished road
Yes sorry about that.
you can change bitrate in the batch file.
Check the scale now.
Quote:
@echo off
setlocal EnableDelayedExpansion

set vidIn="%~1"
set vidOut= "%~n1.avi"
set v_br=320
set a_br=128
set skl=640
Title Encoding Pass 1

mencoder.exe %vidIn% -nosub -vf scale=%skl%:-2,unsharp=l3x3:0.7 -oac mp3lame -lameopts cbr:br=%a_br% -aid 0 -ovc x264 -x264encopts bitrate=%v_br%:subq=4:bframes=2:b_pyramid=normal:w eight_b -o %vidOut%
pause
__________________
-the science of the useless-
Reply With Quote
The Following 6 Users Say Thank You to gozarck For This Useful Post:
78372 (10-10-2017), elit (10-10-2017), EzzEldin16 (09-10-2017), felice2011 (09-10-2017), oltjon (09-10-2017), Simorq (10-10-2017)
  #6  
Old 10-10-2017, 06:33
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Thanks again, thats much better indeed. Your extra parameters made me look into them for research. Normally, I never like filters and prefer raw process(I also dont like anti-aliasing in games or extra bass/treble adjustments in music so I am this type of guy), but this depend on person and I think some of your parameters provide good results without overdoing things. Lets get through them 1 by 1 for others to learn:

-nosub, I believe this disable subtitles, this have nothing to do with games and if does should probably be avoided

-unsharp, here is nice video showing its effect(I dont know why it mangle youtube links, you need to replace bad characters or search the final string):
w w w(dot)y o u t u b e (dot) c o m / ?v=QbaPLEcTR1k

Since you only use very mild 0.7, this should provide nice results without worsening image. I will definitely try it next time.

-for audio output, you should use default game's codec which is most of the time AAC or ogg, which are way better than "lame". More important, with those you can go to low 64k bitrate with almost no noticeable difference to further save space:
w w w(dot)y o u t u b e (dot) c o m / ?v=xbw3ItwCrv8

-subq, this is like optimization to speedup process at the cost of quality(read about it here: https://sites.google.com/site/linuxe...ffmpeg-mapping).
This could be handy for CPU encoding, your value "4" is lower than default 6 which provide better quality. I havent seen difference personally but it is worth trying to save time on CPU encoding. For nvenc its not needed IMO to compromise quality because HW encoding is already extremely quick.

-bframes, this option dictate compression efficiency and speed especially with some other options together(vis. link above again for reference and also this: http://www.digital-digest.com/articl...ons_page4.html)
For HW enc. again I see no importance, default should be better but for CPU maybe, however if it is like anything similar to "p" option on bink, on that one setting to its maximum "64" had no speed difference on my computer and max = best quality, so I am not sure about this one.

Last edited by pakrat2k2; 10-10-2017 at 09:44. Reason: Fix Youtube links
Reply With Quote
The Following 3 Users Say Thank You to elit For This Useful Post:
EzzEldin16 (18-11-2017), gozarck (10-10-2017), Simorq (10-10-2017)
  #7  
Old 10-10-2017, 09:37
pakrat2k2's Avatar
pakrat2k2 pakrat2k2 is offline
Moderator
 
Join Date: Apr 2005
Location: Canada
Posts: 7,215
Thanks: 2,924
Thanked 8,638 Times in 3,029 Posts
pakrat2k2 is on a distinguished road
elit to work around youtube , add a space between every letter and for . use (dot)

IE: w w w(dot) y o u t u b e (dot) c o m / ?v=QbaPLEcTR1k

you don't need the https it will lead to same video.

Last edited by pakrat2k2; 10-10-2017 at 09:45.
Reply With Quote
The Following User Says Thank You to pakrat2k2 For This Useful Post:
elit (10-10-2017)
  #8  
Old 11-10-2017, 15:39
Kitsune1982's Avatar
Kitsune1982 Kitsune1982 is offline
Registered User
 
Join Date: Jun 2011
Location: USA
Posts: 65
Thanks: 0
Thanked 53 Times in 25 Posts
Kitsune1982 is on a distinguished road
re: Some tips on recoding videos(h264,h265, bik, bk2)

hey guys, i followed elit and gozarcks tips on recoding and i achieved some amazing results with Syberia 1 for pc. the initial bik folder was 665 mb but after recoding them using the tips in the thread, i got it down to 455 mb for all the video files. heres the pics of what it looks like

Thanks so much Elit and gozarck for the helpful advice, now i can make my encodes smaller and not have the videos look awful d^^b

-Kitsune
Attached Files
File Type: 7z Syberia HD Bink Encode Screenshots.7z (1.33 MB, 67 views)
Reply With Quote
The Following 3 Users Say Thank You to Kitsune1982 For This Useful Post:
elit (04-02-2019), gozarck (12-10-2017), Simorq (12-10-2017)
  #9  
Old 11-10-2017, 17:42
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Glad it was helpful. And one more thing for everyone:
If you use "baseline" profile for h264(which is what I recommend unless you go with your own codecs - as explained in the 1st post), you cannot use bframes. Those are not supported in basic profile.
Reply With Quote
The Following 3 Users Say Thank You to elit For This Useful Post:
gozarck (12-10-2017), pakrat2k2 (12-10-2017), Simorq (12-10-2017)
  #10  
Old 17-11-2017, 09:38
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
I just compressed vp9 video from the game Syrian Warfare, from its original 1920x1080 to 640x360(and 320k bitrate). I got it from its original 160mb to... wait for it... 6mb. Here are the pics for comparison:

Original:
160mb.jpg

Recoded:
6mb.jpg

For those interested, ffmpeg string was simple(no filters etc.):
ffmpeg -i input -c:a copy -c:v libvpx-vp9 -b:v 320k -vf scale=640:-1 output
Thats it.

Last edited by elit; 17-11-2017 at 09:40.
Reply With Quote
The Following 2 Users Say Thank You to elit For This Useful Post:
felice2011 (17-11-2017), KaktoR (17-11-2017)
  #11  
Old 17-11-2017, 09:45
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 2,614
Thanks: 660
Thanked 3,790 Times in 1,366 Posts
KaktoR is on a distinguished road
Practically no difference in image quality, just a little bit ghosting.

Good job
__________________
Haters gonna hate
RIP GOD
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
elit (18-11-2017)
  #12  
Old 17-11-2017, 14:30
felice2011's Avatar
felice2011 felice2011 is offline
Registered User
 
Join Date: Feb 2011
Location: italy
Posts: 801
Thanks: 332
Thanked 1,033 Times in 362 Posts
felice2011 is on a distinguished road
@elit, You can improve it with eq to optimize, bitrate is too low.

in free time I am working on a new video encoding, with basic configurations optimized in comparison to Handbrake, and with the most common filters of Avidemux...all based on ffmpeg.











if I have time to finish it, for those who are interested will be posted.
__________________
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
I Mediocri Imitano, I Geni Copiano, Dio Crea & Distrugge (Io Ridefinisco & Perfeziono le Loro Opere Rendendole Uniche)
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Mediocrities Imitate, Genius Copy, God Creates & Destroys (I Reconsider & Improve Their Works, Rending Them One And Only)
Reply With Quote
The Following 6 Users Say Thank You to felice2011 For This Useful Post:
1234567890123 (18-11-2017), elit (18-11-2017), gozarck (17-11-2017), knife16 (17-11-2017), oltjon (18-11-2017), Simorq (17-11-2017)
  #13  
Old 18-11-2017, 04:50
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Thank you Felice looks great! Pls make sure you implement batch processing as well! I believe there is already xmediarecode frontend to ffmpeg which is quite complex but its always good to have options. Also UI kept freezing for me on that one so if your app have options I need and doesnt give problems I would definitely love to use it instead of command line.

Now as for me, I am against filters, they dont improve anything universally. They improve specific scenes while introducing artifacts to others. They dont operate on context and will never understand underlying content of the video. They can probably be useful if you process already lower quality videos especially with artifacts in it, but for scaling from HQ to LQ it doesnt make much sense to bloat encoder with filters since you can only do so much to universally improve pixel scaler.

I prefer clean, classic pixel scaling to appropriate bitrate and as low as possible to save space until its still bearable. I found 320k to 640x360 res. perfect and universal among different modern codecs(bik, bk2, h264, h265, vp9,...). I want to see at least 3x-4x of saved space and sometimes like above I got in several 10ths to 1. When I tried higher bitrate on multiple sources, I had to go significantly higher to register noticeable improvement but then size started to almost double. Also when lowering it further, drop in quality and especially pixelation became noticeable.

For 640x360 resolution, 320k is just enough, 1920x1080 have 9x more pixels to process so to compare it 9x 320k bitrate mean 320k bitrate for 640x360 res. would be equivalent to 2880k bitrate for 1920x1080. Which, I think we agree should be more than enough.

Last edited by elit; 18-11-2017 at 04:54.
Reply With Quote
The Following 2 Users Say Thank You to elit For This Useful Post:
1234567890123 (18-11-2017), felice2011 (18-11-2017)
  #14  
Old 18-11-2017, 08:43
felice2011's Avatar
felice2011 felice2011 is offline
Registered User
 
Join Date: Feb 2011
Location: italy
Posts: 801
Thanks: 332
Thanked 1,033 Times in 362 Posts
felice2011 is on a distinguished road
As always my programs always try to satisfy a wide range of users, as you say if the resource is clean, it is already of high quality, filters can exclude them, although sometimes a magic touch always serves, even with resources high quality of encoding to obtain smaller sizes, with similar but never identical qualities.

I do not recommend mathematical use for a precise bitrate calculation (9 x 320k = 2880), because it does not exist.

The same thing with the use of the centesimal rule: in practice to get the bitrate multiplies X height X width and divided by 100. example: (640x288/100 = 1843 kbit/sec).

Or the basic bitrate formula is :

(Size - (Audio x Length )) / Length = Video bitrate
L = Lenght of the whole movie in seconds
S = Size you like to use in KB (700 MB x 1024 = 716 800 KB)
A = Audio bitrate in KB/s (224 kbit/s = 224 / 8 = 28 KB/s)
V = Video bitrate in KB/s, to get kbit/s multiply with 8.

8 bit = 1 byte.
1024 = 1 kb

Example
90 minutes video, L = 90x60 = 5.400 seconds
700 MB CD but be sure that if fits use a bit lower like 695 MB, S = 695x1024 = 711.680 KB
Audio bitrate, A = 224 kbit/s / 8 = 28 KB/s

(711.680 - (5400x28)) / 5400 = 104 KB/s x 8 = 830 kbit/s.

The only way to obtain a good (size/quality) compromise is to start from a theoretical point of reference, to a practical result, performed out by several different tests.
__________________
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
I Mediocri Imitano, I Geni Copiano, Dio Crea & Distrugge (Io Ridefinisco & Perfeziono le Loro Opere Rendendole Uniche)
≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈ ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Mediocrities Imitate, Genius Copy, God Creates & Destroys (I Reconsider & Improve Their Works, Rending Them One And Only)
Reply With Quote
The Following 2 Users Say Thank You to felice2011 For This Useful Post:
elit (18-11-2017), knife16 (19-11-2017)
  #15  
Old 18-11-2017, 11:28
elit elit is offline
Registered User
 
Join Date: Jun 2017
Location: sun
Posts: 169
Thanks: 124
Thanked 245 Times in 86 Posts
elit is on a distinguished road
Thank you Felice, but your calculation above address very different purpose. To clarify, your calculation above is about getting best possible quality for certain length of video while still fitting specific medium format. In other words, targeted size is a known constant and bitrate is calculated to get most of that size.

On the contrary when repacking game videos, targeted size is a variable and objective is to get it as low as possible. Therefore its about quality vs size, not about bitrate for certain known size. And for that, you absolutely have to consider resolution which in turn must be selected based on targeted display resolutions. Specifically, my 640x360 is exact 1/3 of 1920x1080(for which it was chosen) in terms of W and H and its exact division. It will still look ok as it is closer to 1/2 res., whereas 1/4 res for example was already too low in my tests(regardless of bitrate/quality). So pixels do matter here. You want to get as low resolution and bitrate as possible to save as much space as possible, while compromising on quality as little as possible.

I agree there is not mathematically standard bitrate and it also depend on the codec, I referred to 2880 as "enough" in scale ratio because for all modern codecs if you check various original FullHD game videos they almost never have significantly more than that. 2880 was referred only as an example for being "enough" for majority of FullHD content out there(in games).

Last edited by elit; 18-11-2017 at 11:31.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tips for Diner Dash AnyavanS1261994 General Gaming 1 01-07-2007 13:27
Newbie needs tips on correct media deerayrose CD/DVD Recordable Media 8 29-02-2004 14:36
Installation Tips TylerDurden PS2 Games 0 03-01-2004 13:52
Soldering tips seaneyb2003 PSX Games 16 30-11-2003 00:39
messhia tips needed squatcher PS2 Games 7 25-03-2002 14:28



All times are GMT -7. The time now is 22:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2000-2018, FileForums @ https://fileforums.com