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.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd September 2018, 09:15   #1  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Get smaller files with a grainy movie?

I do got a grainy movie that I'm trying to convert to a smaller file, everytime i try in Virtualdub the file ends up around 30gb, but when using another film (same size, fps) it ends up around 2-3 gb. (okey size)

I don't know if its because the grain but I know when adding grain it can be so mutch larger. is it because of H.642 is wrong? I tried changing the settings to grainy but it only makes it larger (ca 36gb)

I did try H.645 and it works great and okey size but it won't play on my bluray-player. :/
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 23rd September 2018, 09:23   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
What H.264 encoder are you using? x264? Then if filesize is too big increase CRF.
sneaker_ger is offline   Reply With Quote
Old 23rd September 2018, 15:05   #3  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
At the moment, you are probably using CRF mode. This can produce a way smaller or larger file, at the same CRF value, depending on the "complexity" of the content.

If you need to hit a specific file size, better use 2-Pass mode. This allows you to specify the target (average) bitrate in such a way that the desired file size will be hit exactly – and you'll still get the best possible quality out of that file size.

Of course you could also try to fiddle around with the CRF value until it happens to produce a file of the desired size. But that's effectively like doing 2-Pass the hard way "by hand".

(BTW: If you try to squish a "grainy" movie into a small file size, the results may not look that great, no matter what. In that case, pre-processing with a good denoise/degrain filter, e.g. MDegrain, can work real wonders!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 23rd September 2018 at 15:11.
LoRd_MuldeR is offline   Reply With Quote
Old 23rd September 2018, 16:49   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by LoRd_MuldeR View Post
(BTW: If you try to squish a "grainy" movie into a small file size, the results may not look that great, no matter what. In that case, pre-processing with a good denoise/degrain filter, e.g. MDegrain, can work real wonders!)
Absolutely, here existing easy use script function for avs (suggest latest Pinterf avs+, and latest Pinterf MvTools2), courtesy of Didee.

Code:
Function MCDegrain(clip c, int "frames")
{ # By Didee, http://forum.doom9.org/showthread.php?p=1508289#post1508289

	frames = default(frames, 2)
	bs = (c.width>960) ? 16 : 8
	super = c.MSuper(pel=2, sharp=1)
	backward_vec3 = MAnalyse(super, isb = true, delta = 3, blksize=bs, overlap=bs/2)
	backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=bs, overlap=bs/2)
	backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=bs, overlap=bs/2)
	forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=bs, overlap=bs/2)
	forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=bs, overlap=bs/2)
	forward_vec3 = MAnalyse(super, isb = false, delta = 3, blksize=bs, overlap=bs/2)	
	(frames<=0) ? c :\
	(frames==1) ? c.MDegrain1(super, backward_vec1,forward_vec1,thSAD=400) :\
	(frames==2) ? c.MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) :\
		      c.MDegrain3(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400)
	return(last)
}
Code:
AviSource("...") # or whatever source filter
ConvertToYV12
Frames=1 # or 2 or 3, higher stronger denoise (greater temporal radius)
MCDegrain(frames=Frames) # mvtools2 in plugins dir
EDIT: Not for interlaced, Think there is an interlaced version somewhere.

EDIT: With sharpening in good matching areas and slight bluring in bad matching areas, if very grainy might not be an improvement,
but I use on almost every clip and love it.
Code:
Function MCDegrainSharp(clip c, int "frames", float "bblur", float "csharp", bool "bsrch",bool "Precise") {
  # From:- http://forum.doom9.org/showthread.php?p=1737045#post1737045
  # Based on MCDegrain By Didee, http://forum.doom9.org/showthread.php?t=161594
  # Also based on DiDee observations in this thread: http://forum.doom9.org/showthread.php?t=161580 
  # "Denoise with MDegrainX, do slight sharpening where motionmatch is good, do slight blurring where motionmatch is bad"
  # In areas where MAnalyse cannot find good matches, the blur() will be dominant.
  # In areas where good matches are found, the sharpen()'ed pixels will overweight the blur()'ed pixels
  # when the pixel averaging is performed.
  # 
  # Mod by StainlessS to add Precise, 3 Sept 2015.
    frames = default(frames, 2)
    bblur  = default(bblur, 0.6)
    csharp = default(csharp, 0.6)
    bsrch  = default(bsrch, true)
    Precise=Default(Precise,False)  # Use MRecalculate
    bs = (c.width>960) ? 16 : 8 
    c2 = c.blur(bblur)
    super = bsrch ? c2.MSuper(pel=2, sharp=1) : c.MSuper(pel=2, sharp=1)
    super_rend  = c.sharpen(csharp).MSuper(pel=2, sharp=1,levels=1)   # Only 1 Level required for sharpened Super (not MAnalyse-ing)
    backward_vec3 = MAnalyse(super, isb = true, delta = 3, blksize=bs, overlap=bs/2)
    backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=bs, overlap=bs/2)
    backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=bs, overlap=bs/2)
    forward_vec1  = MAnalyse(super, isb = false, delta = 1, blksize=bs, overlap=bs/2)
    forward_vec2  = MAnalyse(super, isb = false, delta = 2, blksize=bs, overlap=bs/2)
    forward_vec3  = MAnalyse(super, isb = false, delta = 3, blksize=bs, overlap=bs/2)
    # If Precise, then recalculate on Prefiltered (blurred) Super (NOT the sharpened render super)
    backward_vec3 = (Precise) ? MRecalculate(super, backward_vec3, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec3
    backward_vec2 = (Precise) ? MRecalculate(super, backward_vec2, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec2
    backward_vec1 = (Precise) ? MRecalculate(super, backward_vec1, blksize=bs/2, overlap=bs/4,thSAD=100) : backward_vec1
    forward_vec1  = (Precise) ? MRecalculate(super, forward_vec1 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec1
    forward_vec2  = (Precise) ? MRecalculate(super, forward_vec2 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec2
    forward_vec3  = (Precise) ? MRecalculate(super, forward_vec3 , blksize=bs/2, overlap=bs/4,thSAD=100) : forward_vec3
    #       
    (frames<=0) ? c :\
    (frames==1) ? c2.MDegrain1(super_rend, backward_vec1,forward_vec1,thSAD=400) :\
    (frames==2) ? c2.MDegrain2(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) \
                : c2.MDegrain3(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400)
    return(last)
}
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd September 2018 at 16:57.
StainlessS is offline   Reply With Quote
Old 28th September 2018, 13:46   #5  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Sorry for late answer. I did try to lower the quality but it didn't look good. I did try Degrain and it did work great, that made the file Mitch smaller. I don't really understand why grainy movies just become so big.

I use x264.

Btw what is h264? Isn't that the same?
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 28th September 2018, 14:00   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I don't really understand why grainy movies just become so big.
Grain looks like detail, so the encoder tries its best to retain the 'detail', and so is big.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 28th September 2018, 14:45   #7  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
Originally Posted by color View Post
I use x264.

Btw what is h264? Isn't that the same?
H.264 is a codec, x264 is a specific implementation of an H.264 encoder.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 28th September 2018, 20:17   #8  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Oh, now I understand a little bit better.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 29th September 2018, 01:16   #9  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by color View Post
I don't really understand why grainy movies just become so big.
In simple terms, video compression works by "predicting" each frame (picture) from the preceding frame(s) and then only storing the so-called "residual", i.e. the difference between the predicted picture and the actual picture.

This exploits the fact that, in most videos, the difference between consecutive frames (pictures) is relatively small – which means that the "next" frame usually can be predicted pretty accurately and thus the residual will be small.

However, noise or grain is random by definition. Consequently, when noise/grain dominates in the video, then prediction of the picture can not work very well! As a consequence, the residual (i.e. data to be stored) will be huge

In other words, if the video contains a lot of noise/grain (i.e. random data), then we either need to spend a whole lot of bits in order to accurately represent that video, or we need to accept "subpar" quality...


__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 29th September 2018 at 11:56.
LoRd_MuldeR is offline   Reply With Quote
Old 30th September 2018, 11:15   #10  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Thank you for explaining.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 11th October 2018, 12:17   #11  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 556
http://avisynth.nl/index.php/Temporal_Degrain
by Didée & Sagekilla

This script seems to be great against videos with dancing grain,
Quote:
Temporal Degrain is a very slow, multi-stage temporal denoiser originally created for killing the dancing grain present in 300
Although I don't know if MCDegrain (by Didée) is also good for that.

Last edited by Forteen88; 22nd October 2018 at 13:11. Reason: Changed credits! Why give credits to a person that is mean to me?!
Forteen88 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.