Is there a guide to properly deinterlace broadcast TV to mkv/h264?

lightsout

New member
Maybe I am just not looking int he right areas but I thought this would be one of the main tasks that videoredo was used for. Grabbing 1080i OTA or cable and converting to h264/mkv. The stuff that you can download on the net (piracy I know but just making a point) that has an HDTV source is deinterlaced and converted to 23.976.

Is that an option for this software? I have been messing with a 1080i sample all day, if I set it to no deinterlace (on the mkv h264 profile) it looks great, but it is still interlaced so some clients will struggle to play it.

If I set any option for deinterlacing such as smart or auto I get flickering red and green colors in the video, I am linking to a screen grab.

I must just be doing something wrong, but not sure what it is.

 

jmc

Active member
Maybe I am just not looking int he right areas but I thought this would be one of the main tasks that videoredo was used for. Grabbing 1080i OTA or cable and converting to h264/mkv. The stuff that you can download on the net (piracy I know but just making a point) that has an HDTV source is deinterlaced and converted to 23.976.

Is that an option for this software? I have been messing with a 1080i sample all day, if I set it to no deinterlace (on the mkv h264 profile) it looks great, but it is still interlaced so some clients will struggle to play it.

If I set any option for deinterlacing such as smart or auto I get flickering red and green colors in the video, I am linking to a screen grab.

I must just be doing something wrong, but not sure what it is.

No telling exactly what you are getting with OTA capture.
Perhaps try other container types such as .mp4 or .m2ts and see how it goes.

H.264 will deinterlace but X.264 has a problem with 3:2 pull down files (NTSC) and will not.

I only saw black on the link you put here.
 

lightsout

New member
I attached the info for the file.

I see so many x264 files that are deinterlaced, does that mean there was another step in the process?

I have tried mp4 as well, didn't help.
 

Attachments

jmc

Active member
I attached the info for the file.

I see so many x264 files that are deinterlaced, does that mean there was another step in the process?

I have tried mp4 as well, didn't help.
With VRD, only the Pro version has X.264 (uses twice the cores (10-11) then H.264 does (5 +/-) ) and I have to
use TMPGEnc to encode the NTSC 3:2 pull down programs with because of the Pull Down bug.
And that is several time slower then VRD. :(

I think we all get X.264 when the Version 6 of VRD is released and pray that the X.264 Pull Down bug is fixed!

You can try another X.264 program - HandBrake and see if you have the same problems.
https://handbrake.fr/

Just from the bits and pieces I've read here, video capture can get a lot of odd errors that are hard to handle.
I don't really "capture OTA" myself.

Try another file sample and see if the same problem shows up.
There is "Quick Stream Fix" but I believe that is mainly for Video/Audio timing issues.

Did not notice any problem with the MediaInfo Text file info but then I'm no expert there.
Guessing that there are errors here and there in the video file you are working with.

Good luck!
jmc
 

lightsout

New member
With VRD, only the Pro version has X.264 (uses twice the cores (10-11) then H.264 does (5 +/-) ) and I have to
use TMPGEnc to encode the NTSC 3:2 pull down programs with because of the Pull Down bug.
And that is several time slower then VRD. :(

I think we all get X.264 when the Version 6 of VRD is released and pray that the X.264 Pull Down bug is fixed!

You can try another X.264 program - HandBrake and see if you have the same problems.
https://handbrake.fr/

Just from the bits and pieces I've read here, video capture can get a lot of odd errors that are hard to handle.
I don't really "capture OTA" myself.

Try another file sample and see if the same problem shows up.
There is "Quick Stream Fix" but I believe that is mainly for Video/Audio timing issues.

Did not notice any problem with the MediaInfo Text file info but then I'm no expert there.
Guessing that there are errors here and there in the video file you are working with.

Good luck!
jmc
Thanks for the reply, I think the video is clean because I did try handbrake and it looks great. I thought videoredo would do it all, but maybe I will use handbrake for commercial cuts.

But I agree I need other samples, those will come in the next couple day, I didn't realize we couldn't use x264 without pro, and that there was a pull down bug, thanks for the insight there.
 

jmp

New member
Hello,

I do not see the point between x264 and H264. If I am right, x264 is one of the available codec libraries to encode (and decode) video in H.264 which is a compression standard:
https://en.wikipedia.org/wiki/X264
https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

I do not know what VRD uses to deinterlace (I am waiting the V6 version to buy it once we better know the features :love: since I need Smart Rendering). Deinterlacing while keeping a very high quality is quite hard. When dealing with interlaced (or even badly interlaced progressive) movies, I personnaly use QTGMC script (the link below is only for your information):
http://avisynth.nl/index.php/QTGMC

It is implemented as a standalone script for Avisynth (and perhaps Vapoursynth): it can deinterlace, denoise, sharpen, etc. I currently use StaxRip which has it as a built-in function. Both QTGMC and StaxRip are not very easy to handle but it is worth learning (from my opinion, if you really want maximum quality).

So if VRD outputs good interlaced material (seems to be from your first message), I would use Smart Rendering from VRD to output lossless interlaced video without the commercials and then use for example StaxRip for encoding this video to progressive (using QTGMC in slow mode for example). QTGMC output has a double framerate (interesting for some uses such as badly deinterlaced materials) so you need to add a filter "selectodd" or "selecteven" to drop half the frames.
 

Dan203

Senior Developer
Staff member
We do not support reverse telecine, which is what's required to convert 29.97 to 23.976. Even if we did it's almost impossible to do this correctly with content recorded from TV. Most content you record from TV, even OTA, has gone through several levels of recoding, and has had commercials inserted, which changes the cadence and makes it impossible to reverse out the interlacing like you want. This really only works for things like DVDs where the video was converted from film directly to 29.97 or if you have access to the national feeds where the source has only been recoded once. (we have a member here named Mr.Video who uses a BUD to do this, and even he has to be very, very, careful about cutting the commercials so he doesn't mess up the cadence)
 

lightsout

New member
Hello,

I do not see the point between x264 and H264. If I am right, x264 is one of the available codec libraries to encode (and decode) video in H.264 which is a compression standard:
https://en.wikipedia.org/wiki/X264
https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

I do not know what VRD uses to deinterlace (I am waiting the V6 version to buy it once we better know the features :love: since I need Smart Rendering). Deinterlacing while keeping a very high quality is quite hard. When dealing with interlaced (or even badly interlaced progressive) movies, I personnaly use QTGMC script (the link below is only for your information):
http://avisynth.nl/index.php/QTGMC

It is implemented as a standalone script for Avisynth (and perhaps Vapoursynth): it can deinterlace, denoise, sharpen, etc. I currently use StaxRip which has it as a built-in function. Both QTGMC and StaxRip are not very easy to handle but it is worth learning (from my opinion, if you really want maximum quality).

So if VRD outputs good interlaced material (seems to be from your first message), I would use Smart Rendering from VRD to output lossless interlaced video without the commercials and then use for example StaxRip for encoding this video to progressive (using QTGMC in slow mode for example). QTGMC output has a double framerate (interesting for some uses such as badly deinterlaced materials) so you need to add a filter "selectodd" or "selecteven" to drop half the frames.
I'll look into this, I actuallt tried to install staxrip the other day, it got stuff trying to install one of the filters, I think it was called FTTW or something like that, couldn't connect to the server, I downloaded it manually but wasn't sure how to make it work so I gave up.
We do not support reverse telecine, which is what's required to convert 29.97 to 23.976. Even if we did it's almost impossible to do this correctly with content recorded from TV. Most content you record from TV, even OTA, has gone through several levels of recoding, and has had commercials inserted, which changes the cadence and makes it impossible to reverse out the interlacing like you want. This really only works for things like DVDs where the video was converted from film directly to 29.97 or if you have access to the national feeds where the source has only been recoded once. (we have a member here named Mr.Video who uses a BUD to do this, and even he has to be very, very, careful about cutting the commercials so he doesn't mess up the cadence)
Hey thanks a lot I appreciate the heads up, I think I will be happy just to edit commercials and leave it be, for stuff I want to archive I may spend some time on.
 

Otter

Member
Why are you even trying to convert files to 23.976???

A long time ago, cameras used film to capture programs. The choice of 23.976/24 fps was a compromise. It was the slowest frame change that seemed smooth to most people and yet used the least amount of expensive film stock.
When "filmed" programs were broadcast on television, they had to be converted to either 25fps for the Brits or 29.97 for US to match CRT refresh rates. The usual way was to repeat alternating frames in a 3:2 ratio.
To try to get back to the "true" look of the film, various ways were developed to reverse the telecine process - hence the idea that converting back to 23.976 is a good idea.

It is not!

Most of today's programs are filmed with digital cameras that capture 25, 50, 30 or 60 fps in progressive frames, not interlaced. When broadcast, the original digital video is converted to 720p or 1080i solely to use less bandwidth.
Additionally, the 1080i "interlace" is not the old-time 3:2 telecine that used a constant, predictable pattern from the beginning of a video to the end. Like variable bitrate to allocate more data to detailed scenes or action, variable frames are used in what is called "hybrid interlace" in which some areas of the video are interlaced and some not. There is also not a uniform pattern throughout the video, so "reverse-telecine" filters will make a jerky mess of the hybrid video.

The resulting 23.976 file makes even less sense when you go to play it back. You are not going to watch it on a old theater movie projector that ran at 23.976 film speed. Anything you will play your video on will be a digital screen refreshing at 25/50/30/60 frames per second requiring the video to be converted back to one of those, either reintroducing some sort of telecine scheme or by the GPU trying to interpolate in-between frames on-the-fly.
All of this lessens the final quality, so why do it in first place?

If you ripped a commercial DVD to TS - AND it is already 23.976 because the original was on film - Great! Otherwise, leave the frame rate alone.
Same goes for UK sourced material broadcast on US tele. The conversion from 29.976 back to 25fps will not get you the original UK version back. There will not be a repeatable pattern that can be reversed by a simple de-telecine. I you have cut out any "adverts" or any "pledge" segments, you introduced more discontinuities to the frames.

If your intent was to make the video smaller, think again... modern encoders accomplish their "magic" by comparing frames and encoding their differences. Even with traditional 3:2 telecine, the "repeated" frames take almost no data to encode. Important frames are detailed, but most are encoded with only some details and lots of referances to other frames. The inclusion of any 3:2 repeated frames adds only a handful of bits to the encoded stream - the digital equivalent of "do that one again" as the previous frame has already been decoded and is in the video buffer.
 

lightsout

New member
Why are you even trying to convert files to 23.976???

A long time ago, cameras used film to capture programs. The choice of 23.976/24 fps was a compromise. It was the slowest frame change that seemed smooth to most people and yet used the least amount of expensive film stock.
When "filmed" programs were broadcast on television, they had to be converted to either 25fps for the Brits or 29.97 for US to match CRT refresh rates. The usual way was to repeat alternating frames in a 3:2 ratio.
To try to get back to the "true" look of the film, various ways were developed to reverse the telecine process - hence the idea that converting back to 23.976 is a good idea.

It is not!

Most of today's programs are filmed with digital cameras that capture 25, 50, 30 or 60 fps in progressive frames, not interlaced. When broadcast, the original digital video is converted to 720p or 1080i solely to use less bandwidth.
Additionally, the 1080i "interlace" is not the old-time 3:2 telecine that used a constant, predictable pattern from the beginning of a video to the end. Like variable bitrate to allocate more data to detailed scenes or action, variable frames are used in what is called "hybrid interlace" in which some areas of the video are interlaced and some not. There is also not a uniform pattern throughout the video, so "reverse-telecine" filters will make a jerky mess of the hybrid video.

The resulting 23.976 file makes even less sense when you go to play it back. You are not going to watch it on a old theater movie projector that ran at 23.976 film speed. Anything you will play your video on will be a digital screen refreshing at 25/50/30/60 frames per second requiring the video to be converted back to one of those, either reintroducing some sort of telecine scheme or by the GPU trying to interpolate in-between frames on-the-fly.
All of this lessens the final quality, so why do it in first place?

If you ripped a commercial DVD to TS - AND it is already 23.976 because the original was on film - Great! Otherwise, leave the frame rate alone.
Same goes for UK sourced material broadcast on US tele. The conversion from 29.976 back to 25fps will not get you the original UK version back. There will not be a repeatable pattern that can be reversed by a simple de-telecine. I you have cut out any "adverts" or any "pledge" segments, you introduced more discontinuities to the frames.

If your intent was to make the video smaller, think again... modern encoders accomplish their "magic" by comparing frames and encoding their differences. Even with traditional 3:2 telecine, the "repeated" frames take almost no data to encode. Important frames are detailed, but most are encoded with only some details and lots of referances to other frames. The inclusion of any 3:2 repeated frames adds only a handful of bits to the encoded stream - the digital equivalent of "do that one again" as the previous frame has already been decoded and is in the video buffer.
I see what you are saying but can't say I agree with most of it. If you go online and download TV shows (I am not talking about some just by some guy that doesn't know what he is doing) pretty much all shows are converted to 23.976. And the stuff that is ripped directly from netflix/amazon etc, is already in 23.976.

The little stuff I have encoded actually turned out really nice, and I also don't agree with your statement about making the file size smaller. I cut the size in half and played the two side by side and couldn't tell which was which.
 

DrP

Member
Have to agree with Dan here. With the way US TV gets chopped up as part of normal operations there is no simple answer if you want to drop it back down to the notional 24FPS and avoid occasional frame jumps as the 3:2 sequence is disrupted and changed during playout. Tack onto that the joys of non-integer frame rates and integer audio rates to increase enjoyment. You might consider using VRD to chop the program into separate sections (ie bits between the ads) and then running it all through avisynth as a combined clip, doing telecide on each part separately so that it has the best chance of tracking the 3:2 sequence for each segment. This of course assumes the underlying content is actually progressive and not natively interlaced. Keep in mind that on screen graphic overlays (promos, scrollies etc) are often actually interlaced so they will come out of telecide with some combing and may need some deinterlace tweaking applied.

My non-expert opinion only.
 

lightsout

New member
Have to agree with Dan here. With the way US TV gets chopped up as part of normal operations there is no simple answer if you want to drop it back down to the notional 24FPS and avoid occasional frame jumps as the 3:2 sequence is disrupted and changed during playout. Tack onto that the joys of non-integer frame rates and integer audio rates to increase enjoyment. You might consider using VRD to chop the program into separate sections (ie bits between the ads) and then running it all through avisynth as a combined clip, doing telecide on each part separately so that it has the best chance of tracking the 3:2 sequence for each segment. This of course assumes the underlying content is actually progressive and not natively interlaced. Keep in mind that on screen graphic overlays (promos, scrollies etc) are often actually interlaced so they will come out of telecide with some combing and may need some deinterlace tweaking applied.

My non-expert opinion only.
I am not going to claim to be the expert here at all, you guys for sure understand the technical side more than I do. I guess my point was more that it can be done, and is done pretty commonly. I think you probably have it right, that the pieces would need to be put into avisynth on their own, then joined. Avisynth is beyond what I want to learn, I am learning that after taking out the commercials the size of the shows are not too bad. I may just leave them like that and invest in more HDD space when the time comes.
 

Dan203

Senior Developer
Staff member
It was done commonly with DVDs because most DVDs are actually film converted directly to interlaced via 3:2 pull down. There were even DVD players with this functionality built in. But broadcast TV is different. Even if the show started it's life as film, by the time it gets to you it's be recoded a half dozen times and there is no guarantee the cadence was maintained. So getting it back to the original film source could be impossible.
 

klimbo

New member
Why are you even trying to convert files to 23.976???

A long time ago, cameras used film to capture programs. The choice of 23.976/24 fps was a compromise. It was the slowest frame change that seemed smooth to most people and yet used the least amount of expensive film stock.
When "filmed" programs were broadcast on television, they had to be converted to either 25fps for the Brits or 29.97 for US to match CRT refresh rates. The usual way was to repeat alternating frames in a 3:2 ratio.
To try to get back to the "true" look of the film, various ways were developed to reverse the telecine process - hence the idea that converting back to 23.976 is a good idea.

It is not!

Most of today's programs are filmed with digital cameras that capture 25, 50, 30 or 60 fps in progressive frames, not interlaced. When broadcast, the original digital video is converted to 720p or 1080i solely to use less bandwidth.
Additionally, the 1080i "interlace" is not the old-time 3:2 telecine that used a constant, predictable pattern from the beginning of a video to the end. Like variable bitrate to allocate more data to detailed scenes or action, variable frames are used in what is called "hybrid interlace" in which some areas of the video are interlaced and some not. There is also not a uniform pattern throughout the video, so "reverse-telecine" filters will make a jerky mess of the hybrid video.

The resulting 23.976 file makes even less sense when you go to play it back. You are not going to watch it on a old theater movie projector that ran at 23.976 film speed. Anything you will play your video on will be a digital screen refreshing at 25/50/30/60 frames per second requiring the video to be converted back to one of those, either reintroducing some sort of telecine scheme or by the GPU trying to interpolate in-between frames on-the-fly.
All of this lessens the final quality, so why do it in first place?
If you ripped a commercial DVD to TS - AND it is already 23.976 because the original was on film - Great! Otherwise, leave the frame rate alone.
Same goes for UK sourced material broadcast on US tele. The conversion from 29.976 back to 25fps will not get you the original UK version back. There will not be a repeatable pattern that can be reversed by a simple de-telecine. I you have cut out any "adverts" or any "pledge" segments, you introduced more discontinuities to the frames.

If your intent was to make the video smaller, think again... modern encoders accomplish their "magic" by comparing frames and encoding their differences. Even with traditional 3:2 telecine, the "repeated" frames take almost no data to encode. Important frames are detailed, but most are encoded with only some details and lots of referances to other frames. The inclusion of any 3:2 repeated frames adds only a handful of bits to the encoded stream - the digital equivalent of "do that one again" as the previous frame has already been decoded and is in the video buffer. Pnr Status TextNow VPN
i think you are said all things , very good informative post thanks bro
 
Last edited:
Top Bottom