Flickering of static lines after Handbrake conversion

Discussion in 'Digital Video' started by Cox Orange, Sep 19, 2012.

  1. Cox Orange, Sep 19, 2012
    Last edited: Sep 19, 2012

    Cox Orange macrumors 68000

    Jan 1, 2010

    I converted a DVD with Handbrake 9.0.1 (PPC, 10.4.11). The output format is x.264 mp4.

    It is animation, where the background is still and in the front the person is moving. The person, who is moving is fine, but the lines in the background on some items, that do not change (windows, doors, cupboards, planks) flicker. Like having one frame or picture that has strait lines and the next frame has the same lines with waves in it.
    It looks a bit like some sort of a bit heavier flickering on a TV-Tube.

    This happens on the screen of my Mac and on my CRT-TV.

    (btw. I had to use "deinterlacing" while converting, because both, my CRT-TV and on my Mac showed the typical lines you have when you watch interlaced material on a device that needs deinterlaced material, but shouldn't the Tube be fine with interlaced?)
  2. HobeSoundDarryl macrumors 603


    Feb 8, 2004
    Hobe Sound, FL (20 miles north of Palm Beach)
    First, consider updating Handbrake to a much newer version. I think 9.4 or 9.5 still had versions for PPC.

    Second, try decomb instead of deinterlace.

    Third, slide the constant quality slider down a notch or two from the default (this improves the quality by reducing compression). You don't want to overdo this- just a notch or two.

    Static horizontal lines of high contrast will jiggle slightly in MP4 video. The above tips might help some.
  3. Cox Orange thread starter macrumors 68000

    Jan 1, 2010
    Thank you very much!

    So jiggling of horizontal lines is quiet common with mp4, as I understand from your post.

    Unfortunately 9.0.1 is the last for 10.4 and 9.4 would be for 10.5 which I tried, but it makes the x.264 encoded files more incompatible with my older (weaker) Macs. (I will perhaps have to decide whether I better sacrifice compatibility for better results, though. I did not make a decision here).

    Decomb is not available in 9.0.1, but in 9.4.

    I had mistaken the Constant Quality slider for "constant bitrate", so I tried a bitrate setting of 1500kbit/s, because mediaInfo says those files are VBR.

    Unfortunately 9.0.1 hasn't the "RF"-slider, that 9.4 has. The slider is at 50%. From the Handbrake Wiki an RF of about 19 is best, which, if I am not wrong, must be something around 68%. What Percentage would you recommend (since 68% seems not to be just a notch away from 50%).

    Thanks for any further advice!

    PS: any recommendations for advanced settings (regarding animation)? I did the following things (see picture), didn't use the "weighted B-frames" and "B-frame Rate Distortion" as you see. The other things I did not choose, because it said, that it would make it more incompatible with some equipment (some mediaplayers, or Quicktime). Don't mind my question, if this goes to far. (I know it slows down the encode, but time isn't a matter here.

    Attached Files:

    • hand.jpg
      File size:
      205.6 KB
  4. HobeSoundDarryl macrumors 603


    Feb 8, 2004
    Hobe Sound, FL (20 miles north of Palm Beach)
    Sorry, I can't be too much help with that version of Handbrake. It was a long time ago for me.

    I know at least one version of HB around that level had a dedicated preset for animation called "animation". If you have that, try it for your animations.

    I recall that back when I couldn't use Constant Quality, I used 2-pass, 2500 for all encodes. That was overkill but I was chasing highest quality even at the expense of wasting some file space. However, last few versions I've switched to Constant Quality and been happy with the results.
  5. Menneisyys2 macrumors 603

    Jun 7, 2011

    Can you make part of the original material public so that I can test it with different deinterlacing settings in both Episode (which has excellent deinterlacing support, even with frame rate doubling) and X264? Some 40-50 seconds would do, assuming they're affected by flickering.

    Basically: it's only with full motion compensation that you can completely get rid of flickering (almost-)horizontal lines. Most other, computationally less intensive, but non-blending* method produce flicker.

    *: blending is the worst possible method as it throws away half of the vertical resolution. However, it's free of flickering. You could give a try to it in HB - just set "Deinterlace" (not the default Decomb!) to "Fast". Then, it'll just blend.

    Again, you won't want to use this setting for final decomb/deinterlacing. It's just a test to find out whether it's the deinterlacing method that is causing the flickering. (I'm 99% sure it is.)
  6. Cox Orange thread starter macrumors 68000

    Jan 1, 2010
    @HobeSoundDarrel: yes 9.0.1 is the one with that "animation" preset. It is set at 1000kbit/s and has some similarities to what I have chosen, but it has a high profile feature checked, that makes it more incompatible. This is a reason, why I didn't use this and tried to figure out my own "custom" preset. Btw. second reason is that it has 1000kbit/s and I am not so sure, if that will look good on a big LCD screen, when I once will have one. So I thought I try 1500kbit/s as a compromise. Did try higher ones (up to 3500kbit/s) but I couldn't see a difference.

    Then in the end now I think I will keep the Images and then convert the files new, when I have an LCD. Meanwhile I convert them for my Tube, to put them on the HDD connected to my "mediaplayer".
    Why do I think this? First I am unsure about the bitrate for the LCD, secondly I read, that LCDs do need deinterlacing, but Tubes not. Since I saw, that for some reason my Tube needs deinterlacing, I am a bit puzzled.

    You got a Message :)

    I am through several trial and error runs. I remember, when I had it without "deinterlacing" I had lines like in the picture here
    when I used "deinterlacing: fast" I could see now difference, so I chose slowest and finally the moving objects looked clean.
    But then I got the flickering problem, which led me here :)
  7. Menneisyys2, Sep 21, 2012
    Last edited: Sep 21, 2012

    Menneisyys2 macrumors 603

    Jun 7, 2011
    Yup, in general, LCD's need quality deinterlacing prior to playback, unlike CRT's. The latter prefer interlaced content.

    BTW, I've thought of your case. It's pretty strange that it's a cartoon(?) and you're still seeing interlacing artifacts: after all, the speed of cartoons never exceed the movie 24p (in general, not even 16p); that is, there should never be interlacing effects at all, neither when played back from DVD's nor when broadcast via TV (both analogue and digital). The situation is similar to standard 24p movies played back from DVD's or broadcast - while they are, technically, transmitted / played back as interlaced, they're progressive segmented frames ( http://en.wikipedia.org/wiki/Progressive_segmented_frame ) .

    EDIT: 1.)
    the above explanation also explains why there'll never be "combing" on an LCD when you watch 24p movies broadcast via 50i DVB - as opposed to, say, direct sports broadcasts utilizing the 50 Hz rate. The very rare exceptions are mostly indie movies / docus recorded at 50i/50p themselves - or some high-quality movies double-framed before broadcast (this happened to "300" in Finland, for example).

    2.) I think I know the answer to your problem (that is, "combing" artifacts). For some reason, the player has taken even fields to odd - hence the combing. Try deinterlacing with the opposite even/odd field order - or configuring the player to switch to the other one (if it's able to).
  8. Mr. Retrofire macrumors 601

    Mr. Retrofire

    Mar 2, 2010
    Use the following encoding options, if your targets are older Macs, iDevices or media players:
    - Disable CABAC (requires a lot of CPU time, if the target machine does not support HW-accelerated H.264-decoding) (--no-cabac)
    - Define clear bounds for the key-frames. Set min-keyint/keyint to
    24/240 for 23.98 FPS and 24 FPS material (--min-keyint 24 --keyint 240)
    25/250 for 25 FPS and 50 FPS material (--min-keyint 25 --keyint 250)
    30/300 for 29.97 FPS, 30 FPS and 60 FPS material (--min-keyint 30 --keyint 300)
    - Reduce the maximum number of B-frames to 2 (--bframes 2).
    The settings above need a higher bitrate (20 percent higher should be enough) because they reduce the encoding efficiency of the H.264 encoder.

    Animation specific settings include reduced motion estimation (--me hex) and the "spatial" prediction mode (--direct spatial).

    A full list of x264 settings is here:

    You can use them in the HandBrake commandline parameter field.
  9. Cox Orange thread starter macrumors 68000

    Jan 1, 2010
    Sorry, for answering that late!

    Thanks Mr. Retrofire for the recommendations for older Macs etc.!

    Since Handbrake doesn't offer "odd frames first", I tried mpegstreamclip, which has that (it says upper or lower frame first, or something like that).

    On my ibook G4, were I do not have mpeg2 installed, it first said the first part of the video was invalid and offered to "abort" or "go on". I went on and than it said, it had timecode errors "repair?" or "abort". I repaired. Then when it was ready and I wanted to convert a small piece (had cut off the rest) and chose "lower field first" it, of course said, the mpeg2 component was missing. Which I knew.
    Why I tell this is, because I find the timecode errors interesting.

    On my PowerMac G4, were I have mpeg2 installed I tried it with the original DVD of Series Special of the same cartoon. It said "first part is invalid", I chose "go on". after 2 hours of a spinning wheel I aborted the task. Then I went back and chose "second part of the video". Result was the same.
    Then I tried an Image of one of my DVDs (same series cartoon, different episode) that I allready had on the Mac. Same problems "first part of the video is invalid". I then went on and got to put the "in" and "out" of the video, but it did not highlight the areas and gave the spinning beach ball.

    Since all episodes (from different DVDs) I tried to convert for trial and error have the flickering problem, I thought it doesn't matter which DVD I try for getting rid of the flickering by choosing "odd fields first".

    Side note: It is an astonishing miracle to me, that I seem to have all problems that I could have with video conversions, while others seem to have no problems. (I tried clipgrab in connection with rewrap for mts files and I failed, I tried burning one of the DVDs, to not harm the origininal while doing the next thoudand trial and errors and Toast Titanium failed to compress the carton speacial (5,7GB) by 19% to fit on the 4,5GB DVD, so I took a dual layer one, which than worked fine without compressing.)
  10. Menneisyys2 macrumors 603

    Jun 7, 2011

    Strange - in my tests, ClipWrap 2 has turned out to be great - much more reliable than VoltaicHD. Nevertheless, it's very expensive and I don't think one should prefer it with a much cheaper but, for MTS remuxing, great alternative (iVI) around. (BTW, did you try the trial version of the latter?)
  11. Cox Orange, Jan 14, 2017
    Last edited: Jan 14, 2017

    Cox Orange thread starter macrumors 68000

    Jan 1, 2010
    After some years of getting confronted with that problem several times I might have found a reason for this specific symptom.

    It seems (I am not 100% sure, a Pro would have to test) that telecining has to do with it. It seems that several people have this with modern cartoon series (examples I found included Simpsons and Futurama and a dutch series called "Conni"). The content might have been produced in NTSC and when converted for the EU* market it got telecined and introduced these problems. (* why then with the dutch series? Because a lot of european series are made in Japan and only voiced in the EU). Another reason btw. could be that several cartoon painting teams are painting on different scenes for the same project, but using different parameters and didn't have the time to equalize parameters when puting the scenes together.

    A solution for some seems to be using variable frame rate and/or the de-telecine filter. (I have to look into this for myself some time, because what I found on the net is not very explicit on wether this really solved it or was merely a "try this" recommendation).
    Don't confuse "de-telecine" with "de-interlace". Don't use de-interlace, first try "decomb: default"

    Apart from that!
    What we were debating in this thread here was "combing". However the symptoms I described are not combing. I have combing and that can be solved by activating "decomb: default" in Handbrake, but "combing" looks different.
    In combing: you see horizontal lines in the movie in an object that itself is moving, see here gif https://web.archive.org/web/20160609142254/https://trac.handbrake.fr/wiki/DeinterlacingGuide
    in telecine: you see a house drawn in 3D, so you see diagonal lines. These lines will "shimmer". It is with static drawn lines, these look as if they were "blinking".

    Edit: [I might add that the above symptom is usually seen with cartoon content from DVD. I myself saw this issue even with an *mts stream of a cartoon series broadcasted by a german public TV channel, recorded on my PVR. SO they might have themselves taken the DVD edition as a source.]

    Regarding telecineing I will add the following link for sake fo completeness, though it shows a completely different symptom from what I am describing (this in fact looking a bit like a combing/interlaceing artefact, which I described under "in combing") https://web.archive.org/web/20160609142256/https://trac.handbrake.fr/wiki/Telecine (please don't get confused when watching this articles examples).

    Edit-3: more about it / sources https://forum.handbrake.fr/viewtopic.php?f=11&t=5460&p=32222&hilit=Family+Guy#p32222 (ignore the interlude discussion about audio) and post #7 http://forums.macrumors.com/threads/best-handbrake-settings-for-cartoons.513615/

Share This Page