View Full Version : 576i upscaled to 720p - How to sharpen for YouTube?
nhope
19th December 2011, 09:55
I am upscaling PAL DV (720x576-50i) to 982x720-25p for YouTube (and maybe for Blu-ray).
Here is a second of (graded) PAL DV source (https://s3.amazonaws.com/bubblevision/PAL-DV.avi).
I'm framserving in RGB24 from Sony Vegas, then using this basic script:
AviSource("d:\fs.avi")
AssumeBFF()
ConvertToYV12(interlaced=true, matrix="PC.709")
QTGMC( FPSDivisor=2, EdiThreads=2 )
NNEDI3_rpow2(rfactor=2, cshift="spline36resize", fwidth=982, fheight=720)
Here is the same video after that processing (https://s3.amazonaws.com/bubblevision/982x720-QTGMC-NNEDI-Spline36.avi) (in uncompressed RGB).
And here is a screenshot:
https://s3.amazonaws.com/bubblevision/982x720-QTGMC-NNEDI-Spline36.jpg
It needs some sharpening, but I have little experience in this area. I know that too much sharpening can cause problems with compressing, in particular as my main target is YouTube. I tried adding the following line to my script:
LSFmod(defaults="slow",strength=500)
And here is the result on YouTube (http://www.youtube.com/watch?v=nhWBCoMzva8) (watch in 720p!!), along with some typical underwater footage that I need to process. It looks OK but:
- Is LSFmod a sensible way to sharpen upscaled footage such as this?
- In your opinions is it too much or too little sharpening?
- Any suggestions for other ways to sharpen this?
- Am I gaining much by using LSFmod over, say sharpen(0.75,0.75)
Thanks!
Ghitulescu
19th December 2011, 10:10
Youtube always reencodes, and the upscaling will be even more visible. And anyway, who wants quality does not use youtube, instead file-exchange servers, like (no advertisment here :)) rapidshare, megaupload, fileserve etc.
nhope
19th December 2011, 10:15
Thanks, but YouTube pay me, file-exchange servers don't, and I like my videos to reach the widest audience possible.
Anyone have an opinion on the sharpening?
Didée
19th December 2011, 10:28
First of all, the footage is too bright. Blackpoint seems to be at 30~32 RGB, which is too high. Depending on the RGB<>YUV conversion standard, this is either 16 points too high ("Studio RGB"), or 32 points too high (sRGB).
With levels corrected, you'll find the footage has more overall contrast, and less need for sharpening. (Perhaps it could be sharpened a 'lil bit, but then, it would be beneficial if the already-present "edge-enhancement" (dark halos beneath bright features) would be removed prior to that.)
nhope
19th December 2011, 10:56
Thank you Didée.
First of all, the footage is too bright. Blackpoint seems to be at 30~32 RGB, which is too high. Depending on the RGB<>YUV conversion standard, this is either 16 points too high ("Studio RGB"), or 32 points too high (sRGB).
Do you say this based on the screenshot, or the original DV, or the upscaled avi, or the YouTube video (or all 4)?
For the streetseller, the footage is more or less what came out of my Sony VX2000 on auto-exposure. After clipping to 16-235 with a curve, my histogram in Sony Vegas Pro looks like this:
http://dl.dropbox.com/u/21489814/burma-seller-histogram.png
I suppose the part below 32 may be mostly noise, but to me the levels look pretty good once the Adobe Flash Player has mapped them out to 0-255 on the YouTube page. There are no true blacks here anyway.
With levels corrected, you'll find the footage has more overall contrast, and less need for sharpening. (Perhaps it could be sharpened a 'lil bit, but then, it would be beneficial if the already-present "edge-enhancement" (dark halos beneath bright features) would be removed prior to that.)
How would you recommend I do that? Perhaps a different resizing kernel in the NNEDI_rpow2 function, instead of Spline36? Ot is there a filter that can do it?
To me, the video with the LSFmod sharpening looks vastly superior to that without, before sending to YouTube.
markanini
19th December 2011, 13:47
I had a look at the screenshot through 2.4 pure gamma calibrated 3DLUT and I agree a 32 black point looks more like intended. Keep in mind due to the sharpening inherent to the source, levels will exist outside of 32-235. Doing processing before mapping to 0-255 will make for a higher quality end result though, especially with some mt_convolution magic.
EDIT: So you plan to recieve payment for this footage? A free download link to those that helped would be in order :P
I'll have to remind myself about the board rules...
nhope
19th December 2011, 15:18
Thank you markanini.
I had a look at the screenshot through 2.4 pure gamma calibrated 3DLUT and I agree a 32 black point looks more like intended. Keep in mind due to the sharpening inherent to the source, levels will exist outside of 32-235.
*kicks self for presenting an ambiguous example*
Doing processing before mapping to 0-255 will make for a higher quality end result though, especially with some mt_convolution magic.
I am rather lost with mt_convolution. I just tried DeHalo_alpha at default settings, right before the LSFmod, and it did reduce the halos while softening the footage.
EDIT: So you plan to recieve payment for this footage? A free download link to those that helped would be in order :P
I'll have to remind myself about the board rules...
I'm a YouTube partner so I receive a share of the revenue received when viewers click ads on or around my videos. Is this a strictly amateur forum? I didn't see anything on the board rules that forbids me participating. Only that spamming and advertising is forbidden. I am very happy indeed to credit those that help. What exactly do you mean by a "free download link"?
markanini
19th December 2011, 15:41
*kicks self for presenting an ambiguous example*
Don't worry about it, we're here to learn. I believe Didée was right(when is he not?) about 32 black point being correct. Now, It might look better in some ways with a 16 blackpoint, depending on your monitor settings. I think the reason is high contrast and saturation pre-applied by the camera. Check if it's possible to adjust these in the camera for future projects. Same goes for sharpening.
If it was my project besides sticking with 32 black point I'd reduce contrast and saturation with Smootlevels, just before mapping to 0-255. Hang on I'll post an example just for fun.
I am rather lost with mt_convolution. I just tried DeHalo_alpha at default settings, right before the LSFmod, and it did reduce the halos while softening the footage.
Nothing beats mt_convolution for quality. Maybe someone will come along with some advice on parateter to use. It's certainly has a learning curve. Wish I could help with this one but I havent sunk my teeth into mt_convolution yet.
I'm a YouTube partner so I receive a share of the revenue received when viewers click ads on or around my videos. Is this a strictly amateur forum? I didn't see anything on the board rules that forbids me participating. Only that spamming and advertising is forbidden. I am very happy indeed to credit those that help. What exactly do you mean by a "free download link"?
You're right, while a majority are amateur it's not a strictly amateur forum and discussing commercial projects hasn't been disallowed as far as I can recall. Sorry about the confusion. Free download link or not is up to you, it was a tongue-in-cheek comment.
nhope
19th December 2011, 16:09
If it was my project besides sticking with 32 black point I'd reduce contrast and saturation with Smootlevels, just before mapping to 0-255.
A little bit of confusion here. I don't want to map to 0-255. I send YouTube 16-235 x264 files. The Adobe Flash Player maps it out to 0-255 during playback (for the vast majority of playback scenarios). If I send YouTube x264 at 0-255, everything outside of 16-235 gets clipped, just like in the broadcast/DVD/TV world. Example (http://www.youtube.com/watch?v=HE4h7ZNxLFA).
Free download link or not is up to you, it was a tongue-in-cheek comment.Well, it's YouTube, so it's all free to view anyway. Maybe I should send a free DVD to whoever nails the mt_convolution settings :D
The majority of my footage is underwater, so haloing is generally not as severe as it is on that streetseller.
markanini
19th December 2011, 17:13
My bad, I already played a bit with your screenshot:
http://i.imgur.com/BTtBH.jpg
SmoothLevels(input_low=32,output_low=235,chroma=150,TVrange=false,Lmode=1,darkSTR=50,brightSTR=50)
My point was that you could abuse the Chroma and Lmode settings to reduce the somewhat excessive contrast and saturation in a quick and dirty way.
Obviously underwater footage has different concerns. I remember some VirtualDub plugin examples that looked fantastic. I'll try to remember what that was and come back to you.
Didée
19th December 2011, 17:25
Perhaps yes, perhaps no ... main interest = halo removal, sharpening not seriously considered:
http://thumbnails43.imagebam.com/16534/9a6640165333529.jpg (http://www.imagebam.com/image/9a6640165333529)
# removegrain.dll
# medianblur.dll
# mt_masktools.dll
avisource("982x720-QTGMC-NNEDI-Spline36.avi")
pointresize(984,720,0,0,984,720) # need mod4 ...
converttoyv12( matrix="PC.601" ) # ... for YV12
o=last
small = o.bicubicresize(984-96,432,-.4,.2)
o.mt_makediff(mt_makediff(small,small.removegrain(20).removegrain(11)).bicubicresize(984,720),U=2,V=2)
o.repair(last,13)
o.repair(last,13)
xx=removegrain(11)
last.merge(last.sbr(),0.751).mt_adddiff(mt_makediff(xx,xx.minblur(3)),U=2,V=2)
last.mt_lutxy(o,"x y < x 1 + x y > x 1 - x ? ?",U=2,V=2)
smoothlevels(30,1.0,240,16,235)
interleave(o,last)
return(last)
#=====# Helper Functions #=====#
function sbr(clip o)
{
rg11=o.removegrain(11)
rg11D=mt_makediff(o,rg11)
rg11DD=mt_makediff(rg11D,rg11D.removegrain(11)).mt_lutxy(rg11D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?")
o.mt_makediff(rg11DD,U=2,V=2)
}
function MinBlur(clip clp, int r, int "uv")
{
uv = default(uv,3)
uv2 = (uv==2) ? 1 : uv
rg4 = (uv==3) ? 4 : -1
rg11 = (uv==3) ? 11 : -1
rg20 = (uv==3) ? 20 : -1
medf = (uv==3) ? 1 : -200
RG11D = (r==0) ? mt_makediff(clp,clp.sbr(),U=uv2,V=uv2)
\ : (r==1) ? mt_makediff(clp,clp.removegrain(11,rg11),U=uv2,V=uv2)
\ : (r==2) ? mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20),U=uv2,V=uv2)
\ : mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20).removegrain(20,rg20),U=uv2,V=uv2)
RG4D = (r<=1) ? mt_makediff(clp,clp.removegrain(4,rg4),U=uv2,V=uv2)
\ : (r==2) ? mt_makediff(clp,clp.medianblur(2,2*medf,2*medf),U=uv2,V=uv2)
\ : mt_makediff(clp,clp.medianblur(3,3*medf,3*medf),U=uv2,V=uv2)
DD = mt_lutxy(RG11D,RG4D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
clp.mt_makediff(DD,U=uv,V=uv)
return(last)
}
nhope
19th December 2011, 21:32
That's looking pretty good Didée. It seems to remove halos just a little bit more than DeHalo_alpha(). What do you reckon to LSFmod(defaults="slow",strength=500) after this? Too strong? Admittedly this girl is starting to send me blind.
manono
20th December 2011, 10:05
My own opinion is that the more you sharpen the poorer the quality and the more artifact-ridden it'll be after YouTube gets done with it. They don't do any quality-based encodes, but just bitrate encodes based entirely on the final height (360p, 480p, 720p, etc.) and use bitrates most of us here consider way too low. An LSFmod strength of 500 is pretty high. Maybe make two encodes and 2 uploads, one with a 500 strength and one without any sharpening, or maybe with a strength of 100. Then compare the results. You may (or may not) decide the softer one looks better overall.
2Bdecided
20th December 2011, 16:31
...and even more controversially, you might find the version with halos looks far better on the 240p/360p/480p downscales that your new version without.
Are the stats for how many people use each resolution (when a choice is available) published anywhere?
Cheers,
David.
nhope
20th December 2011, 16:57
I haven't seen such stats David, but I suspect far more people would watch the lower resolution versions, for now. As far as I know, you still even have to manually change your YouTube settings if you want videos to default to HD at full screen. Just tried it on my girlfriend's account and it was staying at 480p despite choosing full screen.
As most of my footage doesn't exhibit as much haloing as the streetseller clip, I've tried dropping the dehaloing routine completely, switching from spline36 to bicubic (in an attempt not to make the haloing worse), and used a moderate LSFmod strength of 200.
AviSource("d:\fs.avi")
AssumeBFF()
ConvertToYV12(interlaced=true, matrix="PC.709")
QTGMC( FPSDivisor=2 )
NNEDI3_rpow2(rfactor=2, cshift="bicubicresize", fwidth=984, fheight=720)
LSFmod(strength=200)
I've uploaded another video here (http://www.youtube.com/watch?v=jrsTWsruJA8) containing a typical mix of my DV footage upscaled this way. I would welcome any opinions or suggestions on it regarding deinterlacing/resizing/halos/sharpening.
I'm not too sure about Adobe Flash Player's upscaling. My offline media players seem to be better at it.
poisondeathray
20th December 2011, 17:21
As far as I know, you still even have to manually change your YouTube settings if you want videos to default to HD at full screen. Just tried it on my girlfriend's account and it was staying at 480p despite choosing full screen.
Not true
http://www.youtube.com/v/nhWBCoMzva8&hd=1
Some old YT tips & tricks guides (some might be outdated)
http://www.techairlines.com/2010/08/21/useful-youtube-url-tricks/
Dogway
20th December 2011, 17:51
I've uploaded another video here (http://www.youtube.com/watch?v=jrsTWsruJA8) containing a typical mix of my DV footage upscaled this way. I would welcome any opinions or suggestions on it regarding deinterlacing/resizing/halos/sharpening.
I can give you some tips I gathered from observation on own experience.
I wouldn't do a nnedi3 upsize after QTGMC deinterlace. It adds a too "antialiased" look (nnedi3 twice). You can either use a different resizer or try the lossless/sourcematch feature of QTGMC although by doing the latter your script would get really slow.
Since footage is mostly underwater I think it would benefit from the dither tools in order to help soothe quantization banding, and upload an already h.264 encoded file rather than lossless file, although I doubt you did this. By some reason at low quality encodes it seems to retain more quality a h.264HQ->h.264LQ than lossless->h.264LQ.
I would do most of the sharpening inside QTGMC too
nhope
20th December 2011, 18:16
Thanks for the replies.
Not true
I think you may have misread my message, or I wasn't clear enough. I meant the default resolution when someone clicks the full screen symbol at the bottom right of a video. It appears to be controlled by this YouTube setting, which is off by default:
http://dl.dropbox.com/u/21489814/YoutubeHD.png
Of course if you have great bandwidth and are in a more developed part of the world, you may well get HD anyway at full screen. Here in Thailand we were getting 480p at full screen until checking that box. By the way the link you gave me was for a YouTube video to fill the browser, not the screen.
I wouldn't do a nnedi3 upsize after QTGMC deinterlace. It adds a too "antialiased" look (nnedi3 twice). You can either use a different resizer or try the lossless/sourcematch feature of QTGMC although by doing the latter your script would get really slow... ...I would do most of the sharpening inside QTGMC too
I take your point about 2 x NNEDI3. Aren't lossless/sourcematch/sharpening going to be rather wasted in QTGMC because that detail would be somewhat lost in the subsequent upscale from 720x576 to 984x720? I thought I should be doing sharpening after upscaling?
Since footage is mostly underwater I think it would benefit from the dither tools in order to help soothe quantization banding, and upload an already h.264 encoded file rather than lossless file, although I doubt you did this. By some reason at low quality encodes it seems to retain more quality a h.264HQ->h.264LQ than lossless->h.264LQ.
Actually I did upload a crf18 x264 file (I put the upscaled UT-video clip back on my timeline to add the text, then rendered out in MeGUI). What dither tools do you mean?
SSH4
22nd December 2011, 22:37
Try eedi3_rpow2 on some source i have better upscale result than last nnedi3. After nnedi3 edges looks a little bit plastic :(
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.