Bad Export Quality for footage

SpyCakesSpyCakes Website User Posts: 11
edited August 2016 in HitFilm

Hello,

Sorry in advance for my English but I do gaming video on Youtube (like many others) and I've searched up and down for similar subjects on this but none that I found actually fixed the quality issues for me. My output files are pretty bad compared to the originally recorded videos and when uploaded to YouTube, they get worse due to how they work. My facecam seems to get hit the hardest.

I record with OBS Studio with a Facecam. I use the NVENC h.264 encoder at a Bitrate of 50000 at 30FPS that downscales 1920x1080 to 1280x720. The file looks amazing before being edited and exported in Hitfilm 4.

For the Export settings of Hitfilm 4 Express, I use Mp4 with these settings:
http://imgur.com/a/MX1uF

I was using lower settings with Hitfilm for videos recorded with OBS without problem but I switched to OBS Studio when I got a facecam and it seems to have got more choppy for the exported file, even with the higher bitrates and higher profile.

What can I do to fix this?

Comments

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,275 Ambassador

    Raise your target mbps from 15 to 50.

    Bear in mind ifbyou're uploading to YouTube, YouTube will compress your video to about 8mbps. This is a YouTube issue, not Hitfilm, and there's nothing you can do about it. 

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    Yeah, which is a big shame about Youtube.

    Will me raising the bitrate for a 720p video to 15-50 cause an exponentially larger file and if so, what could I do to lower the filesize out of Hitfilm? I heard people using programs like Handbreak to get almost perfect file size without harming the quality greatly.

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,275 Ambassador

    Handbrake is encoding to h264 just like Hitfilm's h264 output. You are facing the eternal question--trading off filesize for quality. The smaller you cram a file, the worse it will be. 

    Try 20mbps. This is the encode rate for Blu-ray, so it should look ok. If it's 60fps,try 40?

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    It's recorded at 30fps so I'll try 15-20. I'm editing a video as we speak and I should have it up on Youtube by tomorrow so I'll write back if it looks decent. 

    I would export to the best possible but internet is a issue where I live at the moment so cutting corners is my only option at the moment.

    Also, for the downscaling of my recorded video, would it be better for me to record with OBS at 1920x1080 and downscale in Hitfilm or would it be best to let OBS downscale it to 1280x720 with it's software?

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,275 Ambassador

    Good question. Don't have an answer, so. If your current clip is exported 1080p and downsized to 720p in Hitfilm try the other way next time amd see what looks better. 

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    I'll try that,

    Anyways, here's the video at 20mbps. It seems my facecam takes the most hit from Youtube's compression as my export video looks pretty good. The exported file was a 3-4GB file aswell but could be more.

    Here's a video that was at a bitrate of 10Mbps Target and 15Mbps Max but with straight x264 preset in OBS classic while my other video that I just rendered above was using the Nvidia NVENC encoding with the OBS Studio. Could the NVENC be the problem? The bitrate is set to 50000.

    Is it best to put the max and target at the same bitrates.(20Mbps+)?

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,275 Ambassador

    NVENC is out of my bailiwick. @Aladdin4d @Stargazer54 @NormanPCN you gents have ideas? 

  • kevin_nkevin_n Website User Posts: 1,926 Enthusiast
    edited August 2016

    NVENC is what Shadowplay is using isn't it? I'd imagine that'd be the best alternative while recording, not transcoding probably similar to QuickSync isn't it?

    Following this as well. :)

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,275 Ambassador

    If NVENC is Shadowplay, then I would suggest the tutorials in this thread, since another issue is NVENC would be variable frame rate, which will cause audio drift. 

    http://hitfilm.com/forum/discussion/40639/how-to-work-with-edit-video-game-footage-in-hitfilm#latest

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    Yes, Shadowplay does use NVENC. I would use Shadowplay but I prefer OBS for the ability to change and add to Scenes, like my Webcam/Facecam window.

    Here are the settings for this video that uses NVENC .

     Edit:

    @Triem23 Alright, I'll take a quick look at that although I haven't really encountered too much audio drift, nothing I couldn't resync myself. 

     Double Edit:

    Instead of using OBS Studio with NVENC, I'll give OBS Classic a try as I can follow that video's settings a lot easier and see how it goes. Would me adding my facecam to my Scene have anything to do with the change in Quality? It's set to 1920x1080 like the main game window but then is downscaled along with the main video to 1280x720.

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast

    NVENC is an API interface to the hardware/GPU Nvidia encoder. NVENC can do constant framerate. It all depends on the application feeding the encoder. For example, Shadowplay does not enforce constant framerate. Some other application may.

  • kevin_nkevin_n Website User Posts: 1,926 Enthusiast
    edited August 2016

    No not at all, your facecam is made up by pixels like everything else in the video. A higher bitrate is essential for fast moving scenes in video, even if the camera is static looking at leaves or confetti or whatever, that's bad too with a low bitrate, just eats the video whole and the quality is uugh. Having a hard time to understand why increasing bitrate didn't help your video quality. :/

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    Yeah, I don't understand it either. My facecam looks fine at times with OBS classic using the standard x264 preset but the reason I want to get NVENC working is due to it working off the GPU a lot more so I can record more CPU demanding games. Here's the Classic recording off x264 with less Bitrate than my NVENC profile.

    Also, apologies for linking my videos, I just see them as the best examples really.

    So at this point, it's more of an OBS and encoding issue. I just don't know why the Bitrate increase didn't work for it while the Exported file looks pretty good compared to what the Youtube video looks like, even though Youtube does crop it, It should look similar to the other video.

  • kevin_nkevin_n Website User Posts: 1,926 Enthusiast

    I believe that upscaling your 720p video in HitFilm to 1080p is the way to go. YouTube is going to allocate more resources and the end result might be what you're after. I'm pretty sure that if YouTube sees a lower resolution video that's what happens. So ideally you might want to consider that. I also believe that it should have no effect on your final export times, unless HitFilm is doing something in the background to FHD video, because on paper it's not adding or removing information.

     

  • SpyCakesSpyCakes Website User Posts: 11

    I'll give that a try; I have a few things to try on and see how it works but I'll get back if more information comes up or if something doesn't work or starts working!

  • Aladdin4dAladdin4d Moderator Website User, Imerge Beta Tester, HitFilm Beta Tester Posts: 2,509 Enthusiast
    edited August 2016

     NVENC is Nvidia's hardware encoder. As a general rule hardware encoders will sacrifice quality in favor of throughput so you'll get better quality results with a software encoder but a software encoder will eat up a lot more system resources. 

    So which is the best choice for OBS? From what I can tell there isn't a real answer to that question. OBS uses x264 for the software encoder and it's very good (Handbrake is really just a GUI front end for x264) but it can eat up too many system resources while results from using NVENC are apparently all over the place from bad to good to not even working at all. 

     EDIT: I'm just looking at OBS Studio and if you set the Output Mode to Advanced then you can get the important x264 settings. 

    Under the Recording tab choose x264 for the encoder and:

    Rate Control - CRF

    CRF - 16 or 17

     Keyframe Interval - Leave at 0

    CPU Usage Preset - Lower = more CPU usage so go as low as you cna work with.

    Profile - High

    Tune - fastdecode

    x264 Options - Enter this:  keyint=15:min-keyint=1:bframes=0

    That will match @NormanPCN's recommended settings

  • SpyCakesSpyCakes Website User Posts: 11

    I don't know if this will allow for CPU heavy games but I can give it a try; my regular OBS classic is set to something similar, except the Preset is different the Tune isn't there.

    Also, do you happen to know what the x264 Option you listed does? Can I leave the keyin=15min the same for longer than 15 minute videos?

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast

    keyint=15 has nothing to do with video time. It is setting the keyframe interval to 15 frames. OBS only give you control over the keyframe interval by seconds. A short keyframe interval makes the editing performance better for Hitfilm.

     

    My original command

    keyint=15:min-keyint=1:bframes=0

    can be shorted to just keyint=15. It turns out that min-keyint will be set to 1 by x264 for such short keyframe intervals we are setting. No harm in being explicit. Turning B-frames off (=0) does not seem to be necessary for Hitfilm edit performance. Originally I was simplifying the AVC data stream as much as possible to help Hitfilm as much as possible.

    Recently I have changed my setting to keyint=10. The shorter interval really does help Hitfilm with transitions and scrubbing performance.

    In OBS try to keep the x264 CPU usage setting to the fastest settings. I don't have OBS installed anymore but I remember it defaulted to Ultrafast I think. Technically speaking the faster settings can affect quality but the CRF value is your real quality control setting.

    As it's fastest settings x264 is as fast a hardware AVC encoders at similar or better quality. Of course it will be sharing the CPU with you app/game.

     

  • Aladdin4dAladdin4d Moderator Website User, Imerge Beta Tester, HitFilm Beta Tester Posts: 2,509 Enthusiast

    @SpyCakes

    That's three different options

    keyint=15 - This is setting the maximum interval between keyframes to 15 frames

    min-keyint=1 - This is setting the minimum interval between keyframes to 1

    bframes=0 - Setting this to 0 eliminates the use of B-frames. B-frames are very efficient in terms of compression but they come at much higher computational cost in both encoding and decoding. 

    These settings are intended for low CPU overhead decoding which makes for easier editing but they should also make for easier encoding as well. You end up with slightly larger files but not outrageously so and you'll appreciate the benefits 

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    So here's the test video to fix my facecam quality; I recorded it, exported and uploaded at 1920x1080 with a Variable Target Bitrate of 20Mbps. I could probably up the Bitrate a bit more and the level to get rid of those small pixelated pieces here and there though. The quality looks quite a bit better, even in 720p and the filesize doesn't seem to be extremely big/ However, for it being a 1080p video, I'd expect a bit better quality for the facecam but considering the bitrate was only 20Mbps and the level was 4.2, that could be why.

    These are the settings I used for OBS Studio and this is the Export Settings I used in Hitfilm. It works decently well but I might need to figure out how to record higher CPU games as some of them don't bode well with certain settings, which is why I preffered NVENC as it used part of the GPU to allow high CPU games to be recorded. I'll have to fiddle with it and see what works best though!

    Does the video/settings look decent to you all?

     

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast

     Your test video is private.

    Your export settings in Hitfilm have max a average bitrate the same. This effectively makes constant bitrate, and thus defeating variable bitrate. Commonly in software playback VBR you set the max bitrate to ~50% higher than your target average bitrate. The Hitfilm defaults follow this model with a 10 average and 15 max setting.

     

  • SpyCakesSpyCakes Website User Posts: 11
    edited August 2016

    Sorry about that, this is the 20/20 Bitratre and this is the 20/25 Bitrate. It almost looks like the Constant bitrate video has a bit better Facecam quality, however, when I tried just using the actual constant Bitrate Encoder, there was some pixelation discrepancies.  

    Also, that makes sense! So for my Target I should set it to about 20+ and my Max to 25+? 

    Edit: Also, I am very thankful for all of you dealing with my shenanigans. It seems I found a way to get it to work and the other problems aren't really of your main concern considering it's another companies software at this point. The quality of Facecam has improved quite a bit.

  • kevin_nkevin_n Website User Posts: 1,926 Enthusiast

    The people you are talking to are experts in this field, you should take their advice directly and apply what they say to your video. I doubt there's a faster way, otherwise they would of told you. :)

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast

    If 20Mbps is your target average bitrate, then 50% above that would be 30. Not 25. 20 is a pretty high bitrate. Blu-ray is anywhere from 17-26.

    You cannot show video quality comparisons via Youtube. Youtube re-encodes everything you upload. For 1080 video at 30p or less they(Youtube) encode to 8Mbps or less average bitrate. Going from 20 to 8 is a pretty big drop in bitrate.

    The encoder Youtube uses is likely x264 which is as good as it gets. For the AVC/H.264 encoder in Hitfilm you really need more bitrate to equal the quality of the x264 encoder. The 10Mbps default of Hitfilm is probably fine  for most things (25% above 8). I might feel safer with 12 without doing any tests. I did tests a few years ago at 720p comparing x264 and Mainconcept. Mainconcept is the AVC/H.264 encoder in Hitfilm and Vegas. My tests were pixel peeping layering two encodes on top of each other.

This discussion has been closed.