View Full Version : avisynth and video quality
devhercule
17th July 2014, 13:03
Hi,
Is it possible with avisynth to reduce the quality of a video.
I have a video with a hight quality which causes sometimes some freezes and slowing down. the same script work with a medium quality video but not with a hight quality video.
A = FFAudioSource("video.flv")
V = FFVideoSource("video.flv")
AudioDub(V, A)
Dissolve(Trim(0,200), Trim(1350,1700), Trim(13350,13700), Trim(99150,99400), Trim(150000,150300), Trim(170000,170300), Trim(190000,190300), Trim(192000,192278), 12)
I want to reduce the video quality without touching on the frame rate (reduce the frame size for example). Is it possible?
I hope that i was clear
Thank you
fvisagie
17th July 2014, 14:21
By reducing quality do you mean reducing the resolution (screen size)? In that case, use one of the resizers (http://avisynth.nl/index.php/Internal_filters#Geometric_deformation_filters).
If you mean reducing the amount of picture information but keeping the resolution (and frame rate) the same, you can blur (http://avisynth.nl/index.php/Internal_filters#Pixel_restoration_filters) out some detail. Another crude, but effective, approach I sometimes use is to encode to a lossy format like AVC using a very low bitrate.
devhercule
17th July 2014, 14:45
I used "ReduceBy2" to reduce the number of pixel in a frame but the problem still exist.
A = FFAudioSource("video.flv")
V = FFVideoSource("video.flv")
D=AudioDub(V, A)
ReduceBy2(D)
Dissolve(Trim(0,200), Trim(1350,1700), Trim(13350,13700), Trim(99150,99400), Trim(150000,150300), Trim(170000,170300), Trim(190000,190300), Trim(192000,192278), 12)
Is there another way?
Thanks
videoh
17th July 2014, 14:59
r u seeing problems when u try to play the script or when u play the video encoded with the script? what do u use for playing? what is your PC details or player details?
Groucho2004
17th July 2014, 15:02
I have a video with a hight quality which causes sometimes some freezes and slowing down.
Define "high quality". Elaborate on "freezes and slowing down". What freezes? What happens when you comment the "Dissolve" line?
In order to troubleshoot your script I recommend this (https://forum.doom9.org/showthread.php?t=165528) tool.
devhercule
17th July 2014, 15:06
I dont have this problem in playing the original video "video.flv" with vlc.
I'm seeing the problem only when playing this script. it is an AVS file, i open it with VirtualDub 1.10.4
I have this problem in the same frame in the video. the player is frozen for 2 seconds and then it moves.
My PC details are: Intel 2DUO CPU 2.40GHz, 4Go RAM
devhercule
17th July 2014, 15:20
The problem disappear using "ReduceBy2()" and in replacing
Dissolve(Trim(13350,13700), Trim(99150,99400), Trim(150000,150300), 12)
by Trim(13350,13700)++Trim(99150,99400)++Trim(150000,150300)
when i comment the dissolve line, the video play normally. i guess that a frame size or resolution decrease should be done
The problem is due to "dissolve", because i tried to modify the trim parameters, it freezes always 100 frames before the end of the trim (before dissolve)
Groucho2004
17th July 2014, 15:30
The process being slow is expected with your PC specs and the given script. What are you planning to do with the script? Just play it? Are you not encoding the script output to a new stream?
devhercule
17th July 2014, 15:34
100 frames before each dissolve, it freezes for 2 seconds and then continue :(
It is just for playing the script.
videoh
17th July 2014, 15:37
encode using the script and then play the encoded video
u get problems only when you try to play a script directly
if u must play only the script (which doesn't make much sense) then u need a faster PC
devhercule
17th July 2014, 15:41
Ok good idea, but how can i encode the video? is there a function? i will try to encode it and have a new video in my script using trim and dissolve?
StainlessS
17th July 2014, 15:43
MeGUI is used by a lot of Avisynth users.
devhercule
17th July 2014, 15:49
ok StainlessS i will try it
Thank you everybody
devhercule
17th July 2014, 18:47
I used MeGUI to create a new video from an avs script. the created video does not contain freezes. It is ok, thank you for the idea. it was a problem due to my pc details.
Can i use VirtualDub to do this same task? as MeGUI
StainlessS
17th July 2014, 19:17
VirtualDub can output AVI files only, compression not usually as good.
x264 mp4 though MeGUI is very good compression and user set quality as good as required,
mp4 usable on many players and recent mobile phones.
devhercule
17th July 2014, 19:22
ok thank you
raffriff42
17th July 2014, 19:44
I'm seeing the problem only when playing this script. it is an AVS file, i open it with VirtualDub 1.10.4
I have this problem in the same frame in the video. the player is frozen for 2 seconds and then it moves.I don't expect smooth playback in VirtualDub (https://www.google.com/search?q=smooth+playback+in+VirtualDub). Sometimes it happens, but rarely. Have you tried playing the script in MPC-HC?
creaothceann
17th July 2014, 21:45
VirtualDub can output AVI files only, compression not usually as good.
Depends on the codec. (http://sourceforge.net/projects/x264vfw/)
StainlessS
17th July 2014, 22:17
Yeh but still 'not usually as good'. I've heard that x264 in AVI is problematic.
osgZach
18th July 2014, 04:22
The only real problems I've had with H264 (x264 is an encoder people, come on) in AVI have been some minor editing related concerns, but beyond that it works pretty well for playback on a PC.
When I record game footage, I always record into AVI via x264vfw and it works just fine. Certainly blows all those "hardware H264 encoding" game capture cards out of the water, and at 60fps to boot :p
Would it be my first choice for archival grade footage? No, but it makes for a great intermediate file where disk space is a concern and you are only saving again for the final encode.
feisty2
18th July 2014, 06:01
blur (1).sharpen (1)
franketto
18th July 2014, 08:07
VirtualDub can output AVI files only, compression not usually as good.
x264 mp4 though MeGUI is very good compression and user set quality as good as required,
mp4 usable on many players and recent mobile phones.
Depends on the codec. (http://sourceforge.net/projects/x264vfw/)
Now Virtualdub (from 1.10.0) can output every kind of videos (container or codecs, mp4, mkv, x264 etc) with external encoding:
http://forums.virtualdub.org/index.php?act=ST&f=3&t=18840&st=0
Very powerful and not known feature!
fvisagie
18th July 2014, 09:15
VirtualDub has for many years also supported frameserving via the AVIFile interface. From the help file:
this method is very similar to the connection method used by the Avisynth scriptable video processor, so applications which are Avisynth compatible will usually work with VirtualDub's frameserver as well.
The frameserver spoofs AVI files with .vdr signpost files. For applications insisting on the .avi extension the frameserver's proxy mode needs to be enabled which since Windows Vista requires some extra steps (http://forums.virtualdub.org/index.php?act=ST&f=15&t=21154&hl=proxy+mode&).
StainlessS
18th July 2014, 11:47
franketto, thank you, was totally unaware of that, had not even noticed the option in v1.10.4.
EDIT: I used to use VD years ago as frameserver, with TmpGenc I think.
raffriff42
18th July 2014, 13:49
Would it be my first choice for archival grade footage? No, but it makes for a great intermediate file where disk space is a concern and you are only saving again for the final encode.Agreed.
Now Virtualdub (from 1.10.0) can output every kind of videos...with external encoding:
http://forums.virtualdub.org/index.php?act=ST&f=3&t=18840&st=0
Very powerful and not known feature!
The linked page ("How to use the external encoder feature"), while accurate, is a bit confusing to the newbie. Although the thread eventually explains all, it is quite long (13 pages). Getting external encoders working correctly takes some trial and error.
However, there is no need to create external encoder sets from scratch; you can download and import pre-built ones. Here's my quick start guide, explaining how to do this:
http://forums.virtualdub.org/index.php?act=ST&f=3&t=21733
franketto
18th July 2014, 15:47
Yes, raffriff42, the syntax is some confusing at times: it should be done some work on it to make it simpler.
Thank you for your explanation.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.