View Full Version : SD to HD
Matteo
11th January 2015, 10:00
Hello everyone !
I need 'to convert a file in an SD to HD, because i want watch sd video in big tv....
I would like to do it through avisynt and HC ENC , you could tell me the script to use and any plug-in to download ?
I can tell you that the initial file is a normal AVI DV PAL 25fps .
ps . I will convert the resulting file to MP4 AVC \ H264 .
Unfortunately i'm not very practical English!
thanks interest
feisty2
11th January 2015, 10:19
given by the quality of ur source clip
if the quality is already incredibly great, clean, rich detailed, sharp, free of any artifacts, the ideal type, use nnedi3 to do the work
otherwise, if it's not that lucky, like the clip has been lossily compressed, or blurry or whatever, pick eedi3 to get ur blow up done
Asmodian
11th January 2015, 10:34
Do not forget:
ColorMatrix (http://avisynth.org.ru/docs/english/externalfilters/colormatrix.htm)(mode="Rec.601->Rec.709")
As well.
edit:
example:
AVISource("PAL.AVI")
ColorMatrix(mode="Rec.601->Rec.709")
nnedi3_rpow2 (http://avisynth.nl/index.php/Nnedi3)(rfactor=2,cshift="Spline36Resize",fwidth=X,fheight=Y)
As mentioned you could also try eedi3_rpow2 (http://avisynth.nl/index.php/Eedi3) instead of nnedi3_rpow2.
johnmeyer
11th January 2015, 11:04
Your TV set probably does a pretty good job of upscaling. I'm not sure the results from having AVISynth plugins doing that same upscaling will be sufficiently better to justify the time and effort to do it using a complex script. As an example of what I'm talking about, I am absolutely amazed at how good SD DVDs can look when played on my upscaling DVD player and TV.
You might want to do a comparison on a one minute clip, first playing it natively and letting the TV do the upscaling, and then doing your own upscaling and playing the resulting HD video. Do that side-by-side test before you commit to spending lots of time on this effort.
Matteo
11th January 2015, 11:06
Thanks! i've try your scritpt!!
feisty2
11th January 2015, 11:55
Notice nnedi3 is ultra sharp comparing to eedi3 or regular resizers, and it's also kinda aggressive, it could animate ur clip a little bit if the clip is natural images, it's good for animes, I never used it for real life video upscaling actually
Eedi3 is soft and more neutral, and not blurry like bilinear nor like sinc filters, sharp but with tons of artifacts, aliasing, ringing... perfect for natural images
I always use eedi3 + warpsharp with a very thin edgemask, it always works better on my clips
Matteo
11th January 2015, 12:15
:thanks:
:script:
WarpSharp(depth=30, threshold=40)
EdgeMask (clip[, int "thY1"[, int "thY2"[, int "thC1"[, int "thC2"[, string "type"]]]]]) ????
:helpful:
@johnmeyer, thanks wise words!!!
SeeMoreDigital
11th January 2015, 12:46
If your dv.avi source is 'pure interlaced' I recommend you generate a pure interlaced AVC encode at the same resolution...
Ghitulescu
12th January 2015, 11:43
The best answer has already been mentioned here.
Many TVs have now, even the budget ones, a pretty good upscaler. Surely a dedicated upscaler costs many times more (I remember the times when upscalers from DVD to native resolution of projectors started around 2000€) and not always better visually than a cheap, integrated one (I said visually).
Now, my TV is 2007, and it had the most advanced upscaler available back then. However, a BD player of last years, a Pioneer 160 (a budget model for Pioneer) beats it night and day.
What are the conclusions?
Simple - upscaling the SD content to HD they way you want has two big disadvantages. 1. it will increase the size of the file. and 2. the upscaling is "fixed", that is next year it may be that the TV would be better than what you did in software.
My personal advice to you - keep the sources as they are, especially if you don't know how to improve them, the engineers are pretty well prepared to give you an already good image for you to simply insert the USB stick and enjoy. It is called progress. If your TV is ancient, you may invest 150€ into a medium BDplayer or even 300€ into a mediaplayer (like Popcorn, Dune, Oppo etc).
feisty2
12th January 2015, 12:56
there's no upscale magic yet, inside tv or softwares on computer, unless the TV or the upscale software got a fairly advanced neural network or whatever similar and can add new imaginary details to ur low res clip, which seems highly impossible currently, otherwise, its all just about trade offs between sharpness and artifacts, sharp with aliasing and ringings or artifacts free but blurry like hell, eedi3 and nnedi3 seem perfect if you just conclude from this sharpness vs artifacts side, but clearly they are not, cuz sharpness aint details, the upscaled clip is indeed "sharp" and free of aliasing and ringings, but you can still get this "hell, it's upscaled" feeling at the first sight, the whole image looks rough and not like native high res clips at all, since eedi3 and nnedi3 have achieved the goal of both sharpness and no artifacts together, unless there's some AI black magic inside tv, I don't see tv can beat eedi3/nnedi3 quality wise otherwise
wonkey_monkey
12th January 2015, 13:23
unless there's some AI black magic inside tv, I don't see tv can beat eedi3/nnedi3 quality wise otherwise
There's only one way to find out... fiiiight!
If there's a good upscaling test image out there, I can run it through nnedi3/eedi3 and also my Samsung TV, which has (in my experience) a very good upscaler, although it is a few years old. I think I can get direct screenshots of the display thanks to some third-party apps developed for it.
David
feisty2
12th January 2015, 14:48
If there's a good upscaling test image out there
how about this one, one frame from a decent quality music video DVD, sharp and rich detailed, converted to rgb48 with dither package
http://i.imgur.com/iHpeMFR.png
SeeMoreDigital
12th January 2015, 15:41
how about this one, one frame from a decent quality music video DVD, sharp and rich detailed, converted to rgb48 with dither package
http://i.imgur.com/iHpeMFR.png
You can't tell from that image whether the video source is progressive or interlaced. Knowing such information is vital before determining how it can be processed ;)
feisty2
12th January 2015, 15:56
That's an image, one single frame from a clip, basically its a photo
And there's no "interlaced" photo
The source clip is telecined if u wanna know
Edit: if ur gonna do the test on that image, why the source is interlaced or not matters, even if the source was interlaced, and that was a still shot so no interlace artifacts, you could still treat that image as progressive anyway, ur not doing the test on a video, but a photo
SeeMoreDigital
12th January 2015, 15:59
That's an image, one single frame from a clip, basically its a photo
And there's no "interlaced" photo
The source clip is telecined if u wanna knowIndeed... You can't work from a photo. You need a few frames from the unprocessed video source!
feisty2
12th January 2015, 16:10
Why, upscaling image is a spatial interpolation, it processes every frame in the video separately anyway
One frame is enough
Edit: take a peek at tritical's website, samples for eedi3/nnedi3 are all single photos, not video clips :)
They are all spatial filters
Video samples are only required to test filters like mvtools ;P
MysteryX
12th January 2015, 20:16
I've been experimenting in developing a software that makes upgrading the image quality of SD videos easy. I was dealing with something similar: PAL 25fps VCDs in 288p with lots of encoding artifacts.
I came up with 3 presets that work best. First I convert it to AVI with FFMPEG.
If you guys have suggestions for improvement, let me know.
Preset: Good VCD (fast)
PluginPath = "Encoder\"
AviSource("Preview.avi", audio=false, pixel_type="YV12")
LoadPlugin(PluginPath+"FFT3DFilter.dll")
fft3dfilter(sigma=3, bt=5, bw=48, bh=48, ow=24, oh=24, ncpu=8)
LoadPlugin(PluginPath+"nnedi3.dll")
nnedi3_rpow2 (2)
nnedi3_rpow2 (2)
Spline36Resize(960, 720)
fft3dfilter(bt=-1, sharpen=0.1, ncpu=8)
Preset: Average VCD (very slow)
PluginPath = "Encoder\"
AviSource("Preview.avi", audio=false, pixel_type="YV12")
LoadPlugin(PluginPath+"FFT3DFilter.dll")
fft3dfilter(sigma=3, bt=5, bw=48, bh=48, ow=24, oh=24, ncpu=8)
LoadPlugin(PluginPath+"nnedi3.dll")
nnedi3_rpow2 (2)
LoadPlugin(PluginPath+"eedi3.dll")
eedi3_rpow2 (2)
Spline36Resize(960, 720)
fft3dfilter(bt=-1, sharpen=0.2, ncpu=8)
Preset: Noisy VCD (slow)
PluginPath = "Encoder\"
AviSource("Preview.avi", audio=false, pixel_type="YV12")
LoadPlugin(PluginPath+"FFT3DFilter.dll")
fft3dfilter(sigma=3, bt=5, bw=48, bh=48, ow=24, oh=24, ncpu=8)
LoadPlugin(PluginPath+"nnedi3.dll")
LoadPlugin(PluginPath+"eedi3.dll")
eedi3_rpow2 (2)
nnedi3_rpow2 (2)
Spline36Resize(960, 720)
fft3dfilter(bt=-1, sharpen=0.3, ncpu=8)
Now... what is that ColorMatrix thing?
wonkey_monkey
12th January 2015, 20:44
It turns out that finding a still image that actually shows much of a difference between bicubic, nnedi3, and TV scaling is really hard.
Image (http://horman.net/daleks.jpg)
In order from top to bottom, this is:
Nearest neighbour (original)
Bicubic
nnedi3
Samsung TV (which had adjusted levels which I've tried to adjust back to match)
There's very little difference between any of the upsizers.
I think nnedi3's real power is in filling in missing information, e.g. for deinterlacing. That's something I can't really compare against the TV, since it almost certainly does mocomp'd deinterlacing, and probably won't apply deinterlacing principles to a simple image zoom.
David
MysteryX
12th January 2015, 20:57
You'll find a comparison of upscalers on madVR's page
http://forum.doom9.org/showthread.php?t=146228
Reel.Deel
12th January 2015, 21:58
@davidhorman
How did you capture the output of the TV?
MysteryX
12th January 2015, 21:59
Do not forget:
ColorMatrix (http://avisynth.org.ru/docs/english/externalfilters/colormatrix.htm)(mode="Rec.601->Rec.709")
I added an option to add this ColorMatrix line to my script.
I'm still a bit confused as to when it is needed. In the simplest way, which videos require this line and which don't?
I'm also using the MediaInfo.dll library to get information about the source file. Is there any information I can get from MediaInfo that will tell me whether or not ColorMatrix is required?
https://mediaarea.net/en/MediaInfo
MysteryX
12th January 2015, 22:04
@davidhorman
How did you capture the output of the TV?
Who still watches TV anyway?
MysteryX
12th January 2015, 22:42
Here are some sample results from the scripts I posted.
Here's an upscaled 288p Thai VCD. Quality now looks pretty good!
https://www.youtube.com/watch?v=2Yq_sVJb6qk
I also downloaded some low-quality YouTube videos, upscaled them and re-uploaded them in higher quality
This one was a difficult case
Before: https://www.youtube.com/watch?v=2t9e5wzLGxA
After: https://www.youtube.com/watch?v=NoLVG7w-69E
Here's another one. In this case I also added InterFrame to convert from 18fps to 29.97fps
Before: https://www.youtube.com/watch?v=RzToNo7A-94
After: https://www.youtube.com/watch?v=N-6ufoSp_2A
And another sample
Before: https://www.youtube.com/watch?v=57yJGs7vgNk
After: https://www.youtube.com/watch?v=pWpA-0N1nqw
Most people assume you can't improve a video beyond the original source. I proved them wrong.
wonkey_monkey
12th January 2015, 23:41
How did you capture the output of the TV?
Someone wrote a screen capture app for it. It's a Samsung B series LED TV, for which some people worked out how to write their own apps and get the TV (and other models) to run them.
http://www.samygo.tv/
There are screen resizers, a 3D to anaglyphic converter, and even a port of Quake I.
Reel.Deel
12th January 2015, 23:44
Cool, thanks for the link!
feisty2
13th January 2015, 04:43
@davidhorman
did you do a 4x upscale ?
all resizers seem pretty much the same on large factor upscale
maybe do a 2x upscale and compare again?
EDIT:
my test on ur image (pointresized the first one in ur image sequence back to 320x120 and did a 2x upscale)
http://i.imgur.com/6IkWnFd.png
eedi3 wins yet again
bicubic - no comment...
spline64 - aliasing
nnedi3 - cartoonized
eedi3 - no aliasing and still natural
MysteryX
13th January 2015, 06:07
I find EEDI3 to have lower sharpness than the original.
wonkey_monkey
13th January 2015, 23:57
To round out the image above, here's the result of a 2x on my Samsung TV (although this is with the internal image video, not internal video playback, which may possibly use different upscaling)
http://horman.net/samsung.jpg
Bear in mind there is a levels shift and possibly also a slight subpixel shift.
foxyshadis
14th January 2015, 08:52
I added an option to add this ColorMatrix line to my script.
I'm still a bit confused as to when it is needed. In the simplest way, which videos require this line and which don't?
I'm also using the MediaInfo.dll library to get information about the source file. Is there any information I can get from MediaInfo that will tell me whether or not ColorMatrix is required?
https://mediaarea.net/en/MediaInfo
99% of the time, anytime when you go from SD to HD, and only then. SD is always assumed to be 601, HD is always assumed to be 709, unless overridden in the decoder chain somehow, manually or with the proper flags.
But some SD content is 709 and some HD stuff is 601. The real world is real weird... thus the flags, but you can't always trust them either. MediaInfo will tell you as "Matrix coefficients" if it's signaled; if not, assume the defaults.
Edit: Just saw your other thread, sorry.
Zenitram
14th January 2015, 13:44
I'm also using the MediaInfo.dll library to get information about the source file. Is there any information I can get from MediaInfo that will tell me whether or not ColorMatrix is required?
https://mediaarea.net/en/MediaInfo
MediaInfo::Get(Stream_Video, 0, "colour_primaries";
MediaInfo::Get(Stream_Video, 0, "transfer_characteristics";
MediaInfo::Get(Stream_Video, 0, "matrix_coefficients";
Depending of what your are looking for ("ColorMatrix" does not exist).
Asmodian
15th January 2015, 03:14
Depending of what your are looking for ("ColorMatrix" does not exist).
ColorMatrix is the Avisynth function that does the conversion. ;)
Matteo
31st January 2015, 09:21
Hello guys! Sorry for the later but i haven't a lot of time and before reply i must be translate your post...
I haven't a big tv, and my tv isn't new... i want create a hd file from sd for other people, and i don't know the model of their tv.
I try to do first script but hcenc tell me this error:
https://www.dropbox.com/s/5iyeph1n1k1puh3/errore%20sd%20to%20hd.JPG?dl=0
The file that i want to convert is:
https://www.dropbox.com/s/6fyvk4wp9skiyfk/dv.avi?dl=0
and the media properties is:
https://www.dropbox.com/s/gs8am02abn36av0/Propriet%C3%A0%20dv.jpg?dl=0
Thank for interest!
foxyshadis
31st January 2015, 09:33
Install ffdshow (http://sourceforge.net/projects/ffdshow-tryout/files/SVN%20builds%20by%20clsid/generic%20builds/ffdshow_rev4533_20140929_clsid.exe/download) and only select the VFW interface. If you use 64-bit HCenc, also install 64-bit ffdshow (http://sourceforge.net/projects/ffdshow-tryout/files/SVN%20builds%20by%20clsid/64-bit%20builds/ffdshow_rev4533_20140929_clsid_x64.exe/download).
Matteo
31st January 2015, 11:00
Thank you!
Now i have found a good tutorial about ffdshow and avisynth.. and the language is italian!! ;)
Matteo
1st February 2015, 20:57
Ok i "understand" to use ffdshow... but with ffdshow i can't do a script for hcenc.
foxyshadis
3rd February 2015, 00:50
ffdshow is only used for the AviSource part of the script. The rest of the script should work OK, if there's another error we can help you fix that too.
Matteo
3rd February 2015, 02:35
Thanks!! I think the problem is nnedi3, because my avisource is interlaced:
https://www.dropbox.com/s/gs8am02abn36av0/Propriet%C3%A0%20dv.jpg?dl=0
But the first problem is canonpus codec... now i found it and install in the pc...
LemMotlow
3rd February 2015, 16:51
It doesn't appear to be interlaced to me. Just encoded that way.
[EDIT] Oops. Yes it is. DirectShowSource plays it as progressive.
LemMotlow
3rd February 2015, 22:11
Thanks!! I think the problem is nnedi3, because my avisource is interlaced:I used a different resizer from the dither plugin:
Dither_convert_8_to_16 ()
Dither_resize16 (1280, 720, kernel="spline36", cplace="MPEG2")
DitherPost()
Some odd interlace going on with the original. Motion noise will look a little worse in HD. In the original, IRE levels and gamma are too high and brights are clipped.
original:
https://www.mediafire.com/?cplwq3gvl23ofdk
More natural IRE levels:
https://www.mediafire.com/?o3w9zp24zeef2gv
sample effort, SD to HD, 50fps progressive (encoded for BluRay), 9MB:
https://www.mediafire.com/?4mh2e5v67spgvpg
Matteo
4th February 2015, 09:59
Wow... but my camera is sony hvr z1e!, And it's give to me 50i. Now i haven't time to try but if the result is this it'wonderful!
LemMotlow
4th February 2015, 11:21
but my camera is sony hvr z1e!, And it's give to me 50i.
50i = 25 interlaced frames per second, or 50 fields. When 25fps is deinterlaced, it becomes 50fps progressive and the number of frames is doubled. Your transfer to Canopus DV has the usual interlace and motion noise. It is too noisy for 1920x1080 but it resizes fairly well to 1280x720 HD.
Standard BluRay Video codecs allowed:
------------------------------------
- MPEG2 - MP@HL and MP@ML
- AVC/H264 - MPEG-4 AVC: HP@4.1/4.0 and MP@4.1/4.0/3.2/3.1/3.0
- VC-1 - AP@L3 and AP@L2
Video frame sizes
-----------------
High Definition BluRay Video
1920x1080 29.97 frames interlaced / 59.94 fields (16:9) NTSC
1920x1080 25 frames interlaced / 50 fields (16:9) PAL
1920x1080 24 frames progressive (16:9)
1920x1080 23.976 frames progressive (16:9)
1440x1080 29.976 frames interlaced / 59.94 fields (16:9) NTSC
1440x1080 25 frames interlaced / 50 fields (16:9) PAL
1440x1080 24 frames progressive (16:9)
1440x1080 23.976 frames progressive (16:9)
1280x720 59.94 frames progressive (16:9) NTSC
1280x720 50 frames progressive (16:9) PAL
1280x720 24 frames progressive (16:9)
1280x720 23.976 frames progressive (16:9)
Standard Definition BluRay Video
720x480 29.97 frames interlaced / 59.94 fields (4:3/16:9)
720x576 25 frames interlaced / 50 fields (4:3/16:9)
Summary of BluRay/AVCHD standards: http://www.videohelp.com/hd#tech
Standards for AVCHD are similar.
The script I used is below. I did not have time to try to fix all of the moire and line twitter during motion. Canopus DV gurus could possibly help with that. Perhaps it's a capture problem. I gave up on DV transfers years ago.
LoadVirtualDubPlugin("path:\VirtualDub\plugins\ColorMill.vdf","ColorMill",1)
LoadVirtualDubPlugin("path:\VirtualDub\plugins\ccd_sse2.vdf","CamcorderColorDenoise",1)
AviSource("path:\to\video\dv.avi")
ConvertToYV12(interlaced=true)
ColorYUV(off_y=-18)
SmoothLevels(10,0.95,255,16,250,chroma=200,limiter=0,tvrange=true,dither=100,protect=6)
SmoothTweak(contrast=1.1,saturation=1.4)
QTGMC(preset="medium")
Blur(0.4,0.4)
Dither_convert_8_to_16 ()
Dither_resize16(1280, 720, kernel="spline36", cplace="MPEG2")
DitherPost()
LimitedSharpenFaster()
ConvertToRGB32(matrix="Rec601",interlaced=false)
ColorMill(25700, 25700, 25700, 25700, 26980, 25717, 25700, 25700, 25700, 25700,\
24932, 25653, 25700, 1124, 5)
CamcorderColorDenoise(16,1)
ConvertToYV12(interlaced=false)
It is encoded as HD MPEG2 using TMPGenc Video Mastering Works.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.