4

I've got an MKV file whose source is interlaced NTSC MPEG-2 video. I converted it to H.264 MKV with HandBrake, but this process did not set the "interlaced" flag in the MKV file. The content is interlaced—and I do want it to stay interlaced because it looks much better playing back as 60 fields-per-second content with on-the-fly deinterlacing than it does as 30 frames-per-second content that's been deinterlaced at encode-time.

I tried this...

mkvpropedit -e track:v1 -a interlaced=1 foo.mkv

which did indeed set the interlaced bit...

|+ Segment tracks
| + A track
|  + Video track
|   + Pixel width: 704
|   + Pixel height: 480
|   + Display width: 625
|   + Display height: 480
|   + Interlaced: 1

But when I play the video with VLC with Deinterlace set to Automatic, it doesn't think the video is interlaced and therefore doesn't do the deinterlacing.

What am I doing wrong?

Software versions:
HandBrake 0.9.5
mkvpropedit v5.0.1
Mac OS X 10.7.3

Todd Lehman
  • 2,880
  • 1
  • 26
  • 32
  • 1
    Possible [VLC options](http://wiki.videolan.org/VLC_command-line_help) and search for keywords like `interlace` and `deinterlace`. Maybe some VLC features don't work well under MacOSX for certain VLC version. You can try the nightly build versions of VLC from their website. – ee. Feb 15 '12 at 07:49
  • 1
    Have you tried VLC itself to transcode your MPEG2 video and save into a file since internally it uses FFmpeg plugin for some of its features. – ee. Feb 15 '12 at 07:52

2 Answers2

3

to make handbrake set the interlaced flag:

-use H.264(x264) Video Codec

-at the bottom of the Advanced Tab add :tff or :bff, ( dependant if source is top field first or bottom field first)

Joachim O.
  • 31
  • 2
1

I would recommend trying FFMPEG.

Documentation: http://ffmpeg.org/ffmpeg.html

‘-ilme’
Force interlacing support in encoder (MPEG-2 and MPEG-4 only). Use this option if your input file is interlaced and you want to keep the interlaced format for minimum losses. The alternative is to deinterlace the input stream with ‘-deinterlace’, but deinterlacing introduces losses.

Since you mentioned you are on OSX 10.7 you can use MacPorts to install all dependencies + ffmpeg for you (once the deps are installed you can also build the latest from git).

http://www.macports.org/

(You must be comfortable with the command line for all these tools.)

Timeout
  • 7,759
  • 26
  • 38
  • Hmm, ok, so HandBrake lets me set the Video Codec to "MPEG-4 (FFmpeg)". Is it better to convert MPEG-2 to MPEG-4 than to H.264? (I'm much more concerned about accuracy than about file size.) – Todd Lehman Feb 15 '12 at 02:43
  • 1
    @ToddLehman If file size doesn't matter, overall it doesn't matter as much. By they way, H264 is mpeg4 (specifically MPEG-4 AVC). But you'll likely have to use a higher bitrate for mpeg4 to achieve the same quality. Someone did a comparison here: http://metroxing.blogspot.com/2006/10/handbrake-mpeg4-or-h264.html – Timeout Feb 15 '12 at 02:47