digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Capture, Record, Transfer (https://www.digitalfaq.com/forum/video-capture/)
-   -   Flashing video using QTGMC in Avisynth+? (https://www.digitalfaq.com/forum/video-capture/13457-flashing-video-qtgmc.html)

tbird97 04-18-2023 02:00 PM

Flashing video using QTGMC in Avisynth+?
 
Cross posted from another forum.
Long time lurker here.

I have a video capture. I'm going to try to upload a few seconds of video. (*Going to have to cut it down to meet the 99MB file requirement)
The problem: You'll see the video "flashes" a few times during playback and I'm unsure why.

Here is my process.

I have my vcr connected to a Panasonic DMR-ES15 in-line as a kind of video stabilizer, substitute for a time based corrector.

I capture using a USB-Live 2 and I use HuffyUV codec to obtain a lossless .avi capture using AmarecTV.
My capture looks decent (to me).
From there, I have this little script I made in AVIsynth+. I am self taught, going through the forums here.
I open this script in VirtualDub (or Virtualdub 2) and save the video also using Huffyuv codec, 4:2:2 YCbCr (YUYV, YUY2) pixel format.

I was using this script:

SetFilterMTMode("QTGMC",2)
FFMPEGSource2("F:\amarectv310\captures\stvhs1.avi" ,atrack=1)
ConvertToYV12()
AssumeTFF()
QTGMC(Preset="Slower",EdiThreads=3)
BilinearResize(720,540)
Prefetch(1)

this deinterlaced the vhs capture and improved the picture.
Sometimes, it worked beautifully. Other times, the audio would get out of sync.
From reading other forums, I think FFMpegSource2 was dropping frames, causing the audio to get out of sync.
My computer is old, 32-bit operating system Windows Vista (Pentium Dual CPU)

I realized, I was capturing an AVI, so I adjusted the script as follows. This is the one I used which produced the "flashing" video.
Except for the flashing, I'm pleased with the results. But, hoping the group can provide some helpful info to help a newbie out. Thank you.


SetFilterMTMode("QTGMC",2)
AVISource("F:\amarectv310\captures\stvhs1.avi")
ConvertToYV12()
AssumeTFF()
QTGMC(Preset="Slower",EdiThreads=3)
BilinearResize(720,540)
Prefetch(1)

I have since changed the script to
ConvertToYV12(interlaced=true).

I feel like I’m really close on this, but just trying to solve this flashing issue.

My Huffyuv is version 2.1.1
AVISynth+ 3.7.2
QTGMC 3.383
MaskTrools2 2.223
RGTools 1.0.7
MVTools 2.7.31
Nnedi3 0_9_4_60
Zs_RF_Shared 1.157

traal 04-18-2023 02:16 PM

Try the "Faster" preset for QTGMC, I find it makes slow motion video flicker a little bit less.

hodgey 04-18-2023 06:23 PM

Regarding audio sync avisource and ffmpegsource can sometimes act differently when loading a .avi source, I've experienced this as well. Think it might have something to do with timestamps and/or frames marked as dropped in the avi file but not sure.

Did you not get "flashing" when you were using ffmpegsource2? Hard to say exactly what to adjust without knowing more in detail what you mean by "flashing".

Also you want to call AssumeTFF to be right after loading before calling convertoyv12 so it uses the correct ordering.

tbird97 04-18-2023 08:05 PM

sample video attached
 
1 Attachment(s)
The attached clip should display the error I refer to as "flashing."

I tried to set the speed of QTGMC to "faster" as mentioned above and the error is still present.
I will try to reorder my instructions as above.

I do not experience this flashing when I used the command FFMPEGSOURCE2. When I did that, I got some very nice files. I also often got files where the audio was out of sync.

Thank you for the kind replies thus far.

traal 04-18-2023 09:38 PM

It looks like the source file is corrupted.

tbird97 04-19-2023 07:51 AM

1 Attachment(s)
Attached is raw capture of the same segment. I don't believe it's corrupted or shows errors.

traal 04-19-2023 08:40 AM

2 Attachment(s)
I feel like I had this problem once in the past with a certain version of HuffYUV. But I'm not seeing it now.

Attachment 16427

The blacks/shadows in the source video are crushed.

Here's my script:

Code:

SetFilterMTMode("DEFAULT_MT_MODE", 2)
AviSource("sample_raw stvhs1 bball.avi")
AssumeTFF()
ConvertToYV16(interlaced=true)
ConvertBits(16)
ColorYUV(levels="TV->PC")
ApplyGradationCurves(lumaPoints="0,4,179,255")
ColorYUV(levels="PC->TV")
ConvertToRGB32(interlaced=false, matrix="Rec601")
ConvertToYUY2(interlaced=true)
QTGMC( Preset="Medium", Sharpness=1.0 )
ConvertToRGB32(interlaced=false, matrix="Rec601")
Crop(4,0,-9,-9)
AddBorders(6,4,7,5)
Prefetch(4)


tbird97 04-19-2023 10:30 AM

Huffyuv
 
I'm pretty sure I just installed 32-bit Huffuv. Now that I'm reading through, there does appear to be a multithreaded version for dual core processors.

I can give that a try.

hodgey 04-19-2023 11:31 AM

If you mean huffyuv-mt thing, it's a separate incompatible variant that is not very well supported in general. It doesn't support opening other huffyuv-variants afaik. Would rather suggest switching to utvideo instead if you're having codec issues as it's still being maintained.

Also not codec/avisynth-related I am seeing something that looks like interference on that capture, unless it's something on the tape.

EDIT: Thinking about it, maybe it's the corruption resulting in flashes when using avisource that's also the cause of audio sync issues when using ffmpegsource instead. They might handle corrupted data differently.

tbird97 04-19-2023 12:13 PM

codec
 
You may add another "thanks" to your total.
That Huffyuv-MT was indeed what I downloaded and intended to try, but have not yet tried it. I did read a thread where it was not very well supported, but I think my old Pentium dual core machine may have been what it was intended for?

I have the Lagarith codec installed. Somehow, I was intent on Huffyuv and it did not occur to me to try it with Lagarith. I'll give that a try and may also download and experiment with UTvideo. Just remembering I have an old 32-bit machine still running on Vista.

Thank you. This is why groups and forums are helpful.

tbird97 04-19-2023 07:00 PM

Not the codec
 
I got home and tried to QTGMC using Lagarith codec rather than Huffyuv.
I got the same green flashing.
I tried another video rather than the basketball one and still got the same result.

I read a related post on this forum about using FFmpegsource2 and Hugfyuv. It sounds like using a different codec during capture may solve the audio out of sync issue when I used FFMpegsource2.

The basketball video is borrowed and I wanted to capture to make a nice tribute as one of those players was recently killed. Trying to solve that so I can return the borrowed tape.

I am open to suggestions, but may try a new capture using FFV1 rather than Huffy and FFmpegsource2 as that worked for me other than the sometimes audio sync drift.
Rather than capture, it appears I reencode my capture to FFV1, then try QTGMC.

themaster1 04-20-2023 03:08 AM

qtgmc support yv16() not YUY2, perhaps that's the cause of your green flashes

Code:

avisource()
assumetff()
convertotyv16(interlaced=true)
qtgmc(Preset="fast",edithreads=4)
selecteven()
converttoyv12(interlaced=false)
# videos filters....


hodgey 04-20-2023 03:39 AM

If the color space is wrong you get wrong colors on each frame just not on random frames. The scripts in the original post use yv12 though it's just traals weird script that converts back and forth between RGB and yuy2 for some reason I don't understand. QTGMC works with both yv12 and yv16 though yv16 tends to be a bit slower though converting to yv12 before qtgmc will halve the vertical chroma resolution which may or may not be fine depending on source and format. (Also if using the avisynth script in the last post remove selecteven unless you really need to halve the framerate for some reason.)

Are all the video frames there when using ffmpegsource?

I suspect the video codec is not the issue here, but rather something with the .avi file itself which avisource and ffmpegsource2 is interpreting differently, possibly dropped/inserted frames during capture. Have you tried using virtualdub2 instead of amarectv for capture?

I have experienced audio sync issues with ffmpegsource2 too that didn't happen with avisource on the same file but I didn't get corrupted frames when using avisource so not sure if it's the same problem.

traal 04-21-2023 04:04 PM

Quote:

Originally Posted by hodgey (Post 90272)
it's just traals weird script that converts back and forth between RGB and yuy2 for some reason I don't understand.

Sorry, the following 2 consecutive lines:

Code:

ConvertToRGB32(interlaced=false, matrix="Rec601")
ConvertToYUY2(interlaced=true)

are not needed for this particular script. Between the two I usually have commands to fix some flaws that require RGB32.

tbird97 05-03-2023 10:00 AM

ran AVIsynth diagnostic tool
 
2 Attachment(s)
Still trying to solve my video problem.
First, I ran AVIsynth Tool.
I got the attached results.
Does this mean that my Zs_RF-Shared.avsi is duplicated somehow, OR that I have the darn thing saved in the wrong text format?

tbird97 05-04-2023 05:43 PM

Lagarith or LSMASHsource
 
1 Attachment(s)
I converted my capture file to FFV1 codec.
From there, I again tried the QTGMC script as above. When I ran QTGMC, I selected huffyuv and 4:2:2 yuy encoding.
The "flashing" is gone, but produced the attached result which stutters, in places. Much of the capture is very good, but there are places where it stutters when playing back.

Rather than take all those steps, I decided to try a different approach. I captured my video again, this time using Lagarith codec.
When I ran the QTGMC avisynth script, I got an error,
"AVISource: couldn't locate a decompressor for fourcc LAGS
(F:amarectv310\captures\qtgmc_avisource.avs, line 2)

How do I solve this for Lags to use QTGMC?
I also have read that LSMASHsource gets good results, but the script looks more complicated.

I would prefer to either do it with Lagarith which I have installed and if I can just figure out this decrompressor mystery, OR, if someone could help with a proper script as above, but using LSMASHsource, I'd be willing to give that a try.

Thank you.

traal 05-04-2023 06:24 PM

Quote:

Originally Posted by tbird97 (Post 90574)
The "flashing" is gone, but produced the attached result which stutters, in places.

It doesn't stutter for me. I think it stutters on your machine due to high CPU load or hard drive bandwidth. Once you convert it to a distribution format such as H.264, it should play more smoothly.

Quote:

Originally Posted by tbird97 (Post 90574)
I captured my video again, this time using Lagarith codec.
When I ran the QTGMC avisynth script, I got an error,
"AVISource: couldn't locate a decompressor for fourcc LAGS
(F:amarectv310\captures\qtgmc_avisource.avs, line 2)

That means the Lagarith codec isn't installed. Are you doing this on the same machine that you captured on?

tbird97 05-04-2023 06:54 PM

Yes, same machine. Installed Lagarith a long time ago. I can try to reinstall it.

tbird97 05-05-2023 11:13 AM

I reinstalled Lagarith.

As I was investigating this, I found another form here. It looks like Virtualdub 2 has a copy of Lagarith installed internally. I don't know if that is the conflict.

https://forum.videohelp.com/threads/...ndependent-one



I couldn't get AVISource to recognize my Lagarith capture. I kept getting the decompressor error.
I gave it a whirl in Virtualdub 1 with the same result using AVISource, decompressor error.
I changed the script to FFMPegsource and it ran, but immediately the audio was out of sync.

So, I think I either need to figure out how to get AVIsynth to decompress my Lagarith capture or try switching to LSMASHSource, which I've downloaded, but haven't yet figured out the script as it seems a bit more involved.

Now, this has become a mystery to me and I'm just determined to get a good result out of this yet!

tbird97 05-26-2023 08:07 AM

flashing sample attached
 
1 Attachment(s)
Still trying to solve my mystery.
Attached is a short clip (very short to fit the file attachment requirements).
You can see some frames where it flashes green.

I'm capturing using Huffyuv.
My capture looks good to me.

It's when I go to QTGMC in AVIsynth+ and Virtualdub2 that the result comes out with these flashing frames.
Is it somehow introducing garbage or extra frames?

When I tried to QTGMC wtih Lagarith, I got an decompression error.
I tried converting it to UTvideo and got a memory error when I tried to QTGMC.

Looks like I do have the ability to capture using UTvideo rather than convert it.

Just trying to get these videos to go through QTGMC. I have tried using a script with FFMPEGSOURCE2 and my audio was unsynced.

My audio appears to remain syced when I use AVISource in the script, but it's introducing these green frames.

Open to suggestions.


All times are GMT -5. The time now is 02:28 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.