Tuning hqdn3d for use with ffmpeg

738

Solution 1

Upscaling is rather unlikely to help quality, so I suggest you should first consider not upscaling.

hqdn3d will only harm fidelity, but that's more of a theoretical concern if you happen to prefer the way the video looks after being filtered. I usually prefer sort of conservative options like "hqdn3d=4:4:3:3" or similar. If you at all like what that does to your video, you may consider that the first two parameters could be set higher for higher-def videos but should not be raised a whole lot on low-res videos. The last two parameters are temporal filtering, and as you may have already seen, you get an annoying motion-blur like effect if you overdo it.

But ultimately you have to accept that this is all subjective, and each video will be affected to different degrees and in different ways by this filtering.

Solution 2

Upscaling in fact increases the ammount of detail a lot! Youtube always compresses Video. 1080p looks very bad. Scaling it up to 1440p already looks quite good. To 4k it looks almost perfect. Of course it is only 1080p detail level, but this is a very great trick, to get better quality video on youtube. I realy hate it a lot, that NO ONE seems to do this. Youtube 1080p's bitrate looks horrible.

Just to back up the question starter.

About hqdn3d: You realy need to individually test this out. This takes some time. Use the parameter: -frames:v 300, to only render the first 300 frames. Usually this is plenty for a test comparision. It would take to long, to render the whole video for testing purpouse! However the parameters required for hqdn3d are very source specific. Test out what works best. If you have multiple sources, save each parameter, that works best for each source. That is what I do usually.

Share:
738

Related videos on Youtube

jjkim
Author by

jjkim

Updated on September 18, 2022

Comments

  • jjkim
    jjkim almost 2 years

    I am running into the error:

    TypeError: Cannot read property 'restore' of undefined when trying to restore
    

    This happens when I try to execute the following test:

    describe('#createObjects()', function () {
          let myStub: any;
          
          beforeEach(function () {
             myStub = sinon.stub(obj, 'doStuff'); 
          });
    
          afterEach(function () {
             myStub.restore();
          });   
    
          it('should throw correct packaged error on exception', async function () {
              // Do some testing
              let error = {}; // Some error object
              let expected = {} // Some expected error object
              myStub.throws(error);
              try {
                 await subject.executeProcess();
              } catch (error) {
                 expect.(error).to.eql(expected);
              }
          });
    });
    

    I think it has something to do with the asynchronous function handler, which has to be asynchronous since I'm invoking an async function inside (await subject.executeProcess()).

    I am not sure why this wouldn't work. I have also tried calling the done() callback here as well. Am I doing this correctly?

  • Alex
    Alex almost 4 years
    I just want to address the claim about upscaling increasing detail. This is of course false, upscaling cannot increase detail. So immediately when I read the start of this I judged this answer to be incorrect. However, when it comes to YouTube, you are seeing higher detail after upscaling because YouTube allows a higher bitrate for higher resolutions, so in context this is right. You're essentially using a clever hack to get YouTube to encode your lower resolution video with better quality by pretending it's a higher resolution.
  • HeartOfGermany
    HeartOfGermany almost 4 years
    Of course, the details need to be there in the first place. But you can often extract more detail from a pixel than you can see beforehands. Like antialiasing smoothes sharp edges by combining multiple pixels into 1 pixel. But of course with clever math you can relatively accurately extract the position of the line as it was a highres input. And looking at the way AI is improofing it looks very promising. Some details are generate in a way, that it is very hard to distinguish from the real world high-res example. Yeah, creating information from less is BS, but only in a "definition way".
  • HeartOfGermany
    HeartOfGermany almost 4 years
    But artistically speaking it is increasing detail. There is more than 1 meaning to a word, @thomasrutter . Of course you could say "it makes video look better", but that also is not very scientific. And restoring an old fotograph imho increases details. Why? Well, our brain often knows, what the lost information is supposed to look like, so filling it in with a paint brush tool or similar is in fact making an for example 80% accurate image looke 90% accurate. So yeah, of course it creates details. If we know, what the lost details are at least. It has its limits. But who cares?
  • HeartOfGermany
    HeartOfGermany almost 4 years
    Oh wait, we where not talking about AI. So yeah, I stated, that a video looks better when upscaled from 1080p to 4k prior to uploading it to youtube. That is a fact. And I explained, why this is so. Just re-read it. I did not state, that the 1080p stream looks better, it will not be visibly different. But having an option to select 4k will give you acces to a higher bitrate video, which obviously looks better. Not because of the resolution, because of the bitrate. I honestly prefer a 720p 100Mbps video over a 4k 5Mbps video. Now explain to me: Why?