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 24th January 2016, 06:05   #1  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
QTGMC help for a complete beginner having serious struggles...

Hi all. About 2 weeks ago I posted this thread to the Sony Vegas Creative COW forum asking for ideas as to how I could take interlaced TV footage and convert it to 50fps video I can use in Sony Vegas. The deinterlacing methods available in Vegas are primitive and I'm looking to get the best out of the footage I've got. In summary, I want my 1080i (or 576i occasionally) video to be editable in 50fps unlike the 25fps I'm usually forced to work with. The footage I use appears best when using the 'Bob' deinterlacer in VLC.

It was suggested in the thread I posted to look into QTGMC with Avisynth ('in conjunction with VirtualDub', of which I can't appreciate the relevance at this point). I read the absolute basics on the wiki, downloaded the skeleton, but got stuck at the point it asked me to load an .avi file, which I rarely come across in my editing. I tried to find a plugin that would allow me to load .ts files, but had no luck, when windows media player told me it could not open the file. I used an .avs file that read this:

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\ffms2.dll")
FFmpegSource2("x:/filename.ts")
I have absolutely no idea if this is even a good start for what I want to do. This was after I had downloaded all the required plugins for QTGMC as outlined by the avisynth wiki. These were all downloaded from assorted websites, and as such I didn't feel confident from the outset. I also didn't even know what was going to be the result if I was successful... would it just open the video file in Windows Media Player with a filter applied? How do I capture the video with these filters permanently applied?

I'm looking to start fresh, and I am extremely keen to learn and would be incredibly grateful for any help I may get from this forum. I'm not sure if many people come here with no previous posts looking to get quick answers, but I understand how annoying that may seem. I'm hoping to get a working solution within maybe a week, but Avisynth appears to be an extremely helpful resourse - as of now I use MediaCoder to trim and convert footage, so I'd love to replace this with a more all-encompassing method.

I've probably left some important information out, so if this is super vague I'm happy to expand on it. Thanks

Also, if anyone wants an example of the kind of footage I'm dealing with, I took a section from a 576i video using VLC and uploaded it to MEGA here. It's from a football game, so safe for work.

Last edited by LilWiz; 24th January 2016 at 06:10.
LilWiz is offline   Reply With Quote
Old 24th January 2016, 07:38   #2  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 610
Quote:
Originally Posted by LilWiz View Post
It was suggested in the thread I posted to look into QTGMC with Avisynth ('in conjunction with VirtualDub', of which I can't appreciate the relevance at this point).
...
How do I capture the video with these filters permanently applied?
This would be where VirtualDub comes in. You open the AVS file in that and save an intermediate AVI file for editing (preferably in a lossless format).

Your script is wrong. Read the docs for FFmpegSource2 for more info on proper usage.

Here is one way:
Code:
FilePath = "x:\filename.ts"
A = FFAudioSource(FilePath)
V = FFVideoSource(FilePath)
AudioDub(V,A)
There will be a delay while the file is indexed before it opens.

LoadPlugin is redundant because you already have the plugin in the autoload directory. But leaving it in wouldn't cause a problem.
ChiDragon is offline   Reply With Quote
Old 24th January 2016, 10:19   #3  |  Link
BakaProxy
Registered User
 
Join Date: Jan 2015
Posts: 47
Well you can create a script and open it in a media player and it will just play the video with said filters applied (assuming there weren't any errors in the script). If you want to render the script so you can use it in vegas then you have a couple of choices: open that script in virtualdub and save it as avi (this can be lossless or lossy depending on the codec you choose in virtualdub, IIRC the default is uncompressed), otherwise you can use x264 (or really most command line encoders have support for avisynth and if they don't there are workarounds for that) to input the avisynth script or you can use a gui for x264 or so like megui.

Also with a .ts source I'd suggest using dgindex (or variants) as source filter, don't think ffsource even supports .ts sources properly.

Verstuurd vanaf mijn SM-A500FU met Tapatalk
BakaProxy is offline   Reply With Quote
Old 24th January 2016, 10:43   #4  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,288
As for a suitable script for the sample you posted, this looks pretty good to me:
Code:
LWLibavVideoSource("vlc-record-2016-01-12-21h36m08s-20160110 rangers-cowdenbeath english.ts-.ts")
a = LWLibavAudioSource("vlc-record-2016-01-12-21h36m08s-20160110 rangers-cowdenbeath english.ts-.ts")
AssumeTFF()
QTGMC(Preset="Slow")
AudioDub(last, a)
This will result in a 50 fps clip. If you need the original 25 fps, add "SelectEven()" after the QTGMC() statement.

Last edited by Groucho2004; 24th January 2016 at 11:26.
Groucho2004 is offline   Reply With Quote
Old 27th January 2016, 08:16   #5  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
Thanks very much for all the helpful and prompt replies everyone! I redownloaded the QTGMC plugins and got the LSMASH plugin also (hopefully I have done everything corrrectly!)

I feel far closer to success than before! As Groucho suggested, my .avs file now reads:

Code:
LWLibavVideoSource("x:\vlc-record-2016-01-12-21h36m08s-20160110 rangers-cowdenbeath english.ts-.ts")
a = LWLibavAudioSource("x:\vlc-record-2016-01-12-21h36m08s-20160110 rangers-cowdenbeath english.ts-.ts")
AssumeTFF()
QTGMC(Preset="Slow")
AudioDub(last, a)
As for understanding what's written here, I am on track with that, I think my minute experience in coding (albeit with Python) means I pretty much get it. However, I must still have a problem somewhere. When opening the .avs file with Windows Media player, it no longer brings up a Script error message! However, only audio plays, no video. When attempting to open with VirtualDub, I get the same error message I have been getting since install:

Code:
AVI Filter Import error: (Unknown) (80040154)
There may be a couple problems I need to address here. I have read that this error may mean I need to reinstall avisynth?

Once again, thanks for the prompt and extremely helpful replies guys!

EDIT: Here are the contents of the avisynth plugins folder, just in case it's relevant.

There are probably a couple of plugins in there that are unnecessary; should I leave or remove them?

Last edited by LilWiz; 27th January 2016 at 08:26.
LilWiz is offline   Reply With Quote
Old 27th January 2016, 08:21   #6  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 610
Be sure to use 32-bit VirtualDub when you are using 32-bit Avisynth.
ChiDragon is offline   Reply With Quote
Old 27th January 2016, 08:28   #7  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
Quote:
Originally Posted by ChiDragon View Post
Be sure to use 32-bit VirtualDub when you are using 32-bit Avisynth.
D'oh! Getting the correct version now.
LilWiz is offline   Reply With Quote
Old 27th January 2016, 09:23   #8  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
The file is now opening in VirtualDub! Plus it looks excellent.

I do have one slight problem, and I guess it might not be relevant in this thread any more, but the projected output file size if I choose to save as an avi is around 4.5Gb, over 100x the size of the original file! Maybe I should have expected this, but is there a way to cut down on this size? It seems ridiculously large, doesn't it? 1080i clips would be huge
LilWiz is offline   Reply With Quote
Old 27th January 2016, 09:38   #9  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 416
You have 45MB turning into 4.5GB? That's... interesting.
kuchikirukia is offline   Reply With Quote
Old 27th January 2016, 10:34   #10  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,288
Quote:
Originally Posted by LilWiz View Post
I do have one slight problem, and I guess it might not be relevant in this thread any more, but the projected output file size if I choose to save as an avi is around 4.5Gb, over 100x the size of the original file! Maybe I should have expected this, but is there a way to cut down on this size? It seems ridiculously large, doesn't it? 1080i clips would be huge
First you have to decide what target format you want. You probably selected "Uncompressed RGB" in VDub which explains the huge size.
Groucho2004 is offline   Reply With Quote
Old 27th January 2016, 10:43   #11  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
Here's some more info.

The original file details are below:

Code:
General
ID/String                        : 30559 (0x775F)
CompleteName                     : x:\vlc-record-2016-01-12-21h36m08s-20160110 rangers-cowdenbeath english.ts-.ts
Format                           : MPEG-TS
FileSize/String                  : 38.0 MiB
Duration/String                  : 1mn 16s
OverallBitRate_Mode/String       : Variable
OverallBitRate/String            : 4 148 Kbps

Video
ID/String                        : 69 (0x45)
MenuID/String                    : 1 (0x1)
Format                           : MPEG Video
Format_Version                   : Version 2
Format_Profile                   : Main@Main
Format_Settings_BVOP/String      : Yes
Format_Settings_Matrix/String    : Custom
Format_Settings_GOP              : Variable
Format_Settings_PictureStructure : Frame
CodecID                          : 2
Duration/String                  : 1mn 16s
BitRate_Mode/String              : Variable
BitRate/String                   : 3 749 Kbps
BitRate_Maximum/String           : 15.0 Mbps
Width/String                     : 704 pixels
Height/String                    : 576 pixels
DisplayAspectRatio/String        : 16:9
FrameRate/String                 : 25.000 fps
Standard                         : PAL
ColorSpace                       : YUV
ChromaSubsampling                : 4:2:0
BitDepth/String                  : 8 bits
ScanType/String                  : Interlaced
ScanOrder/String                 : Top Field First
Compression_Mode/String          : Lossy
Bits-(Pixel*Frame)               : 0.370
TimeCode_FirstFrame              : 13:32:37:19
TimeCode_Source                  : Group of pictures header
Gop_OpenClosed/String            : Open
StreamSize/String                : 34.2 MiB (90%)

Audio
ID/String                        : 68 (0x44)
MenuID/String                    : 1 (0x1)
Format                           : MPEG Audio
Format_Version                   : Version 1
Format_Profile                   : Layer 2
CodecID                          : 3
Duration/String                  : 1mn 16s
BitRate_Mode/String              : Constant
BitRate/String                   : 192 Kbps
Channel(s)/String                : 2 channels
SamplingRate/String              : 48.0 KHz
Compression_Mode/String          : Lossy
Video_Delay/String               : 8ms
StreamSize/String                : 1.75 MiB (5%)
Language/String                  : English
And here's what the screen shows in VirtualDub:



EDIT: Okay, so I need to change the codec in the Compression menu? I have 7 other options, I'll see how it looks with some of those. Thanks again!

Last edited by LilWiz; 27th January 2016 at 10:49.
LilWiz is offline   Reply With Quote
Old 27th January 2016, 10:55   #12  |  Link
Groucho2004
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,288
Quote:
Originally Posted by LilWiz View Post
Okay, so I need to change the codec in the Compression menu? I have 7 other options, I'll see how it looks with some of those.
Yes. However, the options that VDub comes with are very limited. As I wrote, first decide what target format you want. This choice mainly depends on the playback device you are going to use. Also, VirtualDub can be configured to use external encoders like x264.
Groucho2004 is offline   Reply With Quote
Old 27th January 2016, 11:03   #13  |  Link
LilWiz
Registered User
 
Join Date: Jan 2016
Posts: 28
Quote:
Originally Posted by Groucho2004 View Post
Yes. However, the options that VDub comes with are very limited. As I wrote, first decide what target format you want. This choice mainly depends on the playback device you are going to use. Also, VirtualDub can be configured to use external encoders like x264.
Yep, got it. I downloaded the XviD codec because the others weren't going to work, and so far so good. If I don't reply, everything worked out! Thanks again for your patience Groucho! I'll make sure to come back here for a browse next time I have some queries or things I'm looking to learn
LilWiz is offline   Reply With Quote
Old 27th January 2016, 14:10   #14  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 610
It's silly to use XviD as an intermediate codec these days (and probably ever).

You originally said "I'm looking to get the best out of the footage I've got." That would mean using a lossless intermediate, in 4:2:0 if your sources are all transport streams -- and assuming Vegas can properly handle 4:2:0 with whatever editing/filters you will be applying.

Use Fast Recompress in VirtualDub to avoid conversion to RGB. A lossless 4:2:0 file will still be much bigger than your input, but a fraction of uncompressed RGB. My personal favourites are Ut Video and MagicYUV, but there are others.
ChiDragon is offline   Reply With Quote
Old 14th December 2017, 20:32   #15  |  Link
abolibibelot
Registered User
 
Join Date: Jun 2015
Location: France
Posts: 38
That thread is quite old, but I'm surprised noone mentioned AVFS : you can avoid having to export a huge intermediate lossless file by opening the AVS script with Avisynth Virtual File System, which, as its name implies, will create a virtual uncompressed file in a "C:\Volumes" directory. It won't occupy significant space on the system partition (despite the huge size displayed in Windows explorer), but it will behave just like an uncompressed video file created with the same Avisynth script would : you can read it with a media player, or you can directly import it in any non-linear editing software. You may need to configure ffdshow for raw YUV footage to be recognized by those softwares (ffdshow video decoder configuration > Uncompressed video > toggle "all supported formats").

http://turtlewar.org/avfs/
abolibibelot is offline   Reply With Quote
Reply

Tags
qtgmc

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 07:23.


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