View Full Version : FFdshow with H264/x264 on AVI container.
AiDz0r
6th December 2009, 01:51
Guys I need help making the best quality, everything so far I look here is all out-dated. I've got few problems, If there is any suggestions you may please.
Now I'm trying to capture a video from a game called "Counter-Strike" I can capture and edit but when it comes to rendering i need the best encoding format, I've heard people say not to use codec leave it on WMV, others say use H264, and so far I use FFDSHOW on h264/x264 but now when ever i try to upload it to youtube I get an error saying "Failed (unable to convert video file)" I've tried so many things eg: MeGUI, RipBot none of them turned out good. I really don't care about how big the file is its oke for me if it’s 150+ Mb/minute. I just want something with good quality, and yet I released that on some XviD or other codec like x264 on its own, when there's an action in the movie like a lot of movements and just pause it and you can see like Big Square Pixel's, and once that’s uploaded to youtube the quality won't turn out good and I just need configuration or even if there's another better way.
So far this is what i do:
From Counter-Strike get the Images (.Tga files) and replace them inside VirtualDub and set frame rate to 120 (120 because it was set like that in Counter-Strike too) and then render as Uncompressed, from there i use Sony Vegas pro to edit and after I edit I render as AVI with "FFDSHOW video encoder" and bitrate as 4500 these are my current settings
thanks
-Aidz0r
http://img229.imageshack.us/img229/4779/84467402.jpg
[ReX]
6th December 2009, 02:20
H.264 + AVI is not a good move. You should go with MKV or MP4 as your container.
AiDz0r
6th December 2009, 02:29
well oke but how could i do that as the most simplest, VirtualDub gets only AVI's i guess, and its not good using Sony Vegas MP4 ? well what should i do now?
[ReX]
6th December 2009, 02:31
You can always remux using MKVToolnix after you're done, but if you need it in AVI, just keep it in AVI. :rolleyes:
nm
6th December 2009, 02:33
Whatever you do, don't use 1-pass ABR. Use CRF instead (try CRF=18 if you need nearly transparent output). And turn B-frames (3..5) and the loop filter on. TESA is complete overkill. Use UMH. Set threads to 0 if you have a multi-core CPU.
Stephen R. Savage
6th December 2009, 02:38
Ignore the comments about AVI. When you upload to YouTube, you have to consider their filesize limit, and there's not a lot you can do about the (crap) encoder they will re-compress your uploaded video with. That said, let's consider a few things:
1) You captured your video and rendered it at 120 fps. This will require 4 times as much bitrate as a 30 fps video, and YouTube will decimate it to 24 or 30 fps anyway. Moreover, there's no point in rendering to 120 fps for the final encode, unless you actually have a 120 fps screen. In VirtualDub, you can use the "Change Framerate" function to drop it to 30 fps. You might need some motion blur though.
2) Enabling B-frames and deblocking (first screenshot) will certainly increase the quality of your encode. Same with trellis (third screenshot).
3) One pass encoding leads to interesting results near the end of the video, as well as lower quality overall. Use two passes.
4) If you are concerned about compatibility, you can same another AVI in VirtualDub and then encode that. You could even use a lossless codec here to save some space.5) 5) There are a bunch of x264 GUIs. Try RipBot264 or something.
Point #1 is the most important one here.
RunningSkittle
6th December 2009, 02:38
Your making this WAY too complicated. Just make a simple avisynth script and feed that to x264.exe. STOP USING VFW!!
(write this in notepad, and change extension to avs)
DirectShowSource("x:\path\file.tga")
ConvertToYV12()
x264.exe --preset slow --output "x:\path\x264output.mkv" "x:\path\avisynthscript.avs"
Read about x264 presets and tunings here: http://mewiki.project357.com/wiki/X264_Settings
Read about avisynth here: http://forum.doom9.org/forumdisplay.php?f=33
Get x264 here: http://www.x264.nl
AiDz0r
6th December 2009, 02:47
thanks alot, oke now im re-rendering with what you said on "b frames" the "max. consecutive b frames" is set to 1 hope thats fine and deblock are set to 0 both of them. One last thing ar 4) what do you mean, should i render uncompressed from Sony vegas and Encode it from VirtualDub or RipBot264, btw for ripbot264 you need these .txt (presets) and i don't know which ever is the best.
AiDz0r
6th December 2009, 02:48
hmm, now i see. thats why the new x264 wasn't a installer, well then whats wrong with VFW's ? those are outdated or something too?
RunningSkittle
6th December 2009, 02:53
Yes, dont use it. Its easier to use x264.exe anyway.
AiDz0r
6th December 2009, 02:59
Oke whats the avs for then?, i Use VirtualDub to make it an uncompressed, and its not 1 .TGA file its like 1000 of them. its images and i use virtualdub to make it a AVI file
nm
6th December 2009, 03:05
When you upload to YouTube, you have to consider their filesize limit
2 GB is quite a lot for 10 minutes of H.264 video, even for 1080p. I'd consider the filesize limit irrelevant in this case.
and there's not a lot you can do about the (crap) encoder they will re-compress your uploaded video with
I hear they're using x264 for HD video. ;)
3) One pass encoding leads to interesting results near the end of the video, as well as lower quality overall. Use two passes.
One-pass CRF is perfectly fine for this purpose and saves a lot of encoding time.
AiDz0r
6th December 2009, 03:15
Well im going to render as RunningSkittle said but the only thing for AVS i didn't use a tga file, I edited my video from sony vegas and rendered it as Uncompressed AVI then replaced
DirectShowSource("x:\path\file.tga")
with
DirectShowSource("D:\Uncompressed.avi")
hope im doing the right thing.
AiDz0r
6th December 2009, 03:31
I just found this on the internet, will it work and Is it Good!?? please feedback
--pass 2 --bitrate 4500 --stats ".stats" --level 4.1 --ref 3 --mixed-refs --bframes 3 --b-rdo --bime --weightb
--direct auto --nf --subme 6 --trellis 1 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --ipratio 1.1 --pbratio 1.1
--vbv-bufsize 9000 --vbv-maxrate 24000 --qcomp 0.5 --me umh --merange 12 --threads auto
--thread-input --progress --no-psnr --no-ssim --output "output" "input"
AiDz0r
6th December 2009, 03:39
I get unkown Option's now D:
Inspector.Gadget
6th December 2009, 03:53
I just found this on the internet, will it work and Is it Good!??
The answer to that question is almost always "No."
JEEB
6th December 2009, 03:54
1) You can load AVI files with AVISource or DSS (DirectShowSource) -- since DSS rather never really is good at certain things, I'd rather keep away from it if only possible (If whatever you saved your video with is directshow-only or if DSS gives you better output, then it's alright to use).
2) Damn, you were given links and examples... just that they missed ratecontrol (which you should decide by yourself -- here I'm using the 1pass CRF "constant quality" mode with a value 19, which is rather transparent on HD video and quite OK'ish SD, depending on your eyes and usedness to perfection. Higher value means "use less bitrate" and a lower one means "use more bitrate", so basically you can try finding the highest value that still gives you acceptable output and keep encoding with that.
x264.exe --crf 19 --preset slow --output "x:\path\x264output.mkv" "x:\path\avisynthscript.avs"
I usually write the input file name before the settings and use -o instead of --output for the output setup. I also would not recommend using old MeGUI profile settings in any case, which is what you seem to have found...
Also, you were linked with this URL (http://mewiki.project357.com/wiki/X264_Settings), which explains the presets, which is pretty much all that you need to touch when encoding. Tuning might come in later, but I'd say that mostly you can just use the preset to control the quality/speed compression ratio.
AiDz0r
6th December 2009, 04:19
Oke I do understand things now, fistly let me fully explain what i do,
1- a game named "Counter-Strike" Fist person shooting game, i take images from that game and i set the fps to 120 so evey second i receive 120 Frames of images.
2- I use VirtualDub to make all those images into 1 AVI file, (Uncompressed)
3- I use Sony Vegas Pro to Edit/effect the movie. and render again Uncompressed AVI Force it to 30FPS
4- Now i use x264.exe to encode it
Now eveything seems so good, except the presets, all i need is one that Locks framerate to 30 and resolution to 1280x720, and with CRF what will be the quality, because these videos ill be doing will be uplaoded to an Online streem (Youtube)....
**And i don't need to use AVS all i just do is locate the Uncompressed AVI with edited one. (step 3)**
so now it would look something like
x264.exe --crf 19 --preset slow --output "x:\path\x264output.mkv" "x:\path\uncompressed.avi"
right?
AiDz0r
6th December 2009, 04:40
JEEB here's a video of 3 seconds in counter-strike i just uploaded it to youtube...
http://www.youtube.com/watch?v=JVLzMmLTdEs
AiDz0r
6th December 2009, 04:44
I get a better quality way better quality on normal uncompressed so its not about the actual file.
This is what happened when i encoded it from x264.exe and upload it to youtube (It's not suppose to be like this, i've seen better video's with better quality)
http://img301.imageshack.us/img301/7798/50252794.jpg
Keiyakusha
6th December 2009, 05:12
Obviously every file on Youtube gets reencoded with its own tools and settings. If the file you encoded locally looks good - you can do nothing about crappy quality on youtube.
AiDz0r
6th December 2009, 06:37
Here's another video from youtube which is the best, and he says he did from FFDSHOW video encoder? so thats better then x264?.
http://img682.imageshack.us/img682/2013/37270942.jpg
This is what he reccomended for me..
1-http://img3.abload.de/img/tut18dq6.jpg
2-http://img3.abload.de/img/tut2yc3d.jpg
so the funny thing is that this is also using H264 and x264 over FFDSHOW with AVI container.
dstln
6th December 2009, 16:36
Also keep in mind that youtube uses really low bitrates (relatively) for their content and fairly poor settings, meaning the results on fast-motion gameplay easily may not be as good as you've hoped. But it shouldn't be quite that bad if it's flagged for hd.
But basically (as you've already seemed to guess), you take the massive raw output, reencode intermediate (as transparent as you can) so you can upload it, then youtube reencodes it. Honestly at the bitrates we're talking about, you could probably use almost anything for the intermediate step. But yes, you should also change it to 30fps during intermediate.
nm
6th December 2009, 17:21
Here's another video from youtube which is the best, and he says he did from FFDSHOW video encoder? so thats better then x264?.
No, ffdshow uses libx264 for H.264 encoding and the version it uses is probably not the latest. Secondly, either the defaults are bad or you guys have changed the settings to make no sense. Your first screenshots and these later ones show the same mistakes in basic ratecontrol settings, B-Frames and the loop filter. At least this other guy has set a decent bitrate for 960x540. You were using the same for twice the frame size.
x264's defaults & a suitable CRF will produce an order of magnitude better results at the same bitrate.
You haven't shown us the output that you get from x264 or even told us what it looks like, so it's hard to say if there's something seriously wrong with it. However, as people have repeatedly pointed out, the quality problem is most likely caused by Youtube's automatic encoding. Your 3-second sample clip is quite a difficult piece because there is lots of fast motion where the poor 120 fps -> 30 fps motion blur effect may cause additional problems.
So, I'd suggest fixing the motion blur (one way is to capture at a higher framerate, such as 480 fps) or try disabling it completely (drop frames or capture at 30 fps). Also, try scaling the video down to 960x540, like the other guy is doing. Youtube might handle that better.
AiDz0r
7th December 2009, 07:47
Well then, oke here's a simple way to recognize if the quality is bad or not, fistly look at the Crosshair in the middle, and look at the writing (Kills) on the top right corner.
and as you said opening B-Frames and loop filter is allways a better option do you know what else should i use? also that image above the ffdshow one, is my friends thats how he does his settings and gets way better then mine
My test video based on X264
http://www.youtube.com/watch?v=JVLzMmLTdEs --> Jeeb showed me the preset for the X264.exe
http://www.youtube.com/watch?v=S_hMmvssX_E --> my test with different preset. from x264.exe and yes latest version
These other video which are really great, i can't imagine these videos without the re-compressed thing in youtube..
http://www.youtube.com/watch?v=0ZTFppqY1Do
http://www.youtube.com/watch?v=VeL9QAOyllI
http://www.youtube.com/watch?v=FwOeEPf-onA
nm
7th December 2009, 09:00
and as you said opening B-Frames and loop filter is allways a better option do you know what else should i use?
Rest of the settings don't matter that much as long as you're using a high enough bitrate (or low enough CRF) to keep the output nearly transparent. You don't need the highest compression factor for encoding YouTube-intermediates.
My test video based on X264
http://www.youtube.com/watch?v=JVLzMmLTdEs --> Jeeb showed me the preset for the X264.exe
http://www.youtube.com/watch?v=S_hMmvssX_E --> my test with different preset. from x264.exe and yes latest version
In my opinion, both of these videos are about as good as they can be considering the original source and YouTube's current limitations. I don't see other quality difference than editing (different contrast and color levels, perhaps different motion blur) when compared against those three other videos. Upload a longer clip to get a better idea of the overall quality.
AiDz0r
7th December 2009, 12:50
oke then thanks for the tip ill try it out next time, a Long one with what you said exactly CRF =D thanks allot for all helping me out!!! really learned allot
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.