I have a few Anime episodes only available in 480p (old) and I want them to be 1080p. I've tried Avisynth, Video Enhancer & After Effects. Problem is, when the quality is good, it takes like 5~8 hours to encode, which is wayyy too long for me.
What can I do to preserve as much quality as possible? Size doesn't matter to me, quality and encode time do.
Here's a MediaInfo of a file I want to encode as an example:
Code:General Unique ID : 244857016911356285905704324365619845703 (0xB835BF002AA2BFC2A7EC2B3A78105A47) Complete name : C:\Users\Jeroen\Videos\TEST\480.mkv Format : Matroska Format version : Version 2 File size : 140 MiB Duration : 22mn 36s Overall bit rate : 864 Kbps Encoded date : UTC 2012-10-02 19:42:08 Writing application : mkvmerge v5.2.0 ('I can't explain') built on Dec 18 2011 18:12:03 Writing library : libebml v1.2.3 + libmatroska v1.3.0 Attachements : Amira-Semibold.otf Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 6 frames Codec ID : V_MPEG4/ISO/AVC Duration : 22mn 36s Nominal bit rate : 768 Kbps Width : 848 pixels Height : 480 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.079 Writing library : x264 core 120 r2120 0c7dab9 Encoding settings : cabac=1 / ref=6 / deblock=1:1:1 / analyse=0x1:0x111 / me=umh / subme=8 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=768 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=1536 / vbv_bufsize=3840 / nal_hrd=none / ip_ratio=1.40 / aq=1:0.60 Default : Yes Forced : Yes Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : A_AAC Duration : 22mn 36s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 44.1 KHz Compression mode : Lossy Default : Yes Forced : Yes Text ID : 3 Format : ASS Codec ID : S_TEXT/ASS Codec ID/Info : Advanced Sub Station Alpha Compression mode : Lossless Default : Yes Forced : Yes
+ Reply to Thread
Results 1 to 30 of 30
-
-
Too long to upscale or too long to encode? Are you performing any other filtering?
-
Encode, I guess. I execute the filter using Virtualdub, and it takes 5h to render the file.
As for filtering, I'm using this (Avisynth):
Code:import("c:\Program Files (x86)\AviSynth\plugins\GradFun2DBmod.avs") LoadPlugin ("C:\Program Files (x86)\AviSynth\plugins\RemoveGrainSSE2.dll") LoadPlugin ("C:\Program Files (x86)\AviSynth\plugins\dfttest.dll") LoadPlugin ("C:\Program Files (x86)\AviSynth\plugins\gradfun2db.dll") ffvideosource("480.mkv") nnedi3_rpow2(rfactor=2,cshift="spline64resize") spline64resize(1696,960) crop(8,6,-8,-6) spline64resize(1920,1080) crop(0,120,-0,-120) dfttest(sigma=8.0) aWarpSharp2(depth=20) Gradfun2dbmod(str=0,radius=1,range=1, adapt=1, temp=20, thr=2)
-
Why need it STORED as 1080p? Why not just leave it as is and let your TV scale it on playback?
Scott -
I want to watch the video on my tablet, not my TV, as my family is using it. And my tablet has a 1600p resolution, so scaling looks horrible.
On a side note: Does it matter if you use a TV, Computer or Tablet when talking about resizing? How does the device influence the resize?
Edit: Got to go, I'll return tomorrow.Last edited by fighuass; 4th Sep 2015 at 14:07.
-
please don't say resizing if you mean scaling and vise versa, it confuses the issue (at least for me)
resize is when you are processing /encoding to a new file
scaling is what the TV or video player does to display it
and if your tablet does a bad job of upscaling the video, maybe you should try a different "player" app/program on your tablet -
"ffvideosource("480.mkv")
nnedi3_rpow2(rfactor=2,cshift="spline64resize")
spline64resize(1696,960)
crop(8,6,-8,-6)
spline64resize(1920,1080)
crop(0,120,-0,-120)"
if i'm reading this correctly your resizing TWICE aka 2 times
what the heck for ?
resize it one time, it won't take as long and the quality will be better -
I'm using this script from a blog, but I believe it's done to get the correct aspect ratio. I'll try just resizing it once tomorrow.
-
why crop away video top an bottom to make it fit the 16:9 screen, thats a waste
resize once once to double height and width, it will almost fill the screen, black bars on the side, but you will have the full frame
nothing removed
and BTW if your forcing Mxplayer to stretch the original video to 16:9
that is why it looks bad -
Good point, but is there a way to put the black bars on the top and bottom of the video instead of the sides?
-
that depends on the aspect of the source file
4:3 is almost square, 16:9 is wide, you can't but bars on top an bottom, with out cropping away video
unless you want to hold your tablet vertical
if your tablet is truly HD 1920/1080
and you resize to 1080/ XX, where 1080 is the width
and play the video with the tablet vertical
you will have bars top and bottom
Me i would prefer just double size, and watch normal, with bars on the side
just like watching an old TV show on a new TV -
Crop before any scaling. Then scale only once. But none of those filters is especially slow. Your problem is the encoding time. Use faster settings in the encoder.
nnedi3 is probably the best upscaler for AviSynth -- better than any media player or TV can do. Sometimes upscaling in two steps with an aWarpSharp() and Sharpen() in between can give sharper results with animation. -
I'll change the script to
Code:ffvideosource("480.mkv") nnedi3_rpow2(rfactor=2,cshift="spline64resize") crop(0,120,-0,-120) spline64resize(1920,1080)
-
-
Hmm, I think I'd best drop the cropping entirely and seeing how it works out. On a side note, what's the most lightweight anti aliasing filter?
-
Why? The equivalent using your crop values are:
Code:ffvideosource("480.mkv") crop(0,60,-0,-60) nnedi3_rpow2(rfactor=4,cshift="spline64resize", fwidth=1920, fheight=1080)
Or in two steps:
Code:ffvideosource("480.mkv") crop(0,60,-0,-60) nnedi3_rpow2(rfactor=2,cshift="spline64resize", fwidth=1280, fheight=720) aWarpSharp(depth=2) Sharpen(0.2) nnedi3_rpow2(rfactor=2,cshift="spline64resize", fwidth=1920, fheight=1080) aWarpSharp(depth=2) Sharpen(0.2)
I don't know which is the lightest weight but I usually use Santiag() when I need antialiasing. It does a reasonable job without causing too much damage.Last edited by jagabo; 4th Sep 2015 at 16:37.
-
I don't think the cropping's that necessary, but as I said, I'll test it.
-
The frame size and bit rate you are starting with doesn't seem like it could be very good quality to start.
That may be the main reason it looks like crap on your tablet, I could be wrong it's according to the content.
If it needs denoising that should be done before the re-sizing, that's one reason the script was taking so long to render, you were denoising after the resize.
Spline64 has no big advantage over spline36, but spline36 is faster and about the same quality the difference between the two is hardly noticeable at all.
If it were me I would denoise, maybe a light awarpsharp, and then nnedi3_rpow2(rfactor=2).
If you leave out the cshift parameter it speeds up nnedi3, thats just to correct the center shift that nnedi3 introduces, it's not noticeable unless you compare screenshots.
There's really no benefit to resizing it to 1080p unless your tablets upscaling is utter crap, it will just waste time re-encoding and sd/hdd space.
But if you have to I would do it in one step with
nnedi3_rpow2(rfactor=2,cshift="Spline36Resize", fwidth=1920, fheight=1080)
Or
nnedi3_rpow2(rfactor=2,cshift="Lanczos4Resize", fwidth=1920, fheight=1080)
edit: I meant to type spline36, all corrected.Last edited by gregalan; 5th Sep 2015 at 11:06. Reason: Corrections
-
Whoa, after tweaking the script quite a lot, it's now only 50 minutes. That's fast.
What the script now looks like:
Code:ffvideosource("480.mkv") aWarpSharp(depth=40) Toon(strength=1) nnedi3_rpow2(rfactor=2,cshift="Lanczos4Resize", fwidth=1920, fheight=1080)
-
Somehow I missed the full script in post #3 and only saw the partial script quoted by thewizard in post #8. dfttest(sigma=8) is the biggest CPU hog in the full script. As gregalan pointed out, calling dfttest after cropping but before upscaling will be much faster.
aWarpSharp(depth=40) is really going to distort the picture and create a lot of buzzing edges.
Since we haven't seen your source it's hard to recommend particular settings. But try something like:
Code:ColorMatrix(mode="rec.601->rec.709") Santiag() UnDot() TemporalDegrain(SAD1=200, SAD2=150, Sigma=8) nnedi3_rpow2(2,cshift="Spline36Resize", fwidth=1440, fheight=1080) MergeChroma(aWarpSharp(depth=10), aWarpSharp(depth=20)) Sharpen(0.2)
-
If your resizing, you don't need to up scale while playing
If you want to let the player upscale, you don't need to resize
Just remember Not to stretch the video to 16:9, let it play in the original aspect 4:3 / 5:4 ?
Do a test, compare the new video in mx player to the source,not stretched
And go with want looks best to you
With a clean clear crisp quality source, there is probably little difference
But with an Iffy source, the re-encoded resized file will probably look betterLast edited by theewizard; 5th Sep 2015 at 11:21.
-
Except for the shifting focus, it looks good, and does not needed be resized
I don't think You are not going to fix the focus problem by resizing, or sharpening
That will be a tedious frame by frame processes
Somebody else might know a short cut, but that is beyond me
When recording a screen with a camera, Turn Off Auto Focus
Set it manually and leave it -
I'm not sure if it's my tablet or the player, and the shifting focus is intended to be a part of the video's "intro". Later on it disappears.
-
then I would just do the test I mentioned above
But I think you will see little difference,
Unless your tablet is really poor at upscaling -
It's annoying trying to work with that video because there are so few clear frames between the blurred sections. Noise reduction, halo reduction, etc. mostly just made it worse so I left it at this:
Code:ColorMatrix(mode="rec.601->rec.709") aWarpSharp(depth=2) nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=1080) MergeChroma(aWarpSharp(depth=5), aWarpSharp(depth=20)) Sharpen(0.2)
-
^I get an error when opening the script,
"Script error: expected a or )
line 3 column 38
EDIT: Nevermind, it should be
Code:ColorMatrix(mode="rec.601->rec.709") aWarpSharp(depth=2)
Code:ColorMatrix(mode="rec.601->rec.709aWarpSharp(depth=2)
Last edited by fighuass; 6th Sep 2015 at 05:36.
Similar Threads
-
converting 720p or 1080p to 480p video
By Freelife2345 in forum Video ConversionReplies: 10Last Post: 27th Dec 2014, 07:49 -
Converting 1080p video to 720p and 480p
By ROBO731 in forum Video ConversionReplies: 5Last Post: 11th Jun 2014, 13:17 -
When will a video called 240p/360p/480p/720p/1080p
By psycholyzern in forum Newbie / General discussionsReplies: 13Last Post: 11th Nov 2013, 13:53 -
Better Blu-Ray quality letting Vegas upscale or converting to 1080p first?
By brassplyer in forum Video ConversionReplies: 5Last Post: 5th Nov 2012, 01:31 -
What's the deal with # of p? 480p, 720p, 1080p?
By Inertially in forum Newbie / General discussionsReplies: 61Last Post: 30th Oct 2010, 10:25