I downloaded AVISynth & VirtualDub (both 32-bit) and did a very simple test which worked and I was able to play the file in VirtualDub (see script below).
AVISource("raw YUV 8-bit uncompressed.avi")
So for another easy test I wanted to remove the 3:2 pull-down and get back to 23.97fps (original source is 24fps film on NTSC laserdisc 29.97fps) (see script below).
AviSource("YUV 8-bit uncompressed LFF.avi")
TFM()
TDecimate()
I get an error message of:
AVIsynth open failure:
TFM: YV12 and YUY2 data only!
(Z:\laserdisc capture tests\raw tests\703\THX 1138 test.AVS, line 2)
Sure, this file is YUV, but so was that first one I tested with and that opened & played fine.
I downloaded: avisynth.nl/index.php/TIVTC & dragged it into the AVISynth plug-in folder.
+ Reply to Thread
Results 1 to 30 of 80
-
-
Chroma subsampling is 4:2:2. Bit depth is 8-bit (I believe). When I drop the file in MediaInfo, I don't see a Bit-Depth link on the tree. But I did select 8-bit uncompressed when I captured in Adobe. I also don't see the Field Order on the tree. It would be nice to know what MediaInfo says. I selected LFF in Adobe.
I tried that new script. Error message below.
Avisynth open failure:
AVISource autodetect: couldn't open file 'YUV 8-bit uncompressed LFF.avi, pixel_type=YUY2
'
Error code:123Last edited by clashradio; 1st Oct 2018 at 21:56.
-
Change your script to:
Code:AviSource("YUV 8-bit uncompressed LFF.avi") Info()
Code:AviSource("YUV 8-bit uncompressed LFF.avi") ConvertToYV12(interlaced=true) TFM() TDecimate()
-
If it's UYVY, it should be natively supported by windows . If it's some other fourcc for 8bit 4:2:2 you might need external decoder. In Adobe you should be able to select UYVY
Mediainfo should tell you what it is (view=>text, copy & paste it back here)
Or another workaround is to use ffms2 or lsmash. But they require indexing and create clutter, slower at first because of the index
Code:FFVideoSource("YUV 8-bit uncompressed LFF.avi")
-
MediaIfo reports color space of YUV.
That new script worked! But shouldn't the left-view be the raw and right-view processed? I don't see any interlace issues with the left image. -
Look under "Codec ID" that should tell you what the fourcc is
There are many different types of "YUV" , different arrangements, different sampling . Not all are compatible with various applications. UYVY is the most compatible for Windows 8bit422 uncompressed YUV
It will look something like this
Video
ID : 0
Format : YUV
Codec ID : UYVY
Codec ID/Info : Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.
Duration : 33 ms
Bit rate : 994 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.000 -
No, VirtualDub is showing you the image after AviSynth has processed it. VirtualDub has no idea what the video looked like before AviSynth processing. The before/after panes are in reference to VirtualDub's processing. If you haven't added any VirtualDub filters they should both be the same.
-
In the meantime I went to the Video tab-filters-add-IVTC. The Right pane now shows the interlace artifacts. So that means the Left pane is what AVISynth has processed and the Right pane is raw? Even with the VirtualDub filter added?
-
-
Gottcha, that worked.
So if I IVTC a video that's not film-sourced, I'll get weird results?
And same goes if I QTGMC a video that's not video-sourced?
Since MediaInfo does report the file as UYVY, why did it have to have "ConvertToV12" and "interlace=true" in the script? Below is the MediaInfo report.
General
Complete name : Z:\laserdisc capture tests\raw tests\703\YUV 8-bit uncompressed LFF.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 256 MiB
Duration : 12 s 846 ms
Overall bit rate : 167 Mb/s
Video
ID : 0
Format : YUV
Codec ID : UYVY
Codec ID/Info : Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.
Duration : 12 s 846 ms
Bit rate : 166 Mb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.000
Time code of first frame : 00;00;00;00 / 00;00;00;00
Time code source : Adobe tc_A / Adobe tc_O
Stream size : 254 MiB (99%)
Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 00000001-0000-0010-8000-00AA00389B71
Duration : 12 s 846 ms
Bit rate mode : Constant
Bit rate : 1 411.2 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 kHz
Bit depth : 16 bits
Stream size : 2.16 MiB (1%)
Alignment : Aligned on interleaves
Interleave, duration : 535 ms (16.04 video frames)Last edited by clashradio; 2nd Oct 2018 at 09:01.
-
Yes. Though exactly what you get depends on the source and the IVTC algorithm used.
I wouldn't say QTGMC gives "weird" results, it gives the expected results: 59.94 fps progressive (from a 29.97 fps video). With a telecined film source you will have many duplicate frames, usually in a 3:2 repeat pattern. Ie, for film frames ABCD... you will get AAABBCCCDD...
As near as I can tell, this is a quirk of AviSource() with uncompressed UYVY sources. You can sometimes specify which color format you want with AviSource():
Code:AviSource("YUV 8-bit uncompressed.avi", pixel_type="YUY2")
You want to avoid unnecessary conversion to RGB so you should use a different source filter, or capture as YUY2 instead of UYVY if you can. Using a lossless codec may work around this problem too.
For example, I get YUY2 from your source using DirectShowSource(). But the behavior of DirectShowSource() can vary depending what codecs are installed on your system. As was mentions LSMASH delivers YUY2:
Code:LWlibavVideoSource("YUV 8-bit uncompressed.avi")
-
I think it's msyuv.dll from microsoft - but it returns RGB . It's another free decoder (drastic codecs) which can properly return YUY2 from UYVY using AVISource or VFW
UYVY is very "special" in windows NLE's like Premiere, Vegas, many others for 8bit 4:2:2 . It gets YUV passthrough as YUV . Most other "lossless" codecs are not treated as lossless, they get converted to RGB in Windows NLE's . (Ironic that msyuv.dll which is being used in avisynth converts to RGB)
But lsmash and ffms2 are other options that can properly return YUV 422 -
I captured a new clip with a couple of different settings. I was able to select UYVY (instead of V210).
The Motu HD Express capture device has its own interface software which works in conjunction with Adobe Premier. The "480i Setup options" are: NBU N10, Sony Beta, Sony Beta Japan, Panasonic MIII. I've always had it set to "NBU N10" (and this clip is also with this setting.) I'm not exactly sure what the other options are for? Beta cam? but I'm pretty sure for NTSC I need the NBU N10 option. There is also an option to select IRE of 7.5 and 0.0 (US & Japan)
The Motu outputs via HDMI to a pci/e card. In the "HDMI Format" options I can select HDMI (RGB) or HDMI (YCbCr). I think this section of the set-up process is when you capture from HDMI, but I selected "YCbCr" anyways.
Here is the MediaInfo report of new clip:
General
Complete name : Z:\laserdisc capture tests\raw tests\703\8-bit uncompressed 422 UYVY .avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 222 MiB
Duration : 10 s 978 ms
Overall bit rate : 169 Mb/s
Video
ID : 0
Format : YUV
Codec ID : UYVY
Codec ID/Info : Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.
Duration : 10 s 978 ms
Bit rate : 168 Mb/s
Width : 720 pixels
Height : 486 pixels
Display aspect ratio : 3:2
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 15.999
Stream size : 220 MiB (99%)
Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 00000001-0000-0010-8000-00AA00389B71
Duration : 10 s 978 ms
Bit rate mode : Constant
Bit rate : 1 411.2 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 kHz
Bit depth : 16 bits
Stream size : 1.85 MiB (1%)
Alignment : Aligned on interleaves
Interleave, duration : 549 ms (16.45 video frames) -
Ok, I ran that newly captured UVYV file into VirtualDub and got the same error message so I added "ConvertToYV12(interlaced=true)" to the script and that worked. But I thought selecting UVYV as opposed to V210 was my problem?
But yes jagabo, when I save that VirtualDub file as an .AVI, it shows RGB24. Does that mean I'm still capturing as RGB vs. YCbCr?
I compared the IVTC'ed file to the raw file and sure, the IVTC looks way better due to no 3:2 pull-down, but the overall quality looks like it has generation loss (even when uncompressed RGB/YCbCr is selected). Is that due to the RGB conversion?Last edited by clashradio; 3rd Oct 2018 at 07:42.
-
No, UYVY is the problem with AviSource(). That's why I suggested capturing YUY2 if you can. Or use a lossless codec while capturing (it may convert to YUY2 internally while encoding or decoding). Of use DirectShowSource()* instead of AviSource().
This was already discussed. What's in the file is UYVY. But for some reason AviSource() is converting to RGB.
There is a little quality loss from the UYVY to RGB conversion, and a little more quality loss from the RGB to YV12 conversion. TFM and TDecimate can work in YUY2 so you could use ConvertToYUY2(interlaced=true) instead to avoid some of these losses. But some other filters you'll be using with other videos (QTGMC, for example) require YV12. And any final delivery format (DVD, Blu-ray, youtube) is going to be YV12.
* Note that DirectShowSource() is deprecated as it is not frame accurate with out-of-order, inter-frame codecs (MPEG2, h.264, etc.). But it should be fine with uncompressed video or intra-frame codecs.Last edited by jagabo; 3rd Oct 2018 at 08:42.
-
I'm not really familiar with Adobe Premiere Pro CS4, which is what I have to capture with the Motu (I edit with Vegas, not Premier). Although Motu says Premier CS6 or newer is required. The only two codec options CS4 has are V210 & UYVY. I don't see YUY2. I'm trying t find out if CS6 has YUY2.
When you say "try using a lossless codec" I thought V210 and UYVY are lossless? MediaInfo reports lossless.
I'm trying to use VirtualDub to capture from the Motu, but so far no luck. -
V210 and UYVY are raw video samples with no compression. Lossless codecs compress the video without any losses -- much like a ZIP archive compresses files without losses. With this type of video it can reduce the size of your file to somewhere between 1/2 and 1/3 the uncompressed size. Such codecs often have the ability to re-order the components (for example, UYVY and YUY2 are the same except for the order of the Y, U, and V components) or convert to/from RGB and YUV formats. Using compression also reduces the amount of data written to the hard drive giving you more headroom to prevent dropping frames.
What does "no luck" mean? Does the VirtualDub see the capture device? Can you see the preview? Can you select the color format and other properties? Can you select a codec? Is it dropping frames while capturing? VirtualDub can be finicky. It has so many configuration options it can be hard to get working. -
Sorry, I should have been more specific. I can't get VirtualDub to recognize the Motu at all. The only capture I get is the capture screen that shows File-Device-Video-Audio etc. I can not select any options. I've tried with the Motu software open and just with VirtualDub.
My new build will have M.2 500GB which is plenty for capturing one side of a laserdisc, so speed and file size shouldn't be an issue.
Adobe no longer supports CS6 and Motu no longer supports the HD Express. If I can't get VirtualDub to recognize the Motu, am I stuck capturing as UYVY and then converting from RGB?Last edited by clashradio; 3rd Oct 2018 at 20:59.
-
If you install drastic codecs, AVISource will decode UYVY as YUV . I think it's microsoft's decoder (msyuv.dll) that is doing the RGB conversion
http://www.drastic.tv/support-59/legacysoftwarehardware/71-mediareactorlegacyversions/...gacyycbcrcodec
But you still have to specify pixel_type="YUY2" explictly in the AVISource line, otherwise it will return YV12 . (Or use lsmash or ffms2) -
jagabo mentioned there is a little quality loss from the UYVY to RGB conversion, and a little more quality loss from the RGB to YV12 conversion. By using this Drastic codec are you saying when AVISource decodes from UYVY to YUV, there won't be this loss?
-
Yes, no quality loss for UYVY if you output YUY2 , because you're not converting to RGB; you're avoiding the RGB step completely (However it gets converted to RGB when you "see" it as in a preview, but the video itself isn't converted)
But earlier, when you said " but the overall quality looks like it has generation loss" - that can be caused from other things too. It depends on what you mean exactly. -
poisondeathray- You said you think it's Microsoft's decoder (msyuv.dll) that is doing the RGB conversion:
Are you saying even if I could select & capture the YUY2 codec like jagabo recommended, I'd have the same error message in VirtualDub?
I was thinking this Drastic codec was like a plug-in to capture with but it's more of a conversion process?
Sorry to be green on this color space issue (and AVISynth & VirtualDub). I didn't know I had a problem until I started using the two.
I want to have the best possible captures & output delivery from laserdiscs. I've got the gear and hardware but still super green on software/program end of it.
As far as what I mentioned about generation loss; that is in the eye of the beholder. After all this is 480i RF laserdisc. You can only get so much water out of a rock, even though I seem to expect more.
So when I download the Drastic codec, VirtualDub will have the YUY2 option to output? -
No. Apparently msyuv.dll is converting UYVY to RGB. It has no problems passing YUY2 as YUY2.
Based on what PDR said, AviSource("filename.avi", pixel_type="YUY2") will give YUY2 output. Conversion from 8 bit UYVY to 8 bit YUY2 is lossless. It's the same components (Y, U, V), with the same chroma subsampling (4:2:2), just with the components in a different order UYVY vs YUYV. -
Vdub and vdub2 can decode UYVY correctly if you enable it's internal decoder, even without using drastic
drastic codecs is for using VFW system for decoding, such as AVISource() . If you don't want to install any 3rd party system codec, you can use ffms2 or lsmash for avisynth source filter (but I think one of them outputs YV16 , I forget which one , which is planar YUV 4:2:2 - that can be converted in avisynth losslessly to YUY2 too)
UYVY gets preferential treatment in Adobe (and other windows NLE's) ; it gets treated properly as 8bit YUV 422 . Whereas "YUY2" (or any other 8bit 422 configuration 2VUY, YV16, YUNV etc... or almost any "lossless" YUV codec get converted to RGB (the exception is x264 lossless in newer premier versions, but only for certain pixel formats) . If you're using a NLE for more than capture (actually using it to edit, color correct etc.., then stick with UYVY)
In theory , they can all be converted back and forth losslessly - those all mean 8bit 4:2:2 - and you're just storing the data slightly differently. But it also depends on which application is doing the conversion. Some of them mess it up (avisynth is ok for YUY2 <=> YV16 , assuming UYVY was decoded correctly in the first place as YUY2)
earlier jagabo mentioned QTGMC required YV12, but newer versions of QTGMC can work with YV16 or YUY2 (even classic avisynth 2.6 x86 , you don't necessarily need avisynth+ ) -
I use Adobe Premier CS4 only to capture. It's the only capture program that will work with the Motu HD Express. Even though AVISynth might do a better job at color correcting etc, I really only want to use it for IVTC and QTGMC. I edit with Vegas.
So since I'm editing with a NLE, you recommend keeping it UYVY? But that brings me back to my problem; VirtualDub won't recognize it. I keep getting the AVISynth error: YV12 and YUY2 data only! (unless I have ConvertToYV12 (interlaced=true) in the script. But I thought jagabo said this will result in some quality loss.
I'm trying to figure out how to enable VirtualDubs' internal decoder. Do you go to Video tab-Decode Format? I've tried basically all of the 8-bit 4:2:2 YCbCr options. I'm getting an error code of: I don't know what "YUY2" means.
Do I write: ffms2 or lsmash in the script? (whichever one doesn't output in YV16) instead of ConvertToYV12 (interlaced=true).
I have not downloaded Drastic yet.Last edited by clashradio; 6th Oct 2018 at 09:34.
-
How many times does this have to be said? Use Drastic to give AviSource the ability to get YUY2 from your caps. Or use another source filter like DirectShowSource, ffVideoSource (included in the ffms2 package), or LWlibavVideoSource (included in the LSMASH package).
-
vdub's internal decoder is only for native decoding, not avisynth . When you pass anything through an avs script, it's avisynth's source filter that is responsible for decoding, not vdub. You bypass vdub's decoder when using avs. Vdub is only being used to preview in that case (it's converted to RGB for the preview only, the underlying data is still whatever the script specifies)
ffms2 outputs YV16 and lsmash outputs YUY2 (at least the ones I'm using do, other versions might be different)
You would write
LWLibavVideoSource("video.avi")
UYVY gets special treatment in vegas too . It gets "studio RGB" treatment which is the preferred format in vegas (full range preserved, nothing clipped). YUY2 (and all the others...) get treated as "computer RGB" (which potentially causes clipping) -
I was going to show that all these delivered the exact same results but they didn't!:
Code:AviSource("8 bit huffyuv.avi") # made by opening the UYVY video with VirtualDub and saving with huffyuv compression DirectShowSource("8-bit uncompressed 422 UYVY .avi") LWlibavVideoSource("8-bit uncompressed 422 UYVY .avi").ColorYUV(off_u=1, off_v=1) ffVideoSource("8-bit uncompressed 422 UYVY .avi", colorspace="YUY2")
Code:v0 = AviSource("8 bit huffyuv.avi")) v1 = DirectShowSource("8-bit uncompressed 422 UYVY .avi") return(Subtract(v0,v1).Levels(120,1,136,0,255)
Comparing AviSource (the huffyuv video) to LWlibavVideoSource:
Code:v0 = AviSource("8 bit huffyuv.avi")) v1 = LWLibavVideoSource("8-bit uncompressed 422 UYVY .avi") return(Subtract(v0,v1).Levels(120,1,136,0,255)
Comparing AviSource (the huffyuv video) and ffVideoSource:
Code:v0 = AviSource("8 bit huffyuv.avi")) v1 = ffVideoSource("8-bit uncompressed 422 UYVY .avi", colorspace="YUY2") return(Subtract(v0,v1).Levels(120,1,136,0,255)
I'm not sure what to make of all this.Last edited by jagabo; 6th Oct 2018 at 17:29.
Similar Threads
-
What is the difference between Virtualdub's deinterlace filter and QTGMC
By ricardoRF10 in forum EditingReplies: 12Last Post: 20th Jan 2018, 07:32 -
Can MCTD & QTGMC be run on a 16 Core CPU in non-MultiThreaded?
By MrBiggles in forum RestorationReplies: 17Last Post: 23rd Feb 2017, 13:19 -
Staxrip & QTGMC...
By The.King in forum Video ConversionReplies: 13Last Post: 7th Sep 2015, 17:37 -
QTGMC doesn't deinterlace
By pub in forum DVD RippingReplies: 5Last Post: 28th Dec 2014, 12:07 -
aviSynth, VirtualDub & filters ...
By AEN007 in forum Video ConversionReplies: 101Last Post: 9th Dec 2013, 16:19