Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Jul 2006
Posts: 120
|
HD 1080i to DVD (all interlaced) - how?
I have an AVCHD file (.m2ts) that I want to convert to DVD. I use HCenc as the MPEG2 encoder, because it offers excellent quality.
The source is 1080i (interlaced, top field first), 29.97 frames / sec. The destination is DVD, so it's 480i (interlaced), 29.97 frames / sec. So it's an interlaced-to-interlaced conversion. First off, I did a straight MPEG2 encoding, no resizing: Code:
DirectShowSource("E:\video\birthday\STREAM\00000.MTS") ConvertToYV12() Code:
DirectShowSource("E:\video\birthday\STREAM\00000.MTS") LanczosResize(720, 480) ConvertToYV12() I tried a few options, like SeparateFields(), AssumeTFF(), to no avail. So the problem is to scale down 1080i to 480i, at the same frame rate, while preserving interlacing. What is the "magic incantation" to do that? By the way, at the end of the file, HCenc just hangs, "this program is not responding", so I have to kill it. Could be HCenc's fault, could be AviSynth's. Any ideas? |
![]() |
![]() |
![]() |
#3 | Link |
Kwon BoA
Join Date: Feb 2007
Location: Singapore
Posts: 83
|
You have to deinterlace before resizing.
Code:
DirectShowSource("File") mcbob() #If you can spare the time. If not, use some other bobber. Spline36Resize(720,480) Weave()
__________________
Jeremy Clarkson - Getting fat is just evolution Last edited by themostestultimategenius; 30th June 2008 at 08:13. |
![]() |
![]() |
![]() |
#4 | Link |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,980
|
You don't _have_ to bob before resizing - separating fields and resizing to 720x240 will work, but the bobbed version will probably look better
![]() ~MiSfit
__________________
These are all my personal statements, not those of my employer :) |
![]() |
![]() |
![]() |
#5 | Link | |
Registered User
Join Date: Apr 2008
Location: St. Petersburg, Russia
Posts: 334
|
Quote:
To re-interlace it, one wants to use half of fields from it, like this: Code:
LoadPlugin("path\LeakKernelDeint.dll") DirectShowSource("path\video.mts")# better to use DGIndex project for mpegs LeakKernelBob(order=1)# order=1 is for TFF input video LanczosResize(720,480) AssumeTFF()# the assumed order will force outputting TFF SeparateFields() SelectEvery(4,0,3) Weave() |
|
![]() |
![]() |
![]() |
#7 | Link |
Registered User
Join Date: Jul 2006
Posts: 120
|
I actually wanted to do tests first and then post a reply, but I'll post first, because it's an important issue to me:
Deinterlace before resizing sounds scary. I hope I don't have to do that. I definitely don't want to deinterlace, because, based on my previous experience with deinterlace/reinterlace filters with other applications, this always degrades the image. My goal is to preserve the fluidity of the motion in pristine quality, and the way I understand the process now, that can't be done if I deinterlace/reinterlace. Remember, both the source and the destination are interlaced: 1080i and 480i. So I will do my best to find a method to not deinterlace. After all, I came to AviSynth after being disappointed with some commercial software which seems to deinterlace when there's no need to. Please correct me if I'm wrong. P.S.: I will do tests as soon as I can. |
![]() |
![]() |
![]() |
#8 | Link |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,980
|
there's a difference between "normal" (half rate) deinterlacing, and bob deinterlacing.
Bobbing preserves all temporal information, so 1080i bobbed becomes 1080p60. Then, you can scale these 60fps down to 720x480, separate it into fields, throw away half the info, and re-interlace down to 480i You can do all this without deinterlacing, but smart bobbing first will give better results - namely less aliasing etc due to spatial alignment I think. ~MiSfit
__________________
These are all my personal statements, not those of my employer :) |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Jul 2006
Posts: 120
|
I used this script:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll") DirectShowSource("E:\video\birthday\STREAM\00000.MTS") LeakKernelBob(order=1) LanczosResize(720,480) AssumeTFF() SeparateFields() SelectEvery(4,0,3) Weave() ConvertToYV12() I generated the audio track, multiplexed, authored a very simple DVD image, burned it. It played just fine on the TV, although that test might be less relevant, since there are quite a few layers of processing on the PS3 and the HD screen which may mask issues with the DVD. But it looked good, no ghosting, no huge jaggies due to field order reversal (but I guess the PS3 would try and hide those), motion was fluid, etc. So I guess this is it? Any suggestions I could use to improve it? Remember, I am trying to convert 1080i TFF to 480i and keep everything interlaced, with fluid motion and crisp images. |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Mar 2004
Posts: 889
|
Have you tried the "InterlacedResize()" function in SimpleResize.dll ?
Edit(1): Unfortunately, is it said to be broken for YV12. Edit(2): You probably need to apply some field shift correction for the separate-resize-combine method, as suggested in http://forum.doom9.org/showthread.ph...339#post594339 Last edited by henryho_hk; 1st July 2008 at 03:28. |
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Mar 2004
Posts: 889
|
For best result, we need a motion-sensitive(compensated?) ConvertToYUY2 and ConvertToYV12.
![]() BTW, nnedi+tmm+tdeint is a nice bobber too: TFF Clips: inp=src.nnedi(field=3) emk=src.tmm(mode=1,order=1) src.tdeint(mode=1,order=1,type=1,edeint=inp,emask=emk) BFF Clips: inp=src.nnedi(field=2) emk=src.tmm(mode=1,order=0) src.tdeint(mode=1,order=0,type=1,edeint=inp,emask=emk) |
![]() |
![]() |
![]() |
#14 | Link | |
Registered User
Join Date: Jul 2006
Posts: 120
|
Quote:
Code:
Global NewHeight=480 Global NewWidth=720 DirectShowSource("E:\video\birthday\STREAM\00000.MTS") AssumeTFF() SeparateFields() Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height()) Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height()) Interleave(Tf, Bf) Weave() ConvertToYV12(Interlaced=True) The minimum bitrate and the average bitrate on the encoder have decreased. The encoder has an easier job to do. Not sure if this is a good sign or bad. I don't care about final file size, there's plenty of room left over on the DVD. It's still a bit blurry. But perhaps this is not objectively true, perhaps I'm unconsciously comparing it with the HD master. Also, the PS3 is doing a lot of processing to convert the 480i to 1080p for the display - I know it's doing a lot of things because the upsampled standard-def (at least the commercial progressive material) looks unnaturally good in most cases. So that might interfere. These things are best verified on true 480i displays and players. Tomorrow, or when I have time, I'll have to start drawing diagrams and verify whether those formulas that I copy/pasted in the new script are geometrically correct. Of course, the fact that I don't know squat about AviSynth doesn't help - I'm learning it as I go, and it kind of keeps me back. ![]() |
|
![]() |
![]() |
![]() |
#15 | Link | |
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
Quote:
Cheers, David. |
|
![]() |
![]() |
![]() |
#16 | Link | |
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
Quote:
Cheers, David. |
|
![]() |
![]() |
![]() |
#17 | Link |
Registered User
Join Date: Mar 2004
Posts: 889
|
Agreed. Life is much more easy if it is an ITVC material. ^_^ florinandrei, perhaps you can host a few seconds of your clip somewhere and so we can try working on it too.
Edit: Just notice the "DirectShowSource()". Have you tried dgavcdecode at http://neuron2.net/dgavcdec/dgavcdec.html? Last edited by henryho_hk; 2nd July 2008 at 04:07. |
![]() |
![]() |
![]() |
#18 | Link | |
Derek Prestegard IRL
![]() Join Date: Nov 2003
Location: Los Angeles
Posts: 5,980
|
Quote:
Sure, but NNEDI with TDeint and TMM is pretty damn fast, so why not use it? ![]() Either way - whatever the OP is happy with...
__________________
These are all my personal statements, not those of my employer :) |
|
![]() |
![]() |
![]() |
#19 | Link | |||
Registered User
Join Date: Jul 2006
Posts: 120
|
I guess it's fair to say the OP has no clue.
![]() Between these two scripts: Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll") DirectShowSource("E:\video\birthday\STREAM\00000.MTS") LeakKernelBob(order=1) LanczosResize(720,480) AssumeTFF() SeparateFields() SelectEvery(4,0,3) Weave() ConvertToYV12() Code:
Global NewHeight=480 Global NewWidth=720 DirectShowSource("E:\video\birthday\STREAM\00000.MTS") AssumeTFF() SeparateFields() Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height()) Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height()) Interleave(Tf, Bf) Weave() ConvertToYV12(Interlaced=True) The first one looks crisp, but I wonder if the jaggies aren't too much. I don't think there's any way to really tell, other than playing it on an old-school DVD player on a standard-def CRT TV. Anything else would just interfere with its own algorithms. Quote:
But anyway, I tried it and it works. Visually, there's no difference from DirectShowSource(). It does get rid of the annoying seconds at the end when AviSynth seems to hang and HCenc is totally frozen - with dgavc the encoder just exits normally. Quote:
I'd rather not make the initial file public (I sent it to a couple people, but putting it on a forum is a different thing), but I made 3 short clips that everyone can poke at: http://dl.getdropbox.com/u/29966/00000.MTS http://dl.getdropbox.com/u/29966/00001.MTS http://dl.getdropbox.com/u/29966/00002.MTS There's some motion, and there's some horizontal and oblique edges moving vertically. Quote:
|
|||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|