Software encoding (x264) provides better quality for a given bitrate at the expense of making your CPU do all of the work. Hardware encoding (Quick Sync, NVENC, VCE, etc.) provides worse quality at the same bitrate but keeps the work off of your CPU.
x264 is ideal for streaming where you're very bitrate-limited, hardware encoders are better for local recording where bitrate isn't an issue.