#1  
02-16-2019, 08:02 PM
drzapp drzapp is offline
Premium Member
 
Join Date: Dec 2018
Posts: 97
Thanked 10 Times in 8 Posts
Here are 3 samples- first is the raw capture (captured from AG-1980 with ATI 600 USB using AmarecTV, MagicYUV). Second is the crop/mask version (Followed this guide). 3rd is the progressive final (AVIsynth DFTTest, QTGMC). These are for web/computer viewing. I would appreciate some feedback from the experts on if this is a good baseline workflow, and how I can improve the results. Also I have a question about the final size- I'm capturing 720x480, but the size after the crop/mask is 704x464... if I'm not resizing shouldn't it be 720x480? Thanks


Attached Files
File Type: avi testcut.avi (83.78 MB, 12 downloads)
File Type: avi testcutcrop.avi (79.09 MB, 6 downloads)
File Type: mkv testcutcrop.mkv (4.35 MB, 8 downloads)

Last edited by drzapp; 02-16-2019 at 08:40 PM.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-17-2019, 08:43 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Thanks for the samples and processing info.
Some notes about wo0rkflow:


Quote:
Originally Posted by drzapp View Post
These are for web/computer viewing. I would appreciate some feedback from the experts on if this is a good baseline workflow, and how I can improve the results. Also I have a question about the final size- I'm capturing 720x480, but the size after the crop/mask is 704x464... if I'm not resizing shouldn't it be 720x480?
A final output frame size of 704x464?
No way. And you can't post 720x480 or any other anamorphic format to internet sites. The web is square-pixel only. The two aspect ratios allowed are 16:9 and 4:3, and on some websites it's 16:9 only. Besides, if you resized 704x464 to 720x480 you would distort the aspect ratio and stretch the image vertically.

I'd ask why you chose VirtualDub for your crop operaton when you already intended to go into QTGMC and AVisynth, where cropping/resizing is far easier and requires noextra steps, no extra intermediate files, and no undessirable jockeying back and forth between colorspaces.

A workflow usually begins with a quick initial analysis of the video. It's then that you notice things that slipped by at first. For instance, did you try opening the Avi in VirtualDub and checking the frame structure for interlace, telecine, and so forth? You can do that, for instance, by loading VDub's yadif deinterlacer and moving frame by frame. If you had done so, you would notice something peculiar.

Attached is "testcut_59_94_Demo.avi". It s a few short frames from a section of your original asample that have been deinterlaced and plays at 59.95 fps double frame rate. Open testcut_59_94_Demo.avi in VirtualDub and scroll through it frame-by-frame. Notice anything? What you should see is that every two frames are duplicates. Looking closer at the interlaced version, you find that it's not normal interlace. Each interlaced frame consists of two images, both of which are alike but are blended to look like interlace. It looks as if this was originally 23.976 progresive film, but has been through some very clumsy processing and likely a PAL-NTSC conversion of some kind. The fuzzy edge noise and other digital artifacts reveal that this movie has been around the block a few times and requires a bit more cleanup than you've given it. Among other bad guys, there are bad horizontal dropouts in frames 21-23 and ugly DCT edge ringing halos elsewhere.

Another early way to explain visual problems is to remove edge borders so that you can get an accurate YUV levels histogram./ Use this standard approach:

Code:
Crop(8,0,-8,-12)
ConvertToYV12(interlaced=true)
Histogram("Levels")
return last
The script attaches a levels histogram to the frames which explains a lot. Look at the image below. There are lots of very dark grays but no true, strong blacks. Shadow detail is murky and looks a little cloudy or washed out.

Initial study YUV histogram.jpg


In the horoscope look st the top white horizontal band. The left side of that band shows that black data peaks in tyhe dark gray territory and never reaches the far left side. One would say this in dictates that black levels are too high, sop thye image lacks a certain snap or dynamic range in he darks. It's also caused by the capture cartd, which clips dark daty at y=16 before the image ever reaches VirtualDub during capture. Clipped data can't be recovered, so brightening the d arks won't do help and won't open up any new details. This means you'll have to play some post-processing tricks with levels in order to make the overall images look more convincing and less murky.

Another way to check dynamic range is with this script that executes ColorYUV's Analyze function:

Code:
Crop(8,0,-8,-12)
ColorYUV(analyze=true)
return last


