View Full Version : converting from DVD (mpeg2) to MKV to x264 (interlaced encoding?)...
Lathe
17th October 2016, 08:49
I know my title isn't quite right because MKV is just a container, but... :)
Basically I use MakeMKV to covert a DVD into an MKV file. The resulting file has a frame rate of 29.xxx and looks interlaced when I try to play it back, say on VLC player.
I have a stand alone OPPO Blu-ray player, and if I can play the MKV file directly, it automatically de-interlaces it during playback and it looks just fine. BUT... because of some weird, unknown reason, I cannot for the life of me re-encode using x264 to another MKV file where the resulting file will play on my OPPO. No matter WHAT I do, the result ALWAYS chokes the player (this is ANOTHER issue which I will work on later)
Now, because of this kind of unique situation with my OPPO player, for now, any re-encoding I do has to be to a BDMV format and then it will indeed play on my OPPO (meaning, using avisynth to add borders for older 4x3 films, tweaking, etc) I am doing this pretty much exclusively for old 4x3 films. However, in this odd case where I am encoding DVDs (normally I usually almost always do Blu-rays) It SEEMS that when I place what LOOKS to me like the interlaced video within the BDMV folder (using TSMuxer) when I play that back on my OPPO it doesn't LOOK like it is deinterlacing the video like it does when it plays back the MKV version of the same file.
Soooo, I'm wondering, do I have to add something when I use x264 when I have to re-encode something, like maybe using additional avisynth code that changes the frame rate inside the BDMV folder or 'flags' it in some way so that my OPPO will see the content as interlaced and deinterlace it on playback?
OR...
I've only tried this a couple of times, but I'm getting the impression that when I use a deinterlacer in the encoder (blend, etc) and I also use the avisynth code:
ConvertToYV12()
AssumeFPS(30000,1001)
the result doesn't seem to look quite right when I play it back on my OPPO.
Am I doing that right? Because I don't understand ANYTHING about deinterlacing or 'pulldown', or whatever, do I need to add something else in my code when converting a DVD 29.xxx source MKV to a playable Blu-ray format?
I hope I asked this correctly; this can be REALLY confusing because I've read about 'false interlace flag' and 'pull down' and converting it to 23.xxx progressive during encoding, etc. But, from what I've read it doesn't look as good if you deinterlace using the encoder and it is better to have your player do it.
Anyway... YES, I am confused... :o
Sharc
17th October 2016, 14:45
Did you try to import your DVD in BD-RB, and let BD-RB do the rest? It will probably do it right.
You could output to .mkv, and you have the choice of deinterlacing, or encoding it interlaced (if the source is interlaced), or IVTC.
Upload a sample of the mpeg-2 source. Someone may tell you whether it's true interlaced or telecined or whatever.
Lathe
18th October 2016, 02:25
Did you try to import your DVD in BD-RB, and let BD-RB do the rest? It will probably do it right.
You could output to .mkv, and you have the choice of deinterlacing, or encoding it interlaced (if the source is interlaced), or IVTC.
Upload a sample of the mpeg-2 source. Someone may tell you whether it's true interlaced or telecined or whatever.
Thanks Sharc, good suggestion...
Lathe
18th October 2016, 05:10
Okay, here is a beginning snippet of the film. It is an old capture from many years ago. All I've done is use MakeMKV to render it to an MKV file.
Any suggestions at all as far as any AVS code to try for various hopeful improvements would give me a start in experimenting with it and help me to learn more. My primary purpose in posting this thread was to get some ideas as to how to work with some of these old captures of mine (usually films that are not commercially available and at LEAST where the print is somewhat salvageable) to broaden my understanding and grasp of Avisynth. BTW, FWIW I did indeed check out Videofred's restoration thread here, but it is mainly concerned with restoring 8mm film and he said that his stuff didn't apply as much to restoring old VHS captures.
Basically, what I have experimented with so far with Avisynth is I've used the 'tweak' function, the 'crop', 'add borders', 'deinterlace' (decomb / field), and the basic 'sharpen' features. I wish I could understand and use the better sharpen features like LFS, and addgrainC (for prints that are too smooth) etc, but I don't know quite how to get them to work. I'm wondering if I should just use some script to denoise & sharpen at the same time...? THAT is what I am trying to learn :)
Thanks kindly for any suggestions!
http://lathe-of-heaven.com/01.mkv
Sharc
18th October 2016, 07:45
Your source looks like a TV capture with poor on-the-fly mpeg-2 compression (blocky and other compression artefacts).
It is not true interlaced, it's telecined, with some residual combing (and other artefacts) in the progressive frames.
So as a first step you should IVTC (inverse-telecine) it and get progressive video 24fps. Then you may apply filters to improve the picture .....
Script for IVTC which will give you progressive 23.976 video:
greyscale()
telecide().tdecimate() #or TFM().tdecimate()
QTGMC(InputType=3) #optional, for postprocessing
addGrainC(10) #optional, masks the blocks
deblock().deblock().deblock() #optional, smooths the blocks
For much more sophisticated scripts and ideas see for example VideoFred's or johnmeyer's posts + scripts in this forum.
But have you tried to import and process it in BD-RB? Per default it will leave it hard telecined and encode it Blu-ray compliant interlaced. The player/TV may then IVTC it during playback if it detects the 3:2 cadence and playback will be smooth, or otherwise with the slight "NTSC telecine judder".
You could also force BD-RB to IVTC the source by putting in the .ini:
IVTC_480i=1
IVTC_METHOD=0
BD-RB will encode it progressive then. Perhaps your OPPO likes it better, although 720x480 23.976p is not Blu-ray compliant.
Lathe
19th October 2016, 06:41
Your source looks like a TV capture with poor on-the-fly mpeg-2 compression (blocky and other compression artefacts).
It is not true interlaced, it's telecined, with some residual combing (and other artefacts) in the progressive frames.
So as a first step you should IVTC (inverse-telecine) it and get progressive video 24fps. Then you may apply filters to improve the picture .....
Script for IVTC which will give you progressive 23.976 video:
telecide().tdecimate() #or TFM().tdecimate()
QTGMC(InputType=3) #optional, for postprocessing
addGrainC(10) #optional, masks the blocks
deblock().deblock().deblock() #optional, smooths the blocks
For much more sophisticated scripts and ideas see for example VideoFred's or johnmeyer's posts + scripts in this forum.
But have you tried to import and process it in BD-RB? Per default it will leave it hard telecined and encode it Blu-ray compliant interlaced. The player/TV may then IVTC it during playback if it detects the 3:2 cadence and playback will be smooth, or otherwise with the slight "NTSC telecine judder".
You could also force BD-RB to IVTC the source by putting in the .ini:
IVTC_480i=1
IVTC_METHOD=0
BD-RB will encode it progressive then. Perhaps your OPPO likes it better, although 720x480 23.976p is not Blu-ray compliant.
Hey, thanks Sharc! That sounds like a great place to get started. So, it is NOT interlaced then, but the combing is from being 'telecined', interesting. This is precisely the stuff I need to learn. So, the deinterlacing that I was doing was NOT the right thing to do. Good to know....
I'm having a tough time getting ANY scripts to run, but I will try some of the ones you mentioned. OR, good suggestion, perhaps just run it through BDRB first. Then, AFTER BDRB has created the m2ts file within the BDMV folder, do you think that I then should play around with Avisynth script using that?
Oh, also, what you said about the AR is right. That is why I was using Avisynth to pad out the width so that it WILL be 16x9 (or close to it at least) and then it will play properly within the BDMV folder on my OPPO.
Lathe
19th October 2016, 07:26
Your source looks like a TV capture with poor on-the-fly mpeg-2 compression (blocky and other compression artefacts).
It is not true interlaced, it's telecined, with some residual combing (and other artefacts) in the progressive frames.
So as a first step you should IVTC (inverse-telecine) it and get progressive video 24fps. Then you may apply filters to improve the picture .....
Script for IVTC which will give you progressive 23.976 video:
telecide().tdecimate() #or TFM().tdecimate()
QTGMC(InputType=3) #optional, for postprocessing
addGrainC(10) #optional, masks the blocks
deblock().deblock().deblock() #optional, smooths the blocks
For much more sophisticated scripts and ideas see for example VideoFred's or johnmeyer's posts + scripts in this forum.
But have you tried to import and process it in BD-RB? Per default it will leave it hard telecined and encode it Blu-ray compliant interlaced. The player/TV may then IVTC it during playback if it detects the 3:2 cadence and playback will be smooth, or otherwise with the slight "NTSC telecine judder".
You could also force BD-RB to IVTC the source by putting in the .ini:
IVTC_480i=1
IVTC_METHOD=0
BD-RB will encode it progressive then. Perhaps your OPPO likes it better, although 720x480 23.976p is not Blu-ray compliant.
Okay, I am doing what you said and added the inverse telecine code to BDRB's ini and it is running it. Probably the very best idea so far, thanks!
BTW, Hello-Hello suggested that we go to one thread, since I kind of asked about closely related things on a couple of threads (including this one)
Here is where he suggested we discuss it, especially if you have any other thoughts or ideas, I really appreciate it.
Here is the page:
http://forum.videohelp.com/threads/358043-A-comparison-of-AVIsynth-denoise-filters?p=2463399&posted=1#post2463399
Sharc
19th October 2016, 08:12
I think you should structure your problems and proceed step by step rather than trying to dance simultaneously on many parties.
- Making simple Avisynth scripts run your system; don't start with the most complex scripts which you may have "found somewhere"
- Learn the basics about interlacing, telecining, pulldown and how to analyze your clips
- Apply some (simple) filters to your clips
- Familiarize with DVD and Blu-ray compatible formats
- Encode and author accordingly (or trust BD-Rebuilder, it does most things right per default)
=> Your OPPO will be happy to play :)
Lathe
19th October 2016, 08:23
I think you should structure your problems and proceed step by step rather than trying to dance simultaneously on many parties.
- Making simple Avisynth scripts run your system; don't start with the most complex scripts which you may have "found somewhere"
- Learn the basics about interlacing, telecining, pulldown and how to analyze your clips
- Apply some (simple) filters to your clips
- Familiarize with DVD and Blu-ray compatible formats
- Encode and author accordingly (or trust BD-Rebuilder, it does most things right per default)
=> Your OPPO will be happy to play :)
Yes sir, you are exactly right! I just came back from BDRB's thread because I had to tell them how great your idea was! :)
I did exactly what you said and ran it through BDRB with the inverse telecine script and DAMN if it doesn't already look a lot better. So, I will also take your advice and read about the basics of Avisynth and try to become familiar with them before running off and trying to do too much.
And YES, I do indeed want to keep my OPPO happy (it's worse than a frigg'n woman, I swear...)
Thanks for the excellent idea man!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.