VideoHelp Forum

+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 69
Thread
  1. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    I have read in this forum that this setting aq-mode3 can improve video quality in dark scenes....but where would I place it in in the following string:

    -c:v hevc_nvenc -vf yadif=0:-1:1 -c:a copy -c copy -preset hq -rc constqp -rc-lookahead 60 -spatial_aq 1 -temporal_aq 1 -nonref_p 1 -cq 26

    ...and is it --aq-mode3 or -aq-mode3??

    Thanks in advance.
    Quote Quote  
  2. aq mode 3 is not supported by hevc_nvenc, only libx265
    Quote Quote  
  3. I agree, if you want better quality using x265 (aqmode 4 might also be interessting when using x265) is probably the way to go, also:
    a. using a better deinterlacer
    b. using a lower cq (when using nvenc)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    Well libx265 is way too damn slow....I have several thousand movies to encode.

    What is a better de-intelacer and what is the command

    If I use a lower cq value then I might as well go back to H.264 as the quality would be better and a smaller file size

    HEVC works great except in really dark scenes with motion.....and I have a lot of horror movies.
    Quote Quote  
  5. If it's a theatrical horror movie, or any hollywood type movie, you shouldn't be deinterlacing it in the first place, because it will be progressive content . If it's from DVD, it might be telecined, but still progressive content

    You have to decide what trade offs you're willing to make in terms of encoding speed, quality, compression
    Quote Quote  
  6. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    Many of these movies are recorded HD TV. The movies I have on DVD or Blu-Ray (over a thousand) I don't use any de-interlacing. Like I said, for the most part the movies I have look great even on a 65" TV, it's just the movies with really dark scenes where I can get banding.
    Quote Quote  
  7. For hevc_nvenc you can try increasing aq-strength a bit . It refers to spatial AQ. 1-15 , default is 8. It kind of helps , it's more for flat areas, but there is some overlap with dark scenes

    Also make sure you're using 10bit hevc



    The movies from HD TV will be hard telecined, not native progressive. Some DVD's will be progressive soft telecine, other DVD's will be hard telecined. The majority of modern DVD's will be soft telecine. But 100% of all movies will all be progressive content

    What this means is you inverse telecine the telecined movies. You leave the native progressive ones alone, and you don't deinterlace anything at all or you degrade it

    None of the DVD's will have "square pixels" so you have to set the AR, or resize to square pixels on those
    Quote Quote  
  8. IVTC, or inverse telecine just means reversing the process of telecine. Telecine takes 23.976p film frames and converts that to 59.94 fields/s to make it compatible with NTSC broadcast or NTSC DVD . So you want to reverse process that to get back the original full qualityy progressive film frames. Deinterlacing cuts the vertical resolution in effectively half, because only 1 of 2 fields is used, so avoid deinterlacing progressive content

    In ffmpeg IVTC can be done with

    Code:
    -vf "fps=30000/1001,fieldmatch,bwdif=deint=interlaced,decimate"
    The bwdif deint is just fall back for residual combed frames. Sometimes bad edits, orphaned fields can leave a combed frame. ffmpeg will use bwdif to reduce the combing on those frames only, leaving the other frames untouched
    Quote Quote  
  9. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    I appreciate the info but I know just enough about this stuff to get confused when it gets technical. So, should I run the IVTC on all recorded TV and all DVDs but not on Blu-Rays? I am running a test movie now that I encoded the other day with my existing settings with the IVTC in place of the deinterlacing....and it is taking about 50% longer....but not a problem if quality is increased.

    How do I know if I am using 10bit HEVC?

    If you look at my settings above I have -spatial_aq 1 in there, so I should change the 1 to what value??

    And I am sorry but I do not understand what you mean by the AR value on DVDs.....could you elaborate as I have a bunch of old TV on DVD I need to encode and I want to do it the best I can.

    Thank you very much BTW
    Quote Quote  
  10. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    The resulting file with the updated settings is 7% smaller and if it's higher quality as you say then it's a win/win even if it takes longer. I'll have to edit out a piece of video that is hard to get encoded with quality and run a test for comparison.
    Quote Quote  
  11. Originally Posted by Ronstang View Post
    I appreciate the info but I know just enough about this stuff to get confused when it gets technical. So, should I run the IVTC on all recorded TV and all DVDs but not on Blu-Rays? I am running a test movie now that I encoded the other day with my existing settings with the IVTC in place of the deinterlacing....and it is taking about 50% longer....but not a problem if quality is increased.
    Not all DVD's. It depends on which version of ffmpeg and how it handles soft telecine, whether you've decrypted as MKV or VOB

    For hard telecine - all DVD's

    The majority of BD's are native progressive, no telecine. But <1% actually have telecine too. The native progressive ones come in both 23.976p (24000/1001) and 24p versions

    It might be easier for you to use some GUI that analyzes and figures all this out for you and batches

    How do I know if I am using 10bit HEVC?
    -pix_fmt yuv420p10le

    10bit helps with banding too and generally offers higher compression ratio at typical bitrate ranges, even from an 8bit source

    If you look at my settings above I have -spatial_aq 1 in there, so I should change the 1 to what value??
    1 means enabled . 0 means disabled.

    The aq-strength for nvenc goes from 1-15. It's set at 8 by default . Try a higher value

    And I am sorry but I do not understand what you mean by the AR value on DVDs.....could you elaborate as I have a bunch of old TV on DVD I need to encode and I want to do it the best I can.
    Aspect Ratio

    DVD is generally 4:3 or 16:9 (widescreen)

    e.g. a NTSC DVD will be 720x480 . But a 4:3 will be "squeezed" to 640x480 "square pixel equivalent" on playback for 4:3 or "stretched" to ~854x480 for 16:9 DVD's. If you don't get it right , image will either be too fat, or too tall/narrow


    Originally Posted by Ronstang View Post
    The resulting file with the updated settings is 7% smaller and if it's higher quality as you say then it's a win/win even if it takes longer. I'll have to edit out a piece of video that is hard to get encoded with quality and run a test for comparison.
    Not just frame quality degradation - look at the frame rate. A deinterlaced video from a film source will be 29.97p with duplicates every 5th frame. It will be jerky compared to the proper 23.976p. So you're also encoding 25% more frames (even though duplicates don't "cost" that much bitrate)
    Quote Quote  
  12. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    It might be easier for you to use some GUI that analyzes and figures all this out for you and batches
    That is funny because I am getting away from MCEBuddy because it is a mess. I currently use FFmpeg Batch AV Converter and I really like it. If I was to use some GUI to analyze video files what would you suggest.

    I only record from a few select channels so once I know what the needs of those recordings are I don't need to analyze every single recording.

    I rip all my DVDs and Blu-Rays to MKV using MakeMKV.....does this affect how I need to process them afterwards? If there is some software I need to use to analyze them then group them into batches to put through FFmpeg with specific settings that is not an issue, I don't mind as I want good quality and I'm willing to put the time in.

    I am using one of the latest builds of ffmpeg. I update it every few months.

    -pix_fmt yuv420p10le

    10bit helps with banding too and generally offers higher compression ratio at typical bitrate ranges, even from an 8bit source
    Where in my settings string would that need to be placed?

    1 means enabled . 0 means disabled.

    The aq-strength for nvenc goes from 1-15. It's set at 8 by default . Try a higher value
    OK, but by trying a higher value where do I put it? Do I replace the "1" with the value I want, if not where do I put the value I want?

    Aspect Ratio

    DVD is generally 4:3 or 16:9 (widescreen)

    e.g. a NTSC DVD will be 720x480 . But a 4:3 will be "squeezed" to 640x480 "square pixel equivalent" on playback for 4:3 or "stretched" to ~854x480 for 16:9 DVD's. If you don't get it right , image will either be too fat, or too tall/narrow
    When encoding it won't naturally keep the AR as original? Are you saying I have to check the AR on each DVD and change the settings appropriately?

    Not just frame quality degradation - look at the frame rate. A deinterlaced video from a film source will be 29.97p with duplicates every 5th frame. It will be jerky compared to the proper 23.976p. So you're also encoding 25% more frames (even though duplicates don't "cost" that much bitrate)
    I have experienced said jerkiness on playback and it is super annoying? Are you saying that is because I did no de-interlacing or "improper" de-interlacing? It happens on movies recorded from certain channels but not on others. Are you saying IVTC will correct this issue?

    I'm really sorry for all the questions but I am honestly trying to learn more about this. Cookie cutter settings are not working for me and I have been frustrated for many months doing no encoding....I just keep buying hard drives....but I have 7 or 8 4TB hard drives now full of cable TV recordings I really need to process but I don't want to do it wrong and then find out I deleted all my TS files and am stuck with bad encodings. Many of these movies are very hard to find anywhere so I want to get this right.

    I appreciate you help vey much
    Quote Quote  
  13. Originally Posted by Ronstang View Post
    If I was to use some GUI to analyze video files what would you suggest.
    I'm not up to date on the GUI's , or their pros/cons , if they have a queue, etc.... Common ones that people seem to like are handbrake, megui, staxrip , hybrid . They all do some sort of analysis

    I rip all my DVDs and Blu-Rays to MKV using MakeMKV.....does this affect how I need to process them afterwards? If there is some software I need to use to analyze them then group them into batches to put through FFmpeg with specific settings that is not an issue, I don't mind as I want good quality and I'm willing to put the time in.
    It's ok, use the command above

    But for 23.976 or 24.0 BD's only use -vf format=yuv420p10le . Very few BD's will be telecined, only a handful really - but they exist


    -pix_fmt yuv420p10le

    10bit helps with banding too and generally offers higher compression ratio at typical bitrate ranges, even from an 8bit source
    Where in my settings string would that need to be placed?
    I would include it at the end of the filter chain

    Code:
    -vf "fps=30000/1001,fieldmatch,bwdif=deint=interlaced,decimate,format=yuv420p10le"


    1 means enabled . 0 means disabled.

    The aq-strength for nvenc goes from 1-15. It's set at 8 by default . Try a higher value
    OK, but by trying a higher value where do I put it? Do I replace the "1" with the value I want, if not where do I put the value I want?
    It's a separate command switch. You keep -spatial_aq 1 because that turns it "on". -spatial_aq 0 would turn it "off" . -aq-strength xx is how strong the spatial_aq is

    eg
    -aq-strength 12


    When encoding it won't naturally keep the AR as original? Are you saying I have to check the AR on each DVD and change the settings appropriately?
    I didn't think it did, but I just checked a DVD ripped with MakeMKV and it does , so ignore that part

    Not just frame quality degradation - look at the frame rate. A deinterlaced video from a film source will be 29.97p with duplicates every 5th frame. It will be jerky compared to the proper 23.976p. So you're also encoding 25% more frames (even though duplicates don't "cost" that much bitrate)
    I have experienced said jerkiness on playback and it is super annoying? Are you saying that is because I did no de-interlacing or "improper" de-interlacing? It happens on movies recorded from certain channels but not on others. Are you saying IVTC will correct this issue?
    It should "fix" it.

    For the actual movie part (not commercials) , they will always be 23.976p . If you just deinterlace only - you will have 29.97p, so every 5th frame duplicated.

    There might be other issues with specific movies or sources. For example, some might have had other conversions done improperly before broadcast. Those you have to evaluate on a case by case basis. 99% of North America movies on TV will be 23.976p and you just use the same filter chain

    Commercials can be interlaced 59.94 fields/sec, or 29.97p content . I'm assuming you edited those out, or don't care
    Quote Quote  
  14. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    I ran some more tests with the same movie for comparison so I can learn

    1. With IVTC
    2. With IVTC and 10 bit color
    3. With IVTC, 10 bit color, and Spatial set to 12

    And the results were as follows:

    1. 58 minutes to encode and a file size of 2,569.975
    2. 66 minutes to encode and a file size of 2,615,975
    3. 64 minutes to encode and a file size of 3,157,189

    The IVTC corrects the deinterlacing so that is my new baseline. I will have to take two movies I know have lots of banding in them and make some video clips of 5-10 minutes or so to use for testing to determine how well I can correct my issues of video quality and at what cost. It appears from what I have already done that changing the Spatial strength will probably have the most affect due to increase in file size....which I assume is due to higher bitrate which should reduce the banding, correct?

    I also looked through some DVD rips I have in a temp folder and many are progessive scan while a few are interlaced as reported by Mediainfo. It does not differentiate between hard and soft telecine, is there some other utility I can use to find this info?

    I am using the 4.3.2 build of ffmpeg which comes with the FFmpeg Batch AV Converter version I am using but there is a new version available which I will upgrade to and I assume that has one of the latest builds of ffmpeg....but I can even upgrade to the latest version of ffmpeg if that helps with how it handles soft telecine.

    Currently should I treat all interlacing on DVDs the same and use the IVTC setting you gave me? If not please advise me how to proceed as I have a ton of DVDs I need to encode.

    Also, when it comes to 10 bit color HEVC.....I have a lot of black and white movies so am I correct to assume that the 10 bit color will have no affect on quality and thus there is no need to take the time penalty to encode B&W using it?

    Thanks
    Last edited by Ronstang; 1st Sep 2021 at 14:54.
    Quote Quote  
  15. Originally Posted by Ronstang View Post
    It appears from what I have already done that changing the Spatial strength will probably have the most affect due to increase in file size....which I assume is due to higher bitrate which should reduce the banding, correct?
    Yes , higher bitrate at a given QP . But it's not as ideal as using x265's aq modes, if your goal was improving dark scenes. The spatial AQ for NVEnc is like more like mode 1 for x265, so while there is some improvement it's everywhere and expecially flat areas. Mode 3 is more targetted to what you want, so more bitrate allocated to darker scenes - with mode 3 you get less filesize increase for what you want


    I also looked through some DVD rips I have in a temp folder and many are progessive scan while a few are interlaced as reported by Mediainfo. It does not differentiate between hard and soft telecine, is there some other utility I can use to find this info?
    Medianfo will generally say 2:3 pulldown and "progressive" for soft pulldown. It will say "interlaced" for hard, but you cannot tell if it's telecined or really interlaced content. But if it's a "theatrical movie", it's most likely hard telecine

    There are some variants, some mixed content, some bizarre combinations - and the only way to be 100% accurate is to examine each file , look at the fields. But you should be ok using those general guidelines

    Currently should I treat all interlacing on DVDs the same and use the IVTC setting you gave me? If not please advise me how to proceed as I have a ton of DVDs I need to encode.
    Only for theatrical "movie" DVD's or drama sitcom TV shows.

    Things like sports DVD's , reality TV, travel shows, documentaries, concerts - those are generally interlaced content

    Also, when it comes to 10 bit color HEVC.....I have a lot of black and white movies so am I correct to assume that the 10 bit color will have no affect on quality and thus there is no need to take the time penalty to encode B&W using it?
    The benefit is increased precision for the calculations , higher quality at a given bitrate . 10bit encoding is slower on CPU than 8bit , but with NVEnc it can make sense to use 10bit encoding. It even makes sense to use 10bit CPU encoding. But an 8bit B&W movie can still benefit .

    One reason you might not want to use 10bit encoding is if your playback devices are not compatible. But 10bit 4:2:0 HEVC is pretty standard in consumer land right now. Lots of hardware decoder chips available
    Quote Quote  
  16. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    Medianfo will generally say 2:3 pulldown and "progressive" for soft pulldown. It will say "interlaced" for hard, but you cannot tell if it's telecined or really interlaced content. But if it's a "theatrical movie", it's most likely hard telecine

    There are some variants, some mixed content, some bizarre combinations - and the only way to be 100% accurate is to examine each file , look at the fields. But you should be ok using those general guidelines
    So you are saying even if a DVD is reported as "progressive" it is some form of interlaced? All my movies are either theatrical movies or older TV shows. Based on this should I just run then using the IVTC parameter you provided?

    If I need to do more investigation I will. You say I may want to examine each file to be %100 accurate and I don't mind doing that if I know what to do, what to look for, and how to do it. Is there some utility I can use to help me identify the interlacing used in each?

    I do not do sports at all but I do record from cable TV a lot of shows from the History and Science Channels. Are these interlaced in a way I should continue to use yadif like I have been doing? Or would they benefit in quality from using the IVTC?
    Quote Quote  
  17. Originally Posted by Ronstang View Post
    Medianfo will generally say 2:3 pulldown and "progressive" for soft pulldown. It will say "interlaced" for hard, but you cannot tell if it's telecined or really interlaced content. But if it's a "theatrical movie", it's most likely hard telecine

    There are some variants, some mixed content, some bizarre combinations - and the only way to be 100% accurate is to examine each file , look at the fields. But you should be ok using those general guidelines
    So you are saying even if a DVD is reported as "progressive" it is some form of interlaced? All my movies are either theatrical movies or older TV shows. Based on this should I just run then using the IVTC parameter you provided?
    No, if it's progressive, it's progressive - at least for the start of the DVD. But the output signal is always interlaced - that what the pulldown flags are for - to make it compatible with NTSC equipment. It repeats fields to make up 59.94 fields/sec . 23.976p is organized into 59.94fields/s .

    However - medianfo does not scan the file. It just reads the header info in the 1st part. There are DVD's that have mixed sections, it might start out progressive and change later, hard telecine, or soft. It's not common, but it happens

    If I need to do more investigation I will. You say I may want to examine each file to be %100 accurate and I don't mind doing that if I know what to do, what to look for, and how to do it. Is there some utility I can use to help me identify the interlacing used in each?
    avisynth, dgindex . If it reports 100% film, it's 100% soft pulldown. It goes through the whole file and indexes it. But sometimes you get something like 99.67%. That means there are some sections than don't have the soft pulldown pattern, you can IVTC it anyway. Otherwise you have to examine the fields (you should be doing that anyways IMO). There are many posts that go though how to determine what you actually have, and there are really bizarre patterns out there, but usually rare

    But Hollywood movies from any decent studio, or big releases in the last 15 years are almost always >99.9% soft pulldown. You can almost just assume they are . It's the low budget studios with quality control issues that sometimes have flaky DVDs

    I do not do sports at all but I do record from cable TV a lot of shows from the History and Science Channels. Are these interlaced in a way I should continue to use yadif like I have been doing? Or would they benefit in quality from using the IVTC?
    Many of those will be interlaced content, but you have to check . History often mixes segments from different sources
    Quote Quote  
  18. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    I am very confused about how to handle my DVDs now. I tried to use dgindex but have no idea how, avisynth need virtualdub and once again I don't know what I am looking for. At the moment DVDs are low on my priority list so I will revisit that when the time comes.

    For content from the History and Science Channel and the like. You say those are interlaced. Does that mean I stick with yadiff? Use a better deinterlacer? Or use the IVTC?
    Quote Quote  
  19. Maybe this will help:

    The analog composite and s-video outputs of a DVD player were always interlaced 59.94 fields per second. That is the only thing SD CRT TVs could display.

    The contents of the DVD could be interlaced digital frames at 29.97 fps. In that case the fields from those frames were output once at a time at 59.94 fields per second.

    Alternatively, the MPEG frames could be encoded progressive at any rate from 19.98 fps to 29.97 fps, with pulldown flags. Pulldown flags tell the player how to create 59.94 interlaced fields per second from those progressive frames. The pulldown flags allow each frame to be displayed for the duration of either 2 or 3 fields. When progressive encoding was used, the frames were usually encoded at 23.976 fps and the pulldown flags alternated between 2 and 3 fields per frame -- resulting in 59.94 fields per second at the analog outputs.

    In general, you can set DgIndex to Honor Pulldown Flags mode then use TFM and TDecimate to restore the original film frame rate. TFM lets you specify the d2v file so that it can reverse the pulldown more accurately (though it's usually very accurate without the d2v data).
    Quote Quote  
  20. Originally Posted by Ronstang View Post
    For content from the History and Science Channel and the like. You say those are interlaced. Does that mean I stick with yadiff? Use a better deinterlacer? Or use the IVTC?
    Lots of the content is interlaced, I'd say mostly - but often there are progressive segments. You can't just assume, or you degrade the progressive segments. It also depends on how good of a job you want to do, some people don't care or can't be bothered to get it right. You decide on what tradeoffs you want to make

    If you're going to deinterlace, I'd use QTGMC , but it's not available in ffmpeg . It's much better for general use cases, there are many comparisons. You can test it out in some GUI's that have it like staxrip, hybrid
    Quote Quote  
  21. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    Is there a way to deinterlace without compressing....like simply deinterlace the TS files from TV and the MKV files from MakeMKV.....and then run them through ffmpeg for compression? Because this is getting tedious and complicated. I want the best quality as the movies I am keeping archived forever but I also need for find a way to do so that I can make efficient by building a plan to execute repeatedly. I get more content daily and I need to start compressing it rather soon.

    Or, what's the best deinterlace filter I can use within ffmpeg and the proper settings? I'll experiment with anything if I can learn something valuable.
    Last edited by Ronstang; 3rd Sep 2021 at 15:10.
    Quote Quote  
  22. ffmpeg accepts AviSynth scripts as input.
    Quote Quote  
  23. Originally Posted by Ronstang View Post
    Is there a way to deinterlace without compressing....like simply deinterlace the TS files from TV and the MKV files from MakeMKV.....and then run them through ffmpeg for compression?
    MakeMKV does not do any other processing .

    You can use ffmpeg processing, or use something before ffmpeg that can input or pipe directly like avisynth ,vapoursynth scripts


    Because this is getting tedious and complicated. I want the best quality as the movies I am keeping archived forever but I also need for find a way to do so that I can make efficient by building a plan to execute repeatedly. I get more content daily and I need to start compressing it rather soon.
    That' s one way to look at it.

    The other way to look at it is wasting months doing this only to find out you have bad processing, jerky playback, poor compression, duplicate frames , degraded image quality

    You're less likely to make mistakes if you use some GUI that supposedly figures it out for you like handbrake, megui, staxrip, hybrid etc... If I was a beginner that didn't want to invest time learning the proper procedures, that's what I would do.


    Or, what's the best deinterlace filter I can use within ffmpeg and the proper settings? I'll experiment with anything if I can learn something valuable.

    bwdif is probably the best deinterlacer in ffmpeg. Definitely better and faster than yadif. Estdif is ok too ,but it requires more tweaking and figuring out proper settings

    https://ffmpeg.org/ffmpeg-filters.html#bwdif

    The "proper" settings depend on the field order. If you get it wrong it will play jerky. You can leave it on auto and hope it's right. There is only 2 choices, top field first and bottom field first. So 50/50 chance. For interlaced content, I would always use mode=1, because each field becomes a frame, so you lose nothing. Single rate deinterlacing discards 1/2 the fields
    Quote Quote  
  24. TV stations can sometimes mess up interlacing.
    Quote Quote  
  25. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    The other way to look at it is wasting months doing this only to find out you have bad processing, jerky playback, poor compression, duplicate frames , degraded image quality

    You're less likely to make mistakes if you use some GUI that supposedly figures it out for you like handbrake, megui, staxrip, hybrid etc... If I was a beginner that didn't want to invest time learning the proper procedures, that's what I would do.
    I'm only really a beginner from the standpoint I realize I was doing some things wrong. Noticing the banding with HEVC was what made me stop encoding, but now I am stacking up hard drives that need to be cleared as I haven't done any encoding of movies except testing for almost a year. That's why I am here trying to learn.

    I used a GUI. MCEBuddy, but it has proven to be more problematic than helpful since it is really hard to control your settings. I do have it working decently now but it still only uses yadiff. It does not change the method per file so it is really of no use.

    I am willing to find a strategy that works with each specific content and tailor my method to each one individually. I record from only a few stations. Turner Classic Movies, Sony Movie Channel and STARZ Encore for movies. For TV the only channels I record are History, The Science Channel, and National Geographic Channel....for archiving purposes. Because of this I assume I would only have to figure out how each channel does it and tailor my settings accordingly. I have already started segregating my recordings into unique folders to facilitate this for the script a friend wrote me to extract CCs.

    So I really only have to figure out what type of interlacing each channel uses and use different methods for the ones that differ. I can tell you now that the only channels I have ever had jerky playback from was STARZ so I am hoping switching to IVTC for my movie channels corrects that. I will encode and watch one to that I know was jerky to see.

    I do not know how to use an avisynth or vapoursynth script. Is this something that has to be done on a per file basis or per settings basis so it could be used in a batch situation. I'm willing to learn but I need a little help to get started.
    Quote Quote  
  26. Originally Posted by Ronstang View Post
    Because of this I assume I would only have to figure out how each channel does it and tailor my settings accordingly.
    No, you have to figure out what recording does.

    There is a shortcut you can take that will work for all content if you don't mind wasting a little bitrate and not getting the best quality. Split it into two classes by how they're encoded: interlaced and progressive. Recompress the progressive as it is. Double frame rate deinterlace the interlaced stuff and recompress it. That will have the same smoothness as the original video when watched on TV.
    Last edited by jagabo; 3rd Sep 2021 at 20:49.
    Quote Quote  
  27. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    bwdif is probably the best deinterlacer in ffmpeg. Definitely better and faster than yadif. Estdif is ok too ,but it requires more tweaking and figuring out proper settings

    https://ffmpeg.org/ffmpeg-filters.html#bwdif

    The "proper" settings depend on the field order. If you get it wrong it will play jerky. You can leave it on auto and hope it's right. There is only 2 choices, top field first and bottom field first. So 50/50 chance. For interlaced content, I would always use mode=1, because each field becomes a frame, so you lose nothing. Single rate deinterlacing discards 1/2 the fields
    So would that mean the following would replace my yadiff string in my settings:

    bwdif=1:-1:0
    Quote Quote  
  28. Originally Posted by Ronstang View Post
    bwdif=1:-1:0
    That should work for vast majority of interlaced sources. There may be a few where the field order is flagged wrong. But probably few enough that you can assume it's flagged correctly and just run a quick check when the encoding is done.
    Quote Quote  
  29. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    Originally Posted by jagabo View Post
    Maybe this will help:

    The analog composite and s-video outputs of a DVD player were always interlaced 59.94 fields per second. That is the only thing SD CRT TVs could display.

    The contents of the DVD could be interlaced digital frames at 29.97 fps. In that case the fields from those frames were output once at a time at 59.94 fields per second.

    Alternatively, the MPEG frames could be encoded progressive at any rate from 19.98 fps to 29.97 fps, with pulldown flags. Pulldown flags tell the player how to create 59.94 interlaced fields per second from those progressive frames. The pulldown flags allow each frame to be displayed for the duration of either 2 or 3 fields. When progressive encoding was used, the frames were usually encoded at 23.976 fps and the pulldown flags alternated between 2 and 3 fields per frame -- resulting in 59.94 fields per second at the analog outputs.

    In general, you can set DgIndex to Honor Pulldown Flags mode then use TFM and TDecimate to restore the original film frame rate. TFM lets you specify the d2v file so that it can reverse the pulldown more accurately (though it's usually very accurate without the d2v data).
    All of this is very interesting, Thank you. I sort of understand it but I still don't understand how to use it. I rip my DVDs to MKV files using MakeMKV so those are the input files I have to deal with with any post processing of the actual rip. I downloaded DgIndex but I really don't understand what to do with it.
    Quote Quote  
  30. You use DGIndex to build a D2V file (File -> Save Project) then you use Mpeg2Source("filename.d2v") in a AviSynth script to open that D2V file. Then proceed with filtering. For "normal" 3:2 pulldown you can simply use:

    Code:
    Mpeg2Source("filename.d2v")
    TFM() # optionally TFM(d2v="filename.d2v")
    TDecimate()
    But DGIndex doesn't work well with MKV files. You need to use the original VOB files or remux the MKV to to an MPEG Program Stream, MPG.
    Quote Quote  



Similar Threads