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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd November 2013, 03:28   #1  |  Link
Sergy
Registered User
 
Sergy's Avatar
 
Join Date: Aug 2013
Location: Bogotá, Colombia
Posts: 4
AviSynth MT and other stuff

Hi everyone

First of all, let me apologize if this thread isn't in the right place, also if there are many mistakes on the writting as well, english is not my language.

I'm going to start by telling you that I'm here because of this tutorial: http://www.bubblevision.com/underwater-video/Vegas-YouTube-Vimeo.htm#64bit

I followed all the steps described in there and had no big issues getting the video done

However, there is a couple things I'm confused about:

1 - MT is active even though I'm not using a MT AviSynth script.

If I'm not wrong, as long as your script doesn't contain lines like this:

Quote:
# Set multi-threaded mode.
SetMTMode(2)
And also you have got the necessary plugins and versions of Avisynth, MT is not possible and the rendering process will use just one of the cores of the processor.

Here you can take a look to the script I was using during the rendering of my last video:

Quote:
# Open frameserved source.
# Change path and file name as appropriate.
AviSource("C:\Users\Sergy\Videos\fs.avi")

# Convert to YV12 so filters will work.
# Use interlaced layout for conversion.
# Change "true" to false" for progressive source.
# Use Rec.709 coefficients. Keep full range [0,255].
# Leave it out if you frameserve in YUY2 format.
ConvertToYV12(interlaced=false, matrix="PC.709")

# Assume footage is top field first.
# If it's bottom field first then use AssumeBFF.
# Leave it out for progressive source.
# AssumeTFF

# Resize width by Lanczos3.
# Use 1280 for HD source.
# Use 854 for standard definition widescreen source.
# Use 640 for standard definition 4:3 source.
# Leave it out if horizontal resolution is already correct.
LanczosResize(1280,height)

# Deinterlace with QTGMC script.
# Available presets are placebo, very slow, slower,
# slow, medium, fast, faster, very fast, super fast,
# ultra fast, draft. Default is medium.
# Slower presets unnecessary for HD.
# ultra fast requires Yadif.
# Leave out FPSDivisor=2 for smoother double frame rate.
# Leave out the whole line for progressive source.
QTGMC( Preset="fast", FPSDivisor=2 )

# Resize height by Lanczos3.
# Use 720 for HD source.
# Use 480 for standard definition source.
# Leave it out if vertical resolution is already correct.
LanczosResize(width,720)

# Scale levels from [0,255] to [16,235].
# Compensates for Flash Player scaling [16,235] to [0,255].
# Leave it out if you are conforming levels in your NLE.
# Leave it out if you frameserve in YUY2 format.
# See http://www.bubblevision.com/underwater-video/YouTube-Vimeo-levels-fix.htm
As you can see, there's none of the lines required for the MT process, also I don't have any of the MT plugins or AviSynth versions.

But here is a screenshoot of AMD System Monitor while processing a video:



As you can see, all of the 8 cores of the processor are being used to render the video, and that have no sense for me >.<

2 - Videos are being de-interlaced even when I don't have that option active neither on Sony Vegas nor Avisynth's script

Well, this is confusing for me too.

I used a script that was very similar to the one I've quoted before in this thread, with no QTCM line active on it.
Also SV deinterlacing wasn't active, but still, the resulting video after the process was progressive source.

Edit: Here are some screenshoots to show you what I'm talking about:

Original video, interlaced source BFF:



Processed video, progresive source:



Thanks a lot for reading this "book" >.<, and also for your answers
__________________
Live to win, dare to fail...

Last edited by Sergy; 23rd November 2013 at 04:20.
Sergy is offline   Reply With Quote
Old 23rd November 2013, 11:06   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Posts: 3,717
Quote:
Originally Posted by Sergy View Post
1 - MT is active even though I'm not using a MT AviSynth script.
You do know that x264 works multi-threaded by default, don't you?

A couple of other things you need to consider when looking at the Avisynth part only:
- QTGMC does make use of plugins that are multithreaded internally, like dfttest().
- Even if Avisynth and your entire filter chain are single-threaded, the Windows thread scheduler decides how to distribute the threads which means that even single-threaded applications can use multiple cores unless you force affinity in your program.

Last edited by Groucho2004; 23rd November 2013 at 11:42.
Groucho2004 is offline   Reply With Quote
Old 23rd November 2013, 19:28   #3  |  Link
Sergy
Registered User
 
Sergy's Avatar
 
Join Date: Aug 2013
Location: Bogotá, Colombia
Posts: 4
Quote:
Originally Posted by Groucho2004 View Post
You do know that x264 works multi-threaded by default, don't you?

A couple of other things you need to consider when looking at the Avisynth part only:
- QTGMC does make use of plugins that are multithreaded internally, like dfttest().
- Even if Avisynth and your entire filter chain are single-threaded, the Windows thread scheduler decides how to distribute the threads which means that even single-threaded applications can use multiple cores unless you force affinity in your program.
Actually I didn't know that.

I guess that would be the answer to my first question.

Thank you
__________________
Live to win, dare to fail...
Sergy is offline   Reply With Quote
Old 24th November 2013, 12:05   #4  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,353
Quote:
Originally Posted by Sergy View Post
2 - Videos are being de-interlaced even when I don't have that option active neither on Sony Vegas nor Avisynth's script

I used a script that was very similar to the one I've quoted before in this thread, with no QTCM line active on it.
About your second question. A script like quoted before without QTGMC is:

AviSource("C:\Users\Sergy\Videos\fs.avi") #your source is not avi
ConvertToYV12(interlaced=false, matrix="PC.709") # is interlaced with other colormatrix (I think)
LanczosResize(1280,height) # don't exist resize 720x480 -> 720x480
#QTGMC( Preset="fast", FPSDivisor=2 )
LanczosResize(width,720)

Don't exist a line that can be applied to your source.
Please put the script used.

BTW, x264 need the parameter (for your source):

--bff [Enable interlaced mode (bottom field first)]

to encode the video like interlaced, I don't see the full Encoding Settings but I suspect than this parameter is missing.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 24th November 2013 at 12:07.
tebasuna51 is offline   Reply With Quote
Old 24th November 2013, 18:37   #5  |  Link
Sergy
Registered User
 
Sergy's Avatar
 
Join Date: Aug 2013
Location: Bogotá, Colombia
Posts: 4
Quote:
Originally Posted by tebasuna51 View Post
About your second question. A script like quoted before without QTGMC is:

AviSource("C:\Users\Sergy\Videos\fs.avi") #your source is not avi
Hi, thanks for answering

As I said before, I was following the steps from a tutorial that uses Sony Vegas, Frame Sever, AviSynth and MeGUI so you can render videos in Sony Vegas using the x264 codec.

Then, even though the original source is not .avi, Frame Server makes a fs.avi file, a singpost name "fs" and its format is .avi

Quote:
Originally Posted by tebasuna51 View Post
ConvertToYV12(interlaced=false, matrix="PC.709") # is interlaced with other colormatrix (I think)
I don't know about that, where can I find that info?

Quote:
Originally Posted by tebasuna51 View Post
LanczosResize(1280,height) # don't exist resize 720x480 -> 720x480
I used a very similar script, but not exactly the same, here is the script I used to render the video

Code:
# Open frameserved source.
# Change path and file name as appropriate.
AviSource("C:\Users\Sergy\Videos\fs.avi")

# Convert to YV12 so filters will work.
# Use interlaced layout for conversion.
# Change "true" to false" for progressive source. 
# Use Rec.709 coefficients. Keep full range [0,255].
# Leave it out if you frameserve in YUY2 format. 
ConvertToYV12(interlaced=false, matrix="PC.709")

# Assume footage is top field first.
# If it's bottom field first then use AssumeBFF.
# Leave it out for progressive source.

# Resize width by Lanczos3.
# Use 1280 for HD source.
# Use 854 for standard definition widescreen source.
# Use 640 for standard definition 4:3 source.
# Leave it out if horizontal resolution is already correct.
LanczosResize(720,height)

# Deinterlace with QTGMC script.
# Available presets are placebo, very slow, slower,
# slow, medium, fast, faster, very fast, super fast,
# ultra fast, draft. Default is medium.
# Slower presets unnecessary for HD.
# ultra fast requires Yadif.
# Leave out FPSDivisor=2 for smoother double frame rate.
# Leave out the whole line for progressive source. 

# Resize height by Lanczos3.
# Use 720 for HD source.
# Use 480 for standard definition source. 
# Leave it out if vertical resolution is already correct.
LanczosResize(width,480)

# Scale levels from [0,255] to [16,235].
# Compensates for Flash Player scaling [16,235] to [0,255].
# Leave it out if you are conforming levels in your NLE.
# Leave it out if you frameserve in YUY2 format. 
# See http://www.bubblevision.com/underwater-video/YouTube-Vimeo-levels-fix.htm

Quote:
Originally Posted by tebasuna51 View Post
BTW, x264 need the parameter (for your source):

--bff [Enable interlaced mode (bottom field first)]

to encode the video like interlaced, I don't see the full Encoding Settings but I suspect than this parameter is missing.
That's right, its exactly the reason I'm confused about, I believed that it was necessary to include lines like this:

Code:
AssumeBFF

QTGMC( Preset="medium", FPSDivisor=2 )
To get your video de-interlaced, but as you can see in the script I used, that lines aren't included, also, as I said, Sony Vegas de-interlacing wasn't active, so why the resulting video is in progressive source? O.o
__________________
Live to win, dare to fail...
Sergy is offline   Reply With Quote
Old 24th November 2013, 20:14   #6  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Quote:
Originally Posted by Sergy View Post
as you can see in the script I used, that lines aren't included, also, as I said, Sony Vegas de-interlacing wasn't active, so why the resulting video is in progressive source?
It's encoded as progressive (and that's what MediaInfo is telling you) because that is the default action and you have not requested anything else. However, the content is still interlaced, because you have not done any deinterlacing in your script. Vegas doesn't know that, because there is no way for that information to be made available by the avi frame server.

Incidentally, if your source is interlaced, you should be using
ConvertToYV12(interlaced=true, matrix="PC.709")
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 24th November 2013, 21:32   #7  |  Link
Sergy
Registered User
 
Sergy's Avatar
 
Join Date: Aug 2013
Location: Bogotá, Colombia
Posts: 4
Quote:
Originally Posted by Gavino View Post
It's encoded as progressive (and that's what MediaInfo is telling you) because that is the default action and you have not requested anything else. However, the content is still interlaced, because you have not done any deinterlacing in your script. Vegas doesn't know that, because there is no way for that information to be made available by the avi frame server.
That makes perfect sense

Quote:
Originally Posted by Gavino View Post
Incidentally, if your source is interlaced, you should be using
ConvertToYV12(interlaced=true, matrix="PC.709")
When I'm working with a video with interlaced source (And Bottom field first), I use this script.

Code:
# Convert to YV12 so filters will work.
# Use interlaced layout for conversion.
# Change "true" to false" for progressive source. 
# Use Rec.709 coefficients. Keep full range [0,255].
# Leave it out if you frameserve in YUY2 format. 
ConvertToYV12(interlaced=true, matrix="PC.709")

# Assume footage is top field first.
# If it's bottom field first then use AssumeBFF.
# Leave it out for progressive source.
AssumeBFF

# Deinterlace with QTGMC script.
# Available presets are placebo, very slow, slower,
# slow, medium, fast, faster, very fast, super fast,
# ultra fast, draft. Default is medium.
# Slower presets unnecessary for HD.
# ultra fast requires Yadif.
# Leave out FPSDivisor=2 for smoother double frame rate.
# Leave out the whole line for progressive source.
QTGMC( Preset="medium", FPSDivisor=2 )
So I believe that would answer all my questions, thank you to all of you guys for being such patient and helpful.
__________________
Live to win, dare to fail...
Sergy 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 03:52.


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