Encoding an Interlaced source into an Interlaced x264 format

Discussion in 'General Software Discussion' started by Judas, Sep 21, 2012.

  1. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    What i've learnt about encoding video.. is that if the source is interlaced... it's best to keep it that way and allow the hardware/software decoders do the work of determining how to display it.. and NOT encode in a progressive de-interlaced format as it makes a pile of mistakes that are impossible to resolve..

    TL;DR

    De-interlaced encoding = pwuke compared to original interlaced.

    What i need to figure out is how to force basically transcoding of a interlaced source to interlaced x264 (mp4). Can't seem to find anyone that knows wtf to do.
     
  2. Trusteft

    Trusteft HH's Asteroids' Dominator

    Joined:
    Nov 2, 2004
    Messages:
    23,718
    Likes Received:
    3,490
    Trophy Points:
    153
    Who creates interlaced video now days?
     
  3. Trusteft

    Trusteft HH's Asteroids' Dominator

    Joined:
    Nov 2, 2004
    Messages:
    23,718
    Likes Received:
    3,490
    Trophy Points:
    153
    What do you mean it looks bad? It will probably have half the resolution, because, well, that's normal. Or are you referring to something else? I would love to have a look at de interlacing, but I don't even have any interlaced video that I know of.
     
  4. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    I figured it out..

    The problem with de-interlacing or "encoding" an interlaced video to a progressive format is the blending methods of the interlaced frames to produce a progressive video.... it looks damn ugly....

    The benefit of creating a pure interlaced video file is that it keeps the original interlaced format in tact. The main benefit of this is that instead of the crummy de-interlacing solution built into a encoder, you use the hardware or displays own way of displaying interlaced content which usually produces a significantly superior image/playback.

    I had to fix the input source conversion to state true for interlaced... and then set the output -tff to specify that the output format is top feild first interlaced. The resulting encoding time was inceased however by about an hour due to the extra work.... but the end result was a much better looking image when using software/hardware decoding that deals with interlaced content better than de-interlacing at the encoding level.

    Here are the results of what it looks like using the de-interlacing functionality of the hardware/software of a media player...

    Keep in mind.. this is a DVD rip (so original source is 480i widescreen)

    [​IMG]
    [​IMG]
    [​IMG]

    Now i don't have the same frame in the original format when it was encoded/converted to progressive via encoding de-interlacing... but i guarantee you... the result was "very" blurry/crummy looking.


    Not bad, 509MB file with 2 audio streams included.... Primary is english 2 channel Stereo AAC 96kbps and the secondary stream is English 6 Channel 5.1 Surround Sound AAC 192kbps

    The video encoded is approximately 300MB in size and the stereo steam is 50mb and the 5.1 channel stream is 150mb in size.

    Although i KNOW that AAC 5.1 has backward capable 2 channel stereo... MOST devices don't seem to like the 5.1 AAC format resulting in it refusing to play it. Apparently xbox360 and ps3 and numerous apple products as an example.... This is why the primary channel is pure stereo AAC and the 2nd is 5.1 so that those people that want to play it on anything it'll work out of the box.. and those that want 5.1 ... should also work out of the box or by select 5.1 where available.

    Either way... I think the results are fantastic. I could probably drop the video bitrate down a little further yet and still retain great quality.
     
  5. Trusteft

    Trusteft HH's Asteroids' Dominator

    Joined:
    Nov 2, 2004
    Messages:
    23,718
    Likes Received:
    3,490
    Trophy Points:
    153
    I am glad whatever it is you are doing works for you, but I still have no idea why you use interlaced videos to begin with.
     
  6. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    Because the source is interlaced....

    I cannot get a progressive source..

    So.... if the source is interlaced.. then the final product should remain interlaced so that it retains as much quality as possible and doesn't turn into a ugly progressive video...

    If i had a blu-ray source.. i would have used that.
     
  7. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    Came across a bluray that i've been battling to convert into a good mp4..

    After scratching my head i finally realized i was doing it all wrong.

    The Bluray is "LOST IN SPACE" from 1998.... i was surprised to find out it was a 1080i format.. using MBAFF which is kinda hybrid of interlacing. Either way the above images and stuff is what happens when you keep the interlaced content and format it into a x264 (which coincidentally creates a MBAFF format)

    So.... now..... apply the same ConvertToYV12(Interlaced=true) for the source/input.. and then for output using the --TFF flag, should result in a properly handled pull up (29.97fps NTSC) to the common standard of 23.976 (least i hope so)...

    I know the last mimzy was a 29.97fps NTSC format and when i plugged in the numbers right it came out as 23.976 MBAFF x264 and looks great.

    I'll post the images after... i just know the current few encodes i've already done look butt ass ugly.... the deinterlacing and or various modes to try and sort it out just made it look worse and more worse... intollerable.
     
  8. bunklung

    bunklung New Member

    Joined:
    Jan 1, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Interlaced handbrake 0.9.8 support:
    1) set to dvd preset
    2) add :tff OR :bff in the advanced tab, put at end (append).
    3) turn off all filters: set to off, set fps to same as source and constant.
    Use mediainfo and set to sheet to find if tff or bff
    4) feel free to set resolution, etc


    It's all about retaining motion resolution. De-interlacing is done much better in hardware. It's surprising how many people don't understand interlacing and de-interlacing concepts.

    Hope this helps others.
     
  9. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    I'm aware of that bunklung.

    Though Handbrake imo is kinda terrible.

    The tff/bff isn't mentioned for quite a number of formats.. specially when they use a hybrid interlaced/progressive method.... for example some blurays use MBAFF.

    x264 doesn't support pure interlaced, it's interlaced option is MBAFF as well, which like i said is a hybrid of progressive and interlaced, imo kinda irritating.
     
  10. bunklung

    bunklung New Member

    Joined:
    Jan 1, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Yeah, it's not perfect, but it's better than going progressive with half the motion because half the fields are dropped. And the later is seriously 99% of all content you find.

    Netflix drops interlacing and fields.

    I wish x.264 did true interlacing too. Again, MBAFF is superior than nothing.



     
  11. Judas

    Judas Obvious Closet Brony Pony

    Joined:
    May 13, 2002
    Messages:
    39,621
    Likes Received:
    1,490
    Trophy Points:
    138
    indeed MBAFF is indeed better than nothing or forcing everyone to de-interlace or attempt to encode with bleeding black lines for each frame.

    It'll be nice when interlaced anything including 1080i is completely extinct.
     
  12. zonish

    zonish New Member

    Joined:
    Feb 23, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for the suggestion! Much appreciated!
     
  13. Absolute0

    Absolute0 New Member

    Joined:
    Feb 24, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Thank you so much for the suggestion to keep interlaced video as interlaced when encoding to different formats or editing. I found this thread because of an update that was made to Handbrake, which allowed for an option to specify 'top field first' :tff in the advanced options tab. Most other video converters forced their encoding to be in progressive format.

    My camcorder (Canon HF-M300) is able to record video in either 1080p30 or 1080i60. The latter is much, much better for recording people in motion such as sports. When I play back the recorded video in VLC media player, my processor cannot keep up when trying to deinterlace the video and I have an Intel 4670k. This is because VLC is only a single threaded application. When using MPC-HC with the madVR video output pluging, it uses my video card to assist in video playback. There is a DEFINITE increase in quality when viewing 1080i60 video at 60fps as opposed to a deinterlaced version at 30fps, shown especially when objects are moving in the scene. When I am encoding video from my camcorder, if it is converted to a progressive format then the motion is choppy compared to the original.
     

Share This Page

visited