Widescreen Gaming Forum

[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
Last visit was: less than a minute ago It is currently 20 Apr 2021, 20:22

All times are UTC [ DST ]




 [ 107 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next
Author Message
PostPosted: 20 Jan 2009, 01:18 
Offline
Insiders
Insiders
User avatar

Joined: 14 Apr 2007, 02:13
Posts: 1514
I've never used Avidemux so I don't know how it works or what audio/video sync. issues you might have. I also don't use Vegas so I can't help you out there.

I do all of my video stuff with Avisynth (with various effects), x264, neroaacenc, mplayer (sometimes) and VirtualDub.

_________________
Widescreen Fixer - https://www.widescreenfixer.org/

Widescreen Fixer Twitter - https://twitter.com/widescreenfixer
Personal Twitter - https://twitter.com/davidrudie


Top
  
 


PostPosted: 20 Jan 2009, 10:24 
Offline
Editors
Editors
User avatar

Joined: 31 Jul 2006, 14:58
Posts: 1497
I may have to give megui or x264 another shot see if they can work with my plugin or fix the issues I have.

Got HandBrake today!

Wonderfull so far. I had issues with it at first, the video did not have speed issues, audio was in sync but I had some jerkyness or pause in the video usually right when some very fast panning motion was going to happen.

I read up on it in there wiki and they said to fix the frame rate isntead of use same as source, Its supposed to only effect mixed frame rate content but did that and cranked up the B Pyramid number, Motion Estimation numbers, and a few other things and it looks like it resolved it.

HandBrake is not neary as good at giving a max quality file at a low size if you put in a larger than needed target file size. It gave me a file 2x larger than my XVID file.

So now I am experimenting with average bit rate numbers to find a good balance of quality & speed.

Off the top of your head know a good ABR for 1280x720 footage like these HD game videos to where it would appear to the eye the same as lossless?

2000 was way too low

Just did 6000 and its almost there, I think 8000 should be just about right and give me a file probably about 33mb vs the maxed out xvid of 90mb

I'll have to run a test of a target file size in xvid when I found where I like it to see just how much better the h264 is.

Edit: I am happy with ABR of 8000 it made a 40mb file, I ran a target file size test for XVID and it looks the same to me! I know your going to kill me and say its not possible but it does.

So now I am purposely doing a low target file size where the video should be noticeably bad and see how much better the H264 codec can do.

_________________
ViciousXUSMC on the Web - YouTube :: FaceBook :: Website


Top
  
 
PostPosted: 21 Jan 2009, 02:41 
Offline
Insiders
Insiders
User avatar

Joined: 14 Apr 2007, 02:13
Posts: 1514
I read up on it in there wiki and they said to fix the frame rate isntead of use same as source, Its supposed to only effect mixed frame rate content but did that and cranked up the B Pyramid number, Motion Estimation numbers, and a few other things and it looks like it resolved it.


It depends on the source. If your source is a videogame, then use the same framerate as the source. I.E. If you capture at 30 FPS, make sure you keep it at 30 FPS. If you do the motion blur technique where you capture at 150 or 300 FPS, then you'll use Avisynth to take every 5th or 10th frame (150 / 5 = 30 and 300 / 10 = 30).

The mixed content they refer to has to do with DVDs. NTSC movie DVDs are 29.970 FPS, but drop down to 23.976 FPS for progressive content. Interlaced content stays higher. PAL is simply 25 FPS. You shouldn't mess with the framerate unless you are ripping DVD movies. Getting into that, though, will usually require additional steps. You simply can't convert 23.976 FPS to 25 FPS (or vice versa) and have it be smooth.


HandBrake is not neary as good at giving a max quality file at a low size if you put in a larger than needed target file size. It gave me a file 2x larger than my XVID file.


It's all in the settings. I've never used HandBrake, but according to their website, they link against x264. So the quality is all in the settings still.


So now I am experimenting with average bit rate numbers to find a good balance of quality & speed.

Off the top of your head know a good ABR for 1280x720 footage like these HD game videos to where it would appear to the eye the same as lossless?


I use CRF rather than ABR. ABR will require multiple passes to get the same quality. There are benefits to both, though. ABR will allow you to target a specific filesize. If you want your final filesize to be 200 MB, then you can easily target that with ABR. You will have to make multiple passes for the video to look good. This also requires extra time to encode because of the additional passes.

With CRF, you target a specific quality instead (CRF = Constant Rate Factor). You won't know the final filesize of the target, but you only need to make one pass to get quality that is 99.9% on par with ABR.

Typical settings that are used for bitrate settings varies on the resolution. For great looking 720p content, you'll want to target the 10-12MB range. And for 1080p, you'll want to target 12-15MB. This typically isn't ideal for the internet. YouTube is just going to cut the bitrate down to 600KB or so. If you stream the file yourself or host it on some higher-quality streaming site, then it will be more worth it.

When making my videos, I usually set CRF between 22 and 25. The lower the number, the better the quality. Naturally, encoding time will increase, as well as the filesize. There's a tradeoff for everything.


Edit: I am happy with ABR of 8000 it made a 40mb file, I ran a target file size test for XVID and it looks the same to me! I know your going to kill me and say its not possible but it does.


It all depends on your settings. If you're using maxed out settings with XVID, and terrible settings for H.264, then XVID might definitely look better. You'll really need to play around with settings.



Here's an example of reasonable/mid-quality settings with x264:
--bframes 3 --b-pyramid --ref 4 --crf 25 --weightb --subme 7 --8x8dct

Here's an example of unreasonable/insane-quality settings with x264:
--bframes 16 --b-pyramid --direct auto --ref 16 --crf 24 --partitions all --weightb --me tesa --subme 9 --mixed-refs --8x8dct --no-fast-pskip --no-dct-decimate --trellis 2 --qpmin 0

_________________
Widescreen Fixer - https://www.widescreenfixer.org/

Widescreen Fixer Twitter - https://twitter.com/widescreenfixer
Personal Twitter - https://twitter.com/davidrudie


Top
  
 
PostPosted: 21 Jan 2009, 07:00 
Offline
Editors
Editors
User avatar

Joined: 31 Jul 2006, 14:58
Posts: 1497
I was much closer to insane settings than I was lax settings.

Also you just said something that goes against what I have been taught/read.

I was told a 2 pass method gives better quality than a single pass method, Thus why target file size and ABR can do better with a smaller file size, this is also why probably they added a way to force a 2 pass on CBR just recently to Avidemux.

The first pass is to just analyze the file and the 2nd to encode it. I do not mind 2 pass, Im churning these out with a 3.6ghz q6600 so the first pass takes very little time.

I will have to check out what you say and see how it goes though. I think handbrake does not use a quantizier or % of quality like some other programs it just uses a bit rate setting. However its very cool in that all it really does is generate the code for you so I can manually add in any setting I want that the GUI does not populate.

Off the top of my head since handbrake is kind of teaching me some of the code this is about what I used.

-bframes 9 -b-pyramid -ref 9 --subme 9 -mixed-refs me-range 32 me-umh trelis-0 Something along those lines. I do not use no dct decimate as it makes the file larger so if your shooting for a low file size it would make the quality worse in most of what I read its only recommended if you find artifacts from it. Using a CRF like you do it would not hurt it would just make the file larger.

trellis 2... I never mess with trellis I keep it at stock and I cant really find hard evidence on what good/harm it will do to raise it.

cqm - I hear this can make one of the largest impacts of all I just used the default but I am going to try out sharktooths matrix.

_________________
ViciousXUSMC on the Web - YouTube :: FaceBook :: Website


Top
  
 
PostPosted: 21 Jan 2009, 08:10 
Offline
Insiders
Insiders
User avatar

Joined: 14 Apr 2007, 02:13
Posts: 1514
I was told a 2 pass method gives better quality than a single pass method, Thus why target file size and ABR can do better with a smaller file size, this is also why probably they added a way to force a 2 pass on CBR just recently to Avidemux.


If you're using ABR, then like I said before, you need to use 2 passes. CRF is not ABR, though, so it doesn't need 2 passes. It does things differently.

The reason why you need two passes with ABR is common knowledge. The first pass analyzes the frames for bit distribution, and the second pass takes that information and uses it.

With CRF, though, each frame is analyzed and a constant rate factor is applied to it. This means that you have a constant quality factor.


I'll quote some information from the link below.

--qp

The first of three possible ratecontrol methods. Set x264 to encode the movie in Constant Quantizer mode. The number you give here specifies the P frame quantizer. The quantizer used for I and B-frames is derived from ipratio and pbratio. CQ mode targets a certain quantizer, which means final filesize is not known (although it can be reasonably accurately estimated with some methods). A setting of 0 will produce lossless output. qp produces larger files than crf for the same visual quality. qp mode also disables adaptive quantization, since by definition "constant quantizer" implies no adaptive quantization.


--bitrate

The second of three ratecontrol methods. Encode the video in target bitrate mode. x264 will attempt to encode the video to target the given bitrate as the final average. The parameter given is the bitrate in kilobits/sec. (8bits = 1byte and so on). This setting is usually used in conjunction with pass for two pass encoding. Target bitrate mode means the final filesize is known, but the final quality is not (although it's possible to estimate with a reasonable degree of accuracy). It is generally not recommended to use bitrate mode without 2pass encoding.


--crf

The final ratecontrol method: Constant Ratefactor. While qp targets a certain quantizer, and bitrate targets a certain filesize, crf targets a certain 'quality'. The idea is for crf n to give the same perceptual quality as qp n, just in a smaller space. It is not extremely exact, but reasonably close (and will average out to be accurate over a large number of videos).
CRF achieves this by reducing the quality of less important frames. In this case, frames in complex or high-motion scenes, where quality is more expensive (in terms of bits) and/or less visible, will have their quantizer increased. The bits saved in cuts like this are redistributed to frames where they will be more effective. CRF mode gives almost exactly equivalent quality to 2pass at the same bitrate; the difference is that you cannot choose the output bitrate.



As you can see, CRF will give almost exactly (I'd say 99.9%) the quality of using bitrate, but you only need to do one pass, and you can be guaranteed the quality. With bitrate, you'll need to play around with the right bitrate to get the quality you want. With CRF, you can set it to 22 or 25 and get a specific quality. It's much better to use CRF.

Sure, you may not know the final filesize, but you can be sure of the quality. For me, it's all about the quality. I don't need to specify a bitrate.


Check out this for descriptions of the settings:
http://mewiki.project357.com/wiki/X264_Settings

_________________
Widescreen Fixer - https://www.widescreenfixer.org/

Widescreen Fixer Twitter - https://twitter.com/widescreenfixer
Personal Twitter - https://twitter.com/davidrudie


Top
  
 
PostPosted: 21 Jan 2009, 08:32 
Offline
Editors
Editors
User avatar

Joined: 31 Jul 2006, 14:58
Posts: 1497
cool so whats your recommended CRF? Im thinking of giving 20 a shot and tunring on some of the more advanced options to see what I come up with.

And handbrake does have a crf setting looks like I just have to use a different preset mode.

I may be on my way to writing a good guide soon if I keep learning like i am now.

So do you have any take on custom matrices?

I was going to try out the high quality one from here: http://forum.doom9.org/showthread.php?p=887125#post887125

_________________
ViciousXUSMC on the Web - YouTube :: FaceBook :: Website


Top
  
 
PostPosted: 21 Jan 2009, 12:56 
Offline
Insiders
Insiders
User avatar

Joined: 14 Apr 2007, 02:13
Posts: 1514
20 is actually pretty high. A good range is 22-25. 18 is virtually indistinguishable from any lower setting to the eye.

As for the matrix settings, I use Avisynth for all of my alterations. Seriously, you need to look into Avisynth. It's probably one of the greatest things for video editing. It's a scripting language with a ton of different plugins.

Example script:


a = BlankClip(length=15, width=1920, height=1080, pixel_type="YV12", fps=30, color=$000000).KillAudio()
b = RawSource("cod4_jump_1080p300.y4m").AssumeFPS(300)
c = BlankClip(length=15, width=1920, height=1080, pixel_type="YV12", fps=30, color=$000000).KillAudio()

bv = b.MVAnalyse(isb=true, truemotion=true, blksize=16, blksizeV=16, overlap=2, pel=2, search=3, idx=1)
fv = b.MVAnalyse(isb=false, truemotion=true, blksize=16, blksizeV=16, overlap=2, pel=2, search=3, idx=1)

b = b.MVFlowBlur(bv, fv, blur=100).TemporalSoften(1, 255, 255, 50, 2)

b = b.SelectEvery(10, 1)
b = b.FadeIn(15)
b = b.FadeOut(15)

return (a + b + c).AddGrain(12, 0, 0)


This will add a fade-in to the beginning and a fade-out to the end. It will then analyze and calculate motion blur, and do temporal softening. Once the blurring is done, it will choose every 10th frame (drop it down to 30 FPS). Once everything is done, it will add some film grain to the scene.


There are so many other things you can do with Avisynth.

_________________
Widescreen Fixer - https://www.widescreenfixer.org/

Widescreen Fixer Twitter - https://twitter.com/widescreenfixer
Personal Twitter - https://twitter.com/davidrudie


Top
  
 
PostPosted: 21 Jan 2009, 22:37 
Offline
Editors
Editors
User avatar

Joined: 31 Jul 2006, 14:58
Posts: 1497
Im really making great progress with HandBrake. I got over the big obstical. There program uses CRF but it does not use traditional CRF numbers, instead there GUI uses a % of quality slider.

The code it generates is -q .xx where xx is the %

I tried -crf and got invalid syntax. I found out via google and much reading that they use a formula.

(51-CRF)/51 = %

So I made a handy spreadsheet to do it and now I can easily use what I want.

So I used a CRF 21.5 ish and thats 57% and it gave me almost exactly the same file size as my 8000kb/s ABR file.

But now I can get it done in one pass like you said. Seems the experts at Doom9 still say you can pack a bit more quality in a ABR file, so those who are extremly picky like to run a CRF pass to see what the ABR is and then do a 2nd pass at that ABR instead of actually using CRF for the final encode.

I cant see any difference, so a single pass CRF is fine for what I am doing.

_________________
ViciousXUSMC on the Web - YouTube :: FaceBook :: Website


Top
  
 
PostPosted: 22 Jan 2009, 02:48 
Offline
Insiders
Insiders
User avatar

Joined: 14 Apr 2007, 02:13
Posts: 1514
The difference in quality is impossible to tell with your eyes. And when using ABR, you don't know what quality you're going to get with every frame. This is why you need to do two passes. Even then, you're still targeting a specific filesize and not quality. It's just better to use CRF.

I have no idea what arguments HandBrake uses. I use x264 directly. This way I can always be using the latest x264 (changes are pretty frequent), and I can use my own 64-bit version. The 64-bit version of x264 is 12-15% faster than the 32-bit version (which is probably what HandBrake comes with). You can use avs2yuv to pipe an avs script into 64-bit x264.

Really, you'll just need to play around with all of this stuff yourself. :)



My typical process:

Fire up game
Dump frames at 150 or 300 FPS
Create an Avisynth script with ImageSource(), AssumeFPS(), and ConvertToYV12()
Use mplayer to play the avs script and dump it to a yuv4mpeg (y4m) file
Use RawSource() to load the y4m
Do anything else I want with the clip in Avisynth
Use avs2yuv to pipe the script to 64-bit x264 and encode the video
Import the .264 file into mkvmerge, set settings, and save as a .mkv file
Done


Doing audio is a separate process:

Use a song or dump the audio from the game
Encode the audio to AAC using neroaacenc
neroaacenc saves it as a mp4, so use mp4box to extract the raw AAC track
Delete the mp4 file since you have the AAC file
Import the .aac file into mkvmerge, set settings, and save the .mkv file

You can open the existing .mkv file you have, or wait until both processes are complete and import the .264 and .aac file at the same time.


I use these methods because I can specifying every little argument for each program along the way to fine-tune everything. I just have far more control over the process. I can use other programs if I want, and even insert different steps along the way. I can understand the ease of using a single program, but then you don't learn much, if there are problems, you don't know exactly where the process failed, etc.

_________________
Widescreen Fixer - https://www.widescreenfixer.org/

Widescreen Fixer Twitter - https://twitter.com/widescreenfixer
Personal Twitter - https://twitter.com/davidrudie


Top
  
 
PostPosted: 22 Jan 2009, 07:59 
Offline
Editors
Editors
User avatar

Joined: 31 Jul 2006, 14:58
Posts: 1497
Yeah I read into how to compile your own 64bit version its supposed to be about 10% faster but offer less options if you use the 64bit version.

Using the pipe method I am not sure.

Man 150 or 300fps game files? Mine are massive at only 30fps, I wonder if my computer would explode trying to write 5 times the amount of data while recording at that rate, also since you cut it down to probably 30fps anyways is there a real noticeable advantage?

Also I did my research on trellis like I said. I have multiple sources that say Trellis is not a good idea for CRF or any other kind of constant quantizer as it can give odd and unpredictable results. If anything use Trellis 1 they say.

I ran a test on my file Trellis-0 47mb file

Trellis-2 41mb file that I think looked slightly worse, but it could be my imagination. That a big difference in file size though almost 1/5th other options do not make nearly the same impact other than increasing the CRF by a good amount.

So here is a question for you, the command to make the video more web compatible so that it can download in progressive scan mode. I know this helps if you host your file directly but do you think this aids or worsens things for youtube? I cant seem to find the answer on google.

I also gave the custom matrices a try, it works magic I think. Was a pain to find out how to find the *nix path my file though.

I have enough under my belt to write a good easy to follow guide for novices to use to make great H264 files with HandBrake.

I much look forward to your X264 guide though as its all command line based I dont know how to use it, or even how to run it.

Are these native x64 builds here any good? - http://forum.doom9.org/showthread.php?t=89979 or do you think making your own or using the pipeline method is better.

_________________
ViciousXUSMC on the Web - YouTube :: FaceBook :: Website


Top
  
 
 [ 107 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 11  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  




Powered by phpBB® Forum Software © phpBB Group