Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

How to deinterlace mts video?

9ine
Beginner
2,473 Views
What is the interlacing used in the sample image attached?
It is present in motion regions only in mts video (stream: mpeg2tts, type: h264)
I'm using UMC to extract images from video files. I tried all DeinterlacingMethod:: parameters in CodecPipeline::SelectVideoDecoder() but without any visual result.
Can you test that image explicitely with deinterlacing functions from ippi?
Maybe parameters in UMC deintelacing is not correct.
0 Kudos
11 Replies
levicki
Valued Contributor I
2,473 Views
If you open the video in any program that can show it frame by frame, check if you have some of the frames which are not interlaced in the stream. If so, then you should not deinterlace it, but perform reverse telecine instead. Not sure if that can be done with UMC though.

Another option is that the video source was already messed up when encoded (i.e. that interlaced content has been fed into an encoder which did not recognize it but just encoded it as progressive), in that case I am afraid there is nothing you can do to restore image quality.
0 Kudos
9ine
Beginner
2,473 Views
If I open it in media player classic and press still button all the frames appear deinterlaced. There are no such interlaced motion regions.

I believe the solution is simple, for me interlacing seems to be removal of odd or even lines and interpolation back to original size.

I do not know why UMC can not handle that and asked to test it with IPP functions directly.
0 Kudos
levicki
Valued Contributor I
2,473 Views
Ok, maybe I did not express myself very well.

Try opening the file using a tool or a video editor that does not deinterlace automatically such as VirtualDub. Then check if some frames are interlaced and some not as I suggested.

VirtualDub - http://virtualdub.org/
MPEG2 input plugin (goes into Plugins32 folder) - http://fcchandler.home.comcast.net/~fcchandler/index.html

Interlacing is not "removal of odd or even lines and interpolation back to original size".

Deinterlacing is not that simple either. True, it can be as simple as you described, but the resulting video quality will be very poor.
0 Kudos
9ine
Beginner
2,473 Views
Sorry, I meant deinterlacing is the removal of odd or even lines and then interpolation back to original size.
That works with the image I uploaded. Of course the detail is lost.

I'm sure without the use of the video player that using no deinterlacing or any kind of UMC deinterlacing produces the same effect. In no motion region there is no interlacing. But in motion regions the is interlacing.

My target is topresent those videos in HD quality despite how they were recorded.
I do not understand the problem for UMC. If the interlacing is standard it should remove it.
Otherwise there is no use of those options in the pipeline if they can not cope with simple interlacing.

If there are other video samples with interlacing that UMC can handle please let me know I'd like to test them to make sure if UMC can deinterlace at all or not.
0 Kudos
9ine
Beginner
2,473 Views
>>How to remove interlaces from the recorded MTS/M2TS videos by using AVCHD camcorder like JVC GZ-HM400, JVC GZ-HD10,

What is the algorythm behind that tool?
Does UMC deinterlacing allows that motion compensation?
0 Kudos
levicki
Valued Contributor I
2,473 Views
You still do not understand what I am saying.

There are two types of videos that look like they are interlaced, but only one of them is really interlaced. The other one is 2-3 pulldown where you have a repeating pattern of interlaced and non-interlaced frames. 2-3 pulldown cannot be deinterlaced using standard deinterlacing -- it requires reverse telecine process (IVTC).

At this point it might be the best if you can upload a sample of your video to some hosting site such as megaupload.com and post a link here so we can examine it and figure out what seems to be your problem.
0 Kudos
9ine
Beginner
2,473 Views
That will be of great value if you could solve the problem with UMC.
As only IPP provides those tremendous performance in HD video decoding.

I posed that question before but without solution
http://software.intel.com/en-us/forums/showthread.php?t=79348&o=a&s=lr

The rapidshare link is:
http://rapidshare.com/files/436123265/00003.MTS

Correct me if I'm wrong. I learned that mts stream produces odd and even frames coming after each other.
Odd frame contains only odd rows from the entire 1080p frame and even frame contains only even rows.
Full frame is composed from those odd/even pairs.
If there is motion between odd and even capture then entire frame is interlaced exatly in motion regions.
And that interlacing is not handled by UMC
0 Kudos
9ine
Beginner
2,473 Views
I've also attached small mts file for a quick evaluation.
Around 00:00:03.102 there is camera movement and interlacing is present over entire frame.
In other regions only around moving persons that interlacing is visible.
0 Kudos
levicki
Valued Contributor I
2,473 Views
The small part of AVC-HD video you attached (00040.MTS) is indeed tagged as Interlaced, Top Field First, frame rate is 29.97 FPS. It should be deinterlaced.

What you refer to as even and odd frames are fields (two fields combined make a frame).

With simple deinterlace, if you blend fields where motion is present you will get ghosting.

I really do not understand why you are getting residual interlace artifacts in motion areas -- they should not be there. At least now some Intel developer can download video sample and check it out.

If you do not get response here, please submit the issue on premier.intel.com and direct them to this thread for more information.
0 Kudos
9ine
Beginner
2,473 Views
I've attached the logic I'm using to setup UMC and grab frames.
But it never arrives to umc_deinetrlacing.cpp e.g.Status Deinterlacing::GetFrame(MediaData *input, MediaData *output) as I set break point there.
0 Kudos
chris_k_1
Beginner
2,473 Views

It's not a bit hard if you try Brorsoft MTS Converter to deinterlace your MTS video clips.

0 Kudos
Reply