Quantcast How to prevent this bizzare rendering error in AviSynth - digitalFAQ Forum
Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
07-22-2020, 01:18 PM
JPMedia JPMedia is offline
Premium Member
 
Join Date: Jun 2018
Location: East Coast, USA
Posts: 137
Thanked 35 Times in 28 Posts
Yesterday I was processing a capture that I recorded to a VHS tape from a Panasonic PV-810 Camcorder and after running an AviSynth Script and saving my file with VirtualDub my new AVI contained a specific and frequent bizarre visual error.

My capture chain is as follows:

1. JVC SR-V10U S-VHS VCR
2. DataVideo TBC-1000
3. Windows XP PC with an ATI All in Wonder 9200 and a Turtle Beach Santa Cruz soundcard

All of these devices are connected with S-Video cables and RCA audio cables.

In VirtualDub 1.9.11 I captured the tape to AVI using the Huffyuv lossless codec at 720x480 resolution.

Then I transferred the capture to my Windows 7 editing PC to start filtering and restoration with AviSynth. My first AviSynth Script resulted in a file without visual errors and was written as follows:

Code:
avisource("G:\AviSynth Projects\2019-05-17 Tape 01\2019 Magnifico's EDIT\July 2019 Magnificos 01.avi")

### Color Correction ###

#ColorYUV(gamma_y=64)
#ColorYUV(off_u=+2, off_v=-1)

### Colorspace Conversion for AviSynth ###

ConvertToYV12(interlaced=true)
AssumeTFF()
#Histogram("Levels")

### Deinterlacing Settings ###

QTGMC(preset="medium",EZDenoise=6,denoiser="dfttest",ChromaMotion=true,\
ChromaNoise=true,DenoiseMC=true,GrainRestore=0.3,border=true)

### Additional Filtering ###

RemoveDirtMC(40,false)

### Overscan Masking ###

Crop(12,0,-4,-12)
AddBorders(8,6,8,6)

### Colorspace Conversion for VirtualDub ###

#ConvertToRGB32(interlaced=true,matrix="Rec601")

### Video Resize for h.264 delivery ###

#SelectEven() ### For 29.97 fps Progressive output ###
#Spline36Resize(640,480)
#Return last
Along with this script I used the Camcorder Denoise filter in VirtualDub at level 30 with 4 threads.

Below is a screenshot from the de-interlaced video file that was produced by this script:



At this point I was satisfied with how the video appeared but I wanted to resize to 640x480 resolution before encoding to h.264 for online distribution.

For the resize I used the following script:

Code:
avisource("G:\AviSynth Projects\2019-05-17 Tape 01\2019 Magnifico's EDIT\[Deinterlaced] 2019 Magnificos EDIT.avi")

#SelectEven() ### For 29.97 fps Progressive output ###
Spline36Resize(640,480)
Return last
Below is a screenshot from the AVI that was produced from this code. It appears at the same frame as the screenshot above:



I'm not sure how to describe this distortion, but it would happen for a single frame every few minutes in the AVI. At times this distortion would appear multiple times in the same minute.

Can anyone help me identity what this distortion is called and how I can prevent it from happening in future AviSynth exports?


Attached Images
File Type: png No Distortion - July 2019 Magnifico's.png (341.3 KB, 42 downloads)
File Type: png Distortion - July 2019 Magnifico's.png (363.2 KB, 42 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-29-2020, 10:17 AM
JPMedia JPMedia is offline
Premium Member
 
Join Date: Jun 2018
Location: East Coast, USA
Posts: 137
Thanked 35 Times in 28 Posts
[2020-07-29 Update]

I believe I have found the source of this rendering error. After troubleshooting with another AviSynth render from another tape that had the same type of distortion I took a closer look at my script:

Code:
### Colorspace Conversion for VirtualDub ###

#ConvertToRGB32(interlaced=true,matrix="Rec601")
Notice the "#" in front of ConvertToRGB32(interlaced=true,matrix="Rec601")

During the rendering process my footage is in the YV12 colorspace rather than RGB32. In VirtualDub I use the Camcorder Denoise filter which needs RGB32 colorspace to function properly. The "#" in front of that line of code means that no colorspace conversion is taking place, thus resulting in a rendering error.
Reply With Quote
  #3  
07-29-2020, 06:32 PM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Posts: 113
Thanked 46 Times in 32 Posts
Although I've never done this myself, I've read on this forum that h.264 supports aspect ratio settings. So you can specify in say a 720 x 480 file to display 4:3 aspect ratio (i.e. 640 x 480). That would seem like a better way to go, if possible. More experienced forum members could chime in on the details. Here's a post from hodgey saying how to do it in ffmpeg without any re-encoding. Captured VHS - What size for 4x3 aspect ratio?

Or perhaps you are uploading to a site that doesn't support aspect ratio, and so you are forced to resize to 640 x 480?
Reply With Quote
  #4  
08-12-2020, 10:32 AM
JPMedia JPMedia is offline
Premium Member
 
Join Date: Jun 2018
Location: East Coast, USA
Posts: 137
Thanked 35 Times in 28 Posts
[2020-08-12 Update]

Unfortunately what I thought was a fix in my previous post didn't have much of an impact on my exports. The same error continued to appear on different frames while rendering the same test footage. After another round of troubleshooting, I believe I have found the true source of this error and that is actually the Huffyuv Codec. I hastily made a test export and forgot to change the compression settings so the AVI defaulted to Uncompressed RGB video. Upon playback of this export I couldn't find any rendering errors, but I saw the file size was enormous in comparison to what I am used to seeing with Huffyuv exports from AviSynth. I then took this new AVI file into GSpot and I saw that it was uncompressed. This discovery led me to try an export from AviSynth with Lagarith lossless video codec. Fortunately my Lagarith test exports are free of rendering errors! This is a wonderful discovery because now I can move forward with restoring my analog captures without devoting an entire hard drive to a single tape. Also as Sanlyn pointed out in another thread Lagarith codec is useful because of its YV12 compatibility.
Reply With Quote
Reply




Tags
avisynth, distortion, exporting avi, rendering error

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth error: couldn't locate a decompressor for fourcc HFYU ofesad Restore, Filter, Improve Quality 0 08-20-2019 09:25 PM
DDoS, what to do and how to prevent it thecoalman Website and Server Troubleshooting 2 04-16-2017 04:52 AM
How to prevent copying of CD/DVD and implement table of contents wisedave Copy DVDs, Duplicate, Replicate 4 06-14-2011 09:10 AM
Prevent stupid ASCII usernames in vBulletin kpmedia Website and Server Troubleshooting 0 01-23-2011 05:41 PM
Edit an mpeg without re-rendering dmsinger Encode, Convert for discs 4 03-16-2005 12:10 PM

Thread Tools



 
All times are GMT -5. The time now is 05:21 PM