The number grid that overlays the image tells more of the4 st from 16-2356 bto ory., Under the vertical column labeled "Luma Y", the minimum dark value is y=22. During playback When YUV 16-235 is expanded to RGB 0-255, the darkest value you'll see in RGB won't be a true bRGB=0 blscvkn but will be more like a dark gray RGB 25 or so. In fact,m if you left the bordedrsb exposed in thatv frame, the borders tyhat you thought were "black' mwere actually in the dark gray RGB 30'a and 25's. Those borders wouldm stand out as dark gray that would be lighter than the zero-black bsckground that surroundsn the frames on a 16:9 display.

The "maximumm value under "Luma Y" is 255, which is ann unsafe luma brightness for YUV video. Ifn the brioghtest valuesmn in nYUV isn already 255, and if YUV 16-235 is expanded in RGB to 0-255, you'll have bright clipping. RGB displays cannot accept YUV values of 255 -- any data i8n those brights will simply be discarded in RGB and you'll lose dynamic range in the brights along with what is being lost in the clipped shadows.

If tyou have elevated blacks and out-of-range bright vales in YUV, the best time to correct those problems is while the video is still in its original YUV colorspace and before any RGB conversion is made. But since your first step was to use VirtualDub for the cropping job, which converts to RGB, you lost the chance for that correction. Data clipped in RGH can't be recovered later. This is what is meant by avoiding "undesirable colorspsce conversions" in your workflow.

Then YUV levels corrections that I made are in these lines, which are from the full script posted later:

Code:
ColorYUV(off_y=-3)
Tweak(cont=1.15,dither=true,coring=false)
Levels(ColorYUV(off_y=-3)
Tweak(cont=1.15,dither=true,coring=false)
Levels(20,1.0,255,16,235,dither=true,coring=false),dither=true,coring=false)
The "off_y=-3" setting makes a slight but visible reduction in the black levels by moving all pixel values slightly lower toward the dark end. Black levels are further corrected in the "Levels" statement by directing that all values in the area of y=20 be lowered to y=16 (you can see those numbers in the string "20,1.0,255,16,235"). Some brighter contrast in the highlights and upper midrange are added by the Tweak statement, which keeps the overall image from looking so dim, and the numbers in the Levels statement insure that any values approaching an invalid 255 are toned down to remain within the deasired bright limit of y=235.

If you don't yet understand this business of digital video black levels, clipping, and y=16-235 broadcast range values, it probably won't affect your YouTube posts too much because most Youtube posts display really ugly clipping errors all over the place. At least your work will display the same errors as most of the crowd. It's does mark the results as amateur work, or at least as the work of someone who didn't read their expensive "Pro" software's user guide. Smarmy as that might sound, it's true. the more you learn about video, the more you'll see just how bad the average YouTube post really looks.

The extra step you took to use VirtualDub for cropping, which involved a VirtualDub RGB conversion, could
have been more quickly and easily in Avisynth and resulted in a more correct 708x480 output frame. It also maintained the correct aspect ratio for the core image, which in this case is not true 4:3 but is more accurately the classic movie ratio 1:36:1 rather than 1.3333:1. The very slightly wider movie image is intact and is centered in the frame with 4 pixels at the top border and 6 pixels at the bottom. I used this code:
Code:
Crop(8,0,-8,-10).AddBorders(0,4,0,6)
I used ReplaceFramesMC to interpolate new replacement frames for the bad horizontal rips (dropouts) in frames 21 and 23. FixVhsOversharp and HQDering were used to clear most of the right-edge DCT ringing artifacts (look at slightly dark halos along the inner edges of the heroine's face in later frames). Santiag and RomoveDirtMC were used to clean overall floating tape grunge and ragged, fuzzy edges that looked stringy in some frames. AWarpSharp2 tightened color overrun around saturated edges, especially in the clothing.

In VitruaDub I used the graphic Levels filter to increase slightly increase dynamic contrast between darks and brights, and ColorMill to very slightly pump saturation. The Virtualdub settings are saved in the attached "VDub_settings.vcf", which can be used to load the same filters and settings that I used.

You should consult websites directly to research exactly what they require for file postings. But below is a list of t the most commonly accepted progressive file sizes for internet posts.

Code:
Resolution     Name     Quality
3840x2160     2160p     4K
2560x1440     1440p     2K
1920x1080     1080p     Maximum resolution for HD
1280x720     720p     Minimum resolution for HD
856x480     480p     Standard definition
640x360     360p     Traditional website resolution
426x240     240p     Minimum YouTube video size
Notice that all of the frame sizes are 16:9 frames. So, how would you size a 4:3 video for those frame dimensions? For a 4:3 video in a 16:9 frame, let's take the "Standard definition" 856x480 display size. If you notice on most websites and Youtube, the small online video player is either a 640x360 or 854x480 player size, depending on how you've laid out your web browser.

For a 4:3 video in an 856x480 window, you have to size your 4:3 video based first on the desired height, which is 480 pixels high. A 4:3 aspect ratio means that for every 3 pixels of height you'll have 4 pixels of width. Another way of looking at 4:3 is that the width is 1.333333 times the height (4 divided by 3 is 1.3333333). So 480 times 1.333333 would call for a width of 639.9999 pixels. Rounded off, that 4:3 image would be 640x480.

But the total frame width is a 16:9 856-pixel width, not 640. What you have to do to fill that 856-pixel-wide 16:9 frame with a 640x480 4:3 image is the same thing your PC display or Tv would do: fill the side spaces with black pixels. 640x480 plus 108 pixels on the left and 108 pixels on the right would be 856x480. The 640x480 square-pixel web version is attached as "testcut_29_94p_4x3.mp4". A 16:9 pillared example is attached as "testcut_856x480.mp4".

Should you go higher and start resizing your 640x480 videos into HD frame sizes? That will look like crap, and there are thousands of YouTube videos out there to prove it. Follow this rule: HD submissions require HD originals, or you are simply going to look like yet another clueless newbie blowing up low-resolution originals into blurry fuzzy artifact-filled frames. Don't worry: when necessary, internet players and your own graphics card can upscale standard definition video to a 1920x1080 window a lot better than you can with your software.

Here is the script I used to get the lossless 640x480 file that was later encoded as "testcut_29_94p_4x3.mp4" (attached). If you use any suggestionsd from this script, be sure to change the path statements to match locations in your system:

Code:
Import("D:\Avisynth 2.5\plugins\ReplaceFramesMC.avs")
Import("D:\Avisynth 2.5\plugins\RemoveDirtMC.avs")
Import("D:\Avisynth 2.5\plugins\Santiag_v16.avs")

AviSource("D:\forum\faq\drzapp\C\testcut.avi")

###-- The following filters work in YUY2 ---###
ColorYUV(off_y=-3)
Tweak(cont=1.15,dither=true,coring=false)
Levels(20,1.0,255,16,235,dither=true,coring=false)
AssumeTFF()
SeparateFields()
FixVHSOversharp(20,16,12)
FixVHSOversharp(20,8,4)
Weave()

###-- The following filters work in YVI2 ---###
ConvertToYV12(interlaced=true)
HQDering()
QTGMC(preset="medium",FPSDivisor=2,ChromaNoise=true,border=true)
vInverse2()
Santiag()
RemoveDirtMC(30,false)
ReplaceFramesMC(21,1)
ReplaceFramesMC(23,1)
MergeChroma(aWarpSharp2(depth=30).aWarpSharp2(depth=10))

### --- Crop and restore frame size for web use ---###
Crop(8,0,-8,-10).AddBorders(0,4,0,6)
Spline36Resize(640,height)

### --- To RGB32 for VirtualDub filters ---###
ConvertToRGB32(interlaced=false,matrix="Rec601")


Attached Images
File Type: jpg Initial study YUV histogram.jpg (130.5 KB, 86 downloads)
File Type: jpg Initial study ColorYUV Analyze.jpg (121.5 KB, 86 downloads)
Attached Files
File Type: avi testcut_59_94_Demo.avi (22.69 MB, 7 downloads)
File Type: vcf VDub_settings.vcf (999 Bytes, 5 downloads)
File Type: mp4 testcut_29_94p_4x3.mp4 (6.42 MB, 6 downloads)
File Type: mp4 testcut_856x480.mp4 (6.44 MB, 4 downloads)
Reply With Quote
The following users thank sanlyn for this useful post: drzapp (02-17-2019)
  #3  
02-17-2019, 10:42 PM
drzapp drzapp is offline
Premium Member
 
Join Date: Dec 2018
Posts: 97
Thanked 10 Times in 8 Posts
Wow, thank you for the very detailed response- it's going to take me a while to digest it.

To answer your question about why I was cropping in Virtualdub- That's the only way I knew how. Yesterday I came across the avisynth crop/addborder idea, and so that's what I'll be doing instead. I didn't know the best way to analyze the video pre-processing, so now I'll need to learn how to do this. Lots of reading in my future!

I'll answer more tomorrow when I get time.
Thanks again!
Reply With Quote
  #4  
02-18-2019, 04:56 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Oh brother, talk about typos! I must have sat on my keyboard just before I clicked "Submit".

Quote:
I'd ask why you chose VirtualDub for your crop operaton when you already intended to go into QTGMC and AVisynth, where cropping/resizing is far easier and requires noextra steps, no extra intermediate files, and no undessirable jockeying back and forth between colorspaces.
should read:
Quote:
I'd ask why you chose VirtualDub for your crop operation when you already intended to go into QTGMC and Avisynth, where cropping/resizing is far easier and requires no extra steps, no extra intermediate files, and no undesirable jockeying back and forth between colorspaces.
Quote:
In the horoscope look st the top white horizontal band. The left side of that band shows that black data peaks in tyhe dark gray territory and never reaches the far left side. One would say this in dictates that black levels are too high, sop thye image lacks a certain snap or dynamic range in he darks. It's also caused by the capture cartd, which clips dark daty at y=16 before the image ever reaches VirtualDub during capture. Clipped data can't be recovered, so brightening the d arks won't do help and won't open up any new details. This means you'll have to play some post-processing tricks with levels in order to make the overall images look more convincing and less murky.
should be:
Quote:
In the horoscope, look st the top white horizontal band. The left side of that band shows that black data peaks in the dark gray territory and never reaches the far left side. One would say this indicates that black levels are too high, so the image lacks a certain snap or dynamic range in the darks. It's also caused by the capture card, which clips dark data at y=16 before the image ever reaches VirtualDub during capture. Clipped data can't be recovered, so brightening the darks won't help and won't open up any new details. This means you'll have to play some post-processing tricks with levels in order to make the overall images look more convincing and less murky.
Quote:
The number grid that overlays the image tells more of the4 st from 16-2356 bto ory., Under the vertical column labeled "Luma Y", the minimum dark value is y=22. During playback When YUV 16-235 is expanded to RGB 0-255, the darkest value you'll see in RGB won't be a true bRGB=0 blscvkn but will be more like a dark gray RGB 25 or so. In fact,m if you left the bordedrsb exposed in thatv frame, the borders tyhat you thought were "black' mwere actually in the dark gray RGB 30'a and 25's. Those borders wouldm stand out as dark gray that would be lighter than the zero-black bsckground that surroundsn the frames on a 16:9 display.

The "maximumm value under "Luma Y" is 255, which is ann unsafe luma brightness for YUV video. Ifn the brioghtest valuesmn in nYUV isn already 255, and if YUV 16-235 is expanded in RGB to 0-255, you'll have bright clipping. RGB displays cannot accept YUV values of 255 -- any data i8n those brights will simply be discarded in RGB and you'll lose dynamic range in the brights along with what is being lost in the clipped shadows.
should be:
Quote:
The number grid that overlays the image tells more of the story from 16-235. Under the vertical column labeled "Luma Y", the minimum dark value is y=22. During playback when YUV 16-235 is expanded to RGB 0-255, the darkest value you'll see in RGB won't be a true RGB=0 black but will be more like a dark gray RGB 25 or so. In fact, if you left the borders exposed in that frame, the borders that you thought were "black' were actually in the dark gray RGB 30's and 25's. Those borders would stand out as dark grays that would be lighter than the zero-black background that surrounds the frames on a 16:9 display.

The "maximum value under "Luma Y" is 255, which is an unsafe luma brightness for YUV video. If the brightest value in YUV is already 255, and if YUV 16-235 is expanded in RGB to 0-255, you'll have bright clipping. RGB displays cannot accept YUV values of 255 -- any data in those brights will simply be discarded in RGB and you'll lose dynamic range in the brights along with what is being lost in the clipped shadows.
I hope that makes the worst of it more readable.

It must be true -- those pesky characters move around on their way to the site!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Audigy 2 ZS Video Editor, Creative Video Blaster Editor for capture? fujrer Capture, Record, Transfer 3 02-01-2019 06:21 PM
Video capture card that would capture all lines in NTSC? alltruefalse Capture, Record, Transfer 3 12-29-2018 01:48 AM
Multiple video capture questions - Hi8, capture system, Huffyuv? Lightsword Capture, Record, Transfer 14 05-22-2014 11:53 AM
Video capture project, what direction is best? + Proc amp vs TBC + Best capture card? admin Project Planning, Workflows 11 06-16-2011 09:35 AM
ATI All In Wonder video capture card, with capture computer, for sale [SOLD] kpmedia Marketplace 1 05-23-2011 02:09 PM

Thread Tools



 
All times are GMT -5. The time now is 02:12 AM