View Full Version : Blowing up letterbox to 16:9
carlmart
31st May 2011, 20:36
I have to blow up a documentary of mine, which is in DVD in 4:3 letterbox, up to 16:9.
The film was shot purposefully by me in mini-DV 4:3 to cropped later on to 16:9 size. During those times (2005) TVs were mostly 4:3 and people were used to see films in letterbox size, with the black bars up and below.
With LCD and plasma TV you can zoom in the letterbox, but results are not that good sometimes.
I would like to use Avisynth to blow up that doc to full 16:9 size, allowing different subtitles to be seen accordingly.
If results are promising I might find the energy to go back to the Avid edit and apply enhancing techniques to make things better for modern TVs.
It's NTSC, so no system conversion is necessary.
First of all, my file is m2v, and I don't remember how should I load it.
Next, I will probably use Lanczos4Resize(720,480,0,XX,0,-XX) to blow it up, though I don't remember which were the XX numbers anymore.
Is there anything else I should use to enhance things up?
b66pak
31st May 2011, 20:49
Lanczos4Resize(720,480,0,height/8,0,-height/8)
this is valid ONLY for 4:3 source...
example: for 640X480
Lanczos4Resize(720,480,0,60,0,-60)
_
carlmart
31st May 2011, 21:21
Thanks.
I had already loaded the file in DGIndex and had a d2v project o load with MPEG2Source.
Any suggestions to enhance (or hide) likely degradations I might have blowing up this?
TheSkiller
31st May 2011, 21:26
The number you are looking for is 60.
Maybe just a matter of taste but I'd recommend Spline36Resize over Laczos4Resize since it's supposed to be less ringy.
Spline36Resize(width,480, 0,60,-0,-60)
But it's not just done with a Crop+Resize if the video is interlaced! If there are interlaced parts then you have to bob-deinterlace the video, resize and then reinterlace it back (there's also interlaced resizing but I wouldn't really recommend it for upsizing especially if you're looking for a good quality).
Is there anything else I should use to enhance things up? Maybe a LimitedSharpenFaster() after the resize to make things a bit crisper. However, don't overdo it.
carlmart
31st May 2011, 21:49
The number you are looking for is 60.
Maybe just a matter of taste but I'd recommend Spline36Resize over Laczos4Resize since it's supposed to be less ringy.
Spline36Resize(width,480, 0,60,-0,-60)
Don't worry. That's exactly what I am using. Spline is a better than Laczos. And those are the numbers I loaded too.
But it's not just done with a Crop+Resize if the video is interlaced! If there are interlaced parts then you have to bob-deinterlace the video, resize and then reinterlace it back (there's also interlaced resizing but I wouldn't really recommend it for upsizing especially if you're looking for a good quality).
This is what MediaInfo lists for my file:
>
General
Complete name : C:\Temp\VideoFile.m2v
Format : MPEG Video
Format version : Version 2
File size : 2.80 GiB
Duration : 50mn 13s
Overall bit rate : 7 995 Kbps
Video
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 50mn 13s
Bit rate mode : Constant
Bit rate : 7 672 Kbps
Nominal bit rate : 7 987 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate : 29.970 fps
Standard : NTSC
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Bottom Field First
Bits/(Pixel*Frame) : 0.741
Stream size : 2.69 GiB (96%)
>
I almost forgot everything on what I should do for such conversions. The script I have from times gone was a for a blow up from a PAL DVD which was awfully transferred to NTSC, so it had serious aberrations.
What do you suggest to use now?
Maybe a LimitedSharpenFaster() after the resize to make things a bit crisper. However, don't overdo it.
What about some lsfmod?
TheSkiller
31st May 2011, 22:14
LSFmod is fine of course (well it's a modded version of LimitedSharpenFaster).
So MediaInfo says the MPEG2 video was encoded interlaced. Still this does not indicate whether the actual picture is interlaced (yes, it's the old problem).
The only way to find out is with your eyes and an unfiltered look at the video. A fast and easy way would be to do this for example with VirtualDub-MPEG2 (http://home.comcast.net/~fcchandler/stable/) (yes, it's old) by opening a VOB file of the DVDs main feature. Hope you still know what it looks like if a video is interlaced. :p
If the video is interlaced (which is what I'm expecting) the steps required would look like this:
AssumeBFF() #your video is bottom field first
SomeBobDeinterlacerHere() #QTGMC, yadif, TDeint...
Spline36Resize(width,480, 0,60,-0,-60)
LSFmod()
SeparateFields().SelectEvery(4,0,3).Weave() #re-interlace
carlmart
31st May 2011, 22:59
Well, as it is now it's like this:
AssumeBFF()
QTGMC( Preset="Slow" )
SelectEven()
Spline36Resize(width,480, 0,60,-0,-60)
LSFmod()
SeparateFields().SelectEvery(4,0,3).Weave()
Am I in the right path? I'm an absolute donkey with bobdeinterlacers.
carlmart
31st May 2011, 23:24
This is a print screen of one of my frames after filtering.
Gavino
31st May 2011, 23:34
Am I in the right path? I'm an absolute donkey with bobdeinterlacers.
Remove the SelectEven() line.
You need to stay at 60p at that point for the later reinterlace to work.
carlmart
31st May 2011, 23:50
OK, SelectEven() is removed.
Is it possible to improve the "combteethed" blur?
carlmart
1st June 2011, 02:12
Well, I now have another problem.
I loaded the script into HCenc, and the conversion is going to take 34 hours!!!
Certainly not very practical.
Which filter takes so long to work? It has to be removed or changed.
Almost certainly the slow filter is QTGMC. You could try setting it to a faster preset and see if it still gives acceptable quality. If you have a multi-core or hyper-threaded processor, you might want to try a multi-threaded build of Avisynth (although that can cause headaches of its own). Otherwise you're gonna have to settle for an inferior deinterlacer.
carlmart
1st June 2011, 10:14
Yes, the slow filter was QTGMC. I didn't realize the letters stood for TempGaussMC. That family of filters is always very slow.
In the meantime that I was awaiting for an answer on Doom9, I changed that filter on the script. Changed it for
Yadif(Mode=1,Order=0)
Processing time got more decent. Still long though. I didn't expect this conversion time to be so.
On AvsP the conversion simulation does seem to be a bit inferior in quality with Yadif.
Would TDeint be a little better?
What about the comb teeth (mice teeth) aberration that shows on the images I captured? Can that be improved further?
carlmart
1st June 2011, 10:33
Have a look at this cut-outs from same frame with different filters.
The files have the names, so you can compare them.
What do you think?
carlmart
1st June 2011, 10:59
BTW: I was wrong on the estimated conversion time for the QTGMC. It was much worst! 34 hours for EACH pass.
Presently I'm in the middle of the conversion with Yadif, and it took 6.43 hours for pass 1.
And the doc it's only 50 minutes...
carlmart
1st June 2011, 11:31
Sorry if I keep adding information and not wait for your comments.
The image I picked for the filter comparisons might not be the best. So I picked a different one, with higher resolution, and the differences are very subtle.
TDEint and Yadif look almost the same, a little bit softer and blurred than QTGMC's.
The difference is very subtle, but it may show more on a 42" screen.
In any case, all of them are an improvement over an unfiltered conversion.
After I finish this conversion using Yadif, I will burn a DVD to see how it looks.
zee944
2nd June 2011, 09:36
Why do you want to deinterlace? You just ruin your DV footage. Can't your TV handle interlaced material? Sure it can. Leave it as it is, except for the cropping/resizing to 16:9.
GodofaGap
2nd June 2011, 09:47
Why do you want to deinterlace? You just ruin your DV footage. Can't your TV handle interlaced material? Sure it can. Leave it as it is, except for the cropping/resizing to 16:9.
He is not really deinterlacing. He is bobbing and reinterlacing to avoid problems with resizing the fields directly (if done incorrectly it causes misalignement of the fields).
carlmart
2nd June 2011, 13:46
In any case I would like to know more about the better way to convert my DV and HDV editings onto DVD.
Something in my conversions seems not to be fine if I need to do all these processings afterwards. So how should I proceed?
I remember having a lot of problems on my Avid MC export routines so as not to have interlace-related aberrations (mice-teeth) showing on some parts of the screen.
Even if I view all this at home in a plasma screen, which is progressive, the DVD will forcibly be interlaced. So how to do things so as not to have ANY aberrations at all?
carlmart
2nd June 2011, 14:06
Now to this specific job. After 13 hours waiting for my conversion, besides 6 more for a failed one, I have a complete conversion.
Some problems:
1) Flicker on subjects movements. Any movement is not fluid, but made of a series of following positions, if you know what I mean.
2) Interlace aberrations. The shown "mice-teeth" distortions. How do eliminate them? I don't want to have them, whatever the TV screen is, plasma, LCD or CRT.
This time I will do a series of small tests to see what looks how.
Didée
2nd June 2011, 14:23
Are those 13 hours still referring to 1 hour of input footage? Maybe your hardware is a little dated, or you used too high settings in the Mpeg2-encoder. (What IS your hardware, and what encoder are you using?)
"Mice teeth" are a perfectly correct thing for interlaced footage. The TV set should automatically de-interlace it for a progressive representation at doubled framerate. That's what TV sets are purposefully made for.
There is too little detail about your production chain in whole. In case there's a logical/technical error in the chain, nobody can tell because the chain is unknown. You need to give more information.
If you upload a small chunk of the output you currently have, it would become immediately obvious if or if not there is an error in the interlaced structure.
GodofaGap
2nd June 2011, 14:25
I don't know why you are complaining about miceteeth. You do want the footage to remain interlaced yes? What you show in your pictures seems to be an interlaced frame that was resized.
Where and when are you taking these screenshots? They don't have the width of your script, so you are taking them using a media player with a random window size?
TheSkiller
2nd June 2011, 15:18
carlmart you seem to have messed up the field order of your video. It's either a mistake in your script or you simply told your MPEG2 encoder (which one?) the video is TFF although it is BFF (since the source was BFF). If the latter is the case then you can simply remove the TFF flag from the MPEG2 elementary stream with Restream without reencoding the whole thing.
I agree, your screenshots are of no use. Also, please try to use an image hosting service because it can take a while until attachments are approved.
carlmart
2nd June 2011, 16:49
OK. Let's see if I can provide all you want.
For the screen shots I can upload to Mediafire, so that's settled. What do you want me to upload?
All the images I captured were from AvsP, using Printscreen and then cropping with Irfanview. In this case, size was adjusted to Doom9 limitations, which wouldn't exist anymore with Mediafire.
The converter I am using is HCenc 0.26.
My hardware is Gigabyte EP31, with Intel Dual Core E6420, 4GB DDR-2 memory, GeForce 9600, XP SP3.
I am using "regular" Avisynth, not the boosted one.
Didée: what do you mean "small chunk of the output you currently have"? My DVD video?
Godofagap: let me put it a bit bluntly. I want my footage to look clean when I blow it up. No flickering, no mice-teeth, nothing.
One thing you-re right and just got it corrected. The flag was TFF on HCenc, and now it's right. Perhaps I should do a test and see how it does work out for the flickering.
But just now I did check on something: I played the DVD I am using as "source", played on the same player and the same plasma. There are no aberrations of any kind, certainly no mice-teeth.
Problem is it is 4:3 letterbox. What I would like to do is to have something similar, only blown-up to full 16:9. If I can enhance it in any way, that's fine.
I'm using PGCDemux to demux the DVD: maybe that's a problem too.
Also now played a little with the filters in AvsP:
1) Leaving just Spline36Resize I get the interlacing teeth.
2) Teeth go away when Yadif is on.
3) Teeth come back, thinner, when I put back <SeparateFields().SelectEvery(4,0,3).Weave()>
Didée
2nd June 2011, 17:10
Intel Dual Core E6420
Well okay. Nothing wrong with that, but for video processing+encoding, that's not exactly a monster CPU by today's standards.... ;)
what do you mean "small chunk of the output you currently have"? My DVD video?
Yes, exactly. For the simple reason to see the result as it is, without alterations. Because ...
All the images I captured were from AvsP, using Printscreen and then cropping with Irfanview.
judging "interlacing issues" is pretty hard with only screenshots. And in case they're aditionally *resized* --which at least some of your screenshots seem to be-- it's pretty much impossible to conclude anything.
Sorry if it's a dumb question but ... are you aware of the technical concept of "interlacing"?
GodofaGap
2nd June 2011, 17:43
3) Teeth come back, thinner, when I put back <SeparateFields().SelectEvery(4,0,3).Weave()>
That would be whole point of reinterlacing it, no?
I think Didee is on the right track with his question.
TheSkiller
2nd June 2011, 18:05
I'm using PGCDemux to demux the DVD: maybe that's a problem too.No, that shouldn't cause any problems.
1) Leaving just Spline36Resize I get the interlacing teeth.
Of course. You can't just resize an interlaced image like that, that's exactly why you need to go the bob-deinterlace -> resize -> reinterlace route.
Also, it is correct to see "mice teeth" while looking at your result in AvsP, VirtualDub etc. That's because the video is interlaced. ;) These won't be visible on a TV (well, as long as you don't resize interlaced content the way you did).
carlmart
2nd June 2011, 18:26
Well, I think I'm familiar with the interlacing concept. Though probably not familiar with what the filters do. :(
So some things confuse me, particularly when there can be interlaced and progressive DVDs.
I know I should see interlacing artifacts in AvsP or VD, but I get confused when I see them sporadically played from a DVD on my plasma screen.
As I see I should be interlacing it all again after doing the conversion, and it seems I am failing to do so, or some filter is lacking.
Didée: how do you want me to capture the video chunk for you to see? That should take some time to upload.
Godofagap: right, I have to interlace again. So why does it seem not to be working? Perhaps the wrong flag (TFF instead of BFF) might be causing the problems?
In the meantime, I am going to convert a small part with the correct BFF flag
carlmart
2nd June 2011, 18:37
Ok, OK.
Before you come back at me with furious faces, let me tell that yes, the wrong flag (TFF) in HCenc was causing the flickering, the mice teeth and the long processing time.
My apologies.
Short test completed showed all things fine.
Now I think I should concentrate on enhancing the image, if that's possible.
smok3
2nd June 2011, 18:38
and your original material (not mpeg2) is 4:3 interlaced? if answer is yes, don't bother imho, Letterboxing is just fine in that case (again imho).
Didée
2nd June 2011, 18:38
Simple take the encoded file, drop it into DGIndex, mark a small section (with motion) by '[' and ']' keys, choose "Save project & Demux Video".
If there is "sporadically" interlacing on the plasma, perhaps it's the deinterlacer of the device that makes suboptimal decisions. Such is not unlikely.
You can of course do a plain single-framerate deinterlacing beforehand. Then you avoid all chances to ever see any combing. But you also loose motion fluidity, since there's only 30fps left over, instead of 60fps interlaced.
carlmart
2nd June 2011, 18:52
I was going to suggest to the moderator to delete posts #10 to #29, as they were related with a wrong flagging setting and could make the blowing up questions more confusing.
Even if the original is 4:3 interlaced, letterboxing is not fine anymore. Most TVs I am showing this on now are 16:9, so the image is all "framed-in" in black bars. Up and down bars are fine, laterals are not.
If you zoom in you lose the subtitles on some TVs, so it does need resizing.
Now I would like to know what I might try to enhance it.
smok3
2nd June 2011, 18:53
subtitles on black bars?
carlmart
2nd June 2011, 19:06
subtitles on black bars?
http://forum.doom9.org/images/smilies/devil.gif
Greatest aberration I know for subtitles.
carlmart
3rd June 2011, 15:08
Job is done. The conversion was made using Yadif, as QTGMC was to take a long time. It's obvious you need MT Avisynth to use it.
It turns out my problems were due to a wrong HCenc setting. Now I wonder if you can help me set things right for it.
The conversion went fine changing one thing in Settings 1 > Interlacing options, then choosing BFF.
But then I did another conversion changing a few things there and things went out of sync in audio.
What I did was changing a few things in Main and Settings 1.
In MAIN I set Autogop to 18.
In SETTINGS 1 checked Interlaced and BFF in INTERLACING OPTIONS, and Interlaced in CHROMA DOWNSAMPLING.
As a result, as I said, sync was off. Why is that?
TheSkiller
3rd June 2011, 15:40
If you zoom in you lose the subtitles on some TVs, so it does need resizing.
Wait a minute, if that's the main problem then you could have gone a completely different route in the first place! It's obsolete now, but I will explain it nevertheless.
You can alter the vertical position of all the subtitles on your DVD with DVDSubEdit in just a few clicks without needing to re-rencode or re-author anything. You would have to place them exactly 60 lines higher.
In addition, while you're at it, you could use IfoEdit and set the "Letterboxed (top and bottom cropped)" flag. This will make the DVD player inform the TV via the player's WSS signaling that the picture is 16:9 letterboxed into 4:3 which will make a widescreen TV switch to 16:9 zoom mode automatically. There are some IFs however: the player has to generate a WSS signaling, the connection between player and TV has to be an analog one (otherwise there's no WSS) and the TV has to read and obey the WSS signaling. An exeption might be a player that does the zooming itself (I heard some BluRay players do that).
Well, now that you've gone the re-encode route you're going to have to render 16:9 subtitles additionally because otherwise they will look streched and ugly on widescreen TVs.
As a result, as I said, sync was off. Why is that?
The settings in HCenc cannot affect the sync. Before encoding you should first check in AvsP or VirtualDub if the length of your filtered result is correct (that is, same as the source), maybe the framerate got messed up somewhere between bobbing and reinterlacing, it has to be 29.97 fps (check it!).
:script:
carlmart
3rd June 2011, 15:57
Wait a minute, if that's the main problem then you could have gone a completely different route in the first place!
Of course that was not the only reason, not even the most important one. As the film will be now circling around, being seen in conditions I wouldn't have any control on, an universal solution was necessary.
It had to be full 16:9, not letterbox, or on some cases, when viewed on a 16:9 screen it would show as 4:3 letterbox, which I didn't want. That is I didn't want the vertical side bars.
About the subs were rendered again, in DVDLab-Pro, when I authored the DVD.
The settings in HCenc cannot affect the sync. Before encoding you should first check in AvsP or VirtualDub if the length of your filtered result is correct (that is, same as the source), maybe the framerate got messed up somewhere between bobbing and reinterlacing, it has to be 29.97 fps (check it!).
How do I check that?
My script was:
LoadCPlugin("C:\video\AviSynth 2.58\plugins\Yadif.dll")
MPEG2Source("c:\temp\VideoFile.d2v")
AssumeBFF() #your video is bottom field first
Yadif(Mode=1,Order=0) #QTGMC, yadif, TDeint...
LSFmod(smode=5)
Spline36Resize(width,480, 0,60,-0,-60)
SeparateFields().SelectEvery(4,0,3).Weave() #re-interlace
TheSkiller
3rd June 2011, 16:30
How do I check that?
VirtualDub: File -> File information...
AvsP: I don't know. :p
Your script looks correct, it shouldn't cause any sync problems - at least regarding the video...
How do you put the audio of your original DVD into your new DVD? There could be a delay in the original DVD that has to be considered for sync. The way I'd suggest is demuxing the audio with PGCdemux straight from the Original DVD, then check the log file for a delay. Use the demuxed audio for authoring in DVDLab-Pro.
carlmart
3rd June 2011, 17:12
Video and audio was demuxed with PGCdemux from the DVD, and there was no delay.
If you recall what I said, the first conversion was fine and in sync. That's the one I used to author the new DVDs in DLP. I kept that one.
On the second one I decided to set things "correctly", but I messed up somewhere. Perhaps I should go talk to who designed HCenc. Do you know who it was?
smok3
4th June 2011, 10:55
HCenc deals with video only, has nothing to do with sync/desync issues.
carlmart
4th June 2011, 11:28
HCenc deals with video only, has nothing to do with sync/desync issues.
I think that in some ways it does, if they change something that adds/cuts frames.
Why do I have a copy in sync then, and another is not, considering that in the latter I only changed the HCenc setup? Can anyone explain that?
TheSkiller
8th June 2011, 17:04
I can't explain it. The chroma downsampling settings do not have any effect at all with YV12 input. I've used HCenc with all kinds of settings you could imagine and never had any kinds of sync issues with it. However, if I were you I would first check if say frame 1000 of the Source VOB matches frame 1000 of your HCenc encoded m2v. You can just throw both as they are at two instances of VirtualDub (MPEG2 version or newer version with MPEG2 plugin) and then alt+TAB between them to check the sync between both files faithfully.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.