HDMI Capture Problem SOLVED - AviSynth RULES!

I used both QTinput() and directshowsource() and I prefered directshowsource because of gamma issues. QTinput resulted in crushed blacks, whereas directshowsource looked correct, at least on a PC. Don't know how this will translate to a Mac. This isssue requires careful testing. We're in new territory with Prores.


There are gamma issues with h.264 in mov, but not with ProRes422 using QTInput. It's not new territory, QTInput has used by many folks in the post production industry for years when avisynth processsing has been required

Levels are passed untouched through QTInput, so if there is crushed blacks, they were there in the first place. In contrast, RGB conversion using Rec709/601 will clip Y' <16 and Y' >235 , reducing the data available . Keeping the same colorspace and no additional filters yields the highest quality

Here are some screenshots, decoded with QTinput converted to RGB using Rec709 for the screenshot, and the other is the ProRes reference decoder using QTPlayer . You can verify this with other footage too , for example from the Arri Alexa. QTinput produces spec compliant decoding

http://www.mediafire.com/?rgxnqzjyrrtkrpz


Perhaps you were using QTInput incorrectly ?
 
Last edited:
I have Avisynth up and running under virtualbox on my Mac!
The first part of the script seems to run OK until i get the error "There is no function ConvertToYV24" - which is strange, because that's an internal function.
Any suggestions?


Martin
 
I would like to add a link to the proper version of AVIsynth in the first post. What do you recommend, PDR?

I haven't examined those chroma functions, but it seems they rely on 2.6.x functions

2.6.x is fairly stable, I've been testing it for almost a year now , and I think it's safe to suggest that one (provide the official sourceforge link)

And it's very easy to switch back & forth between 2.5.8 and 2.6.0 by installing one on top of the other, I've done this many times for debugging
 
just a try:
left green line correction of 009.mov : see http://www.mediafire.com/file/5a6m4jsviffdmvo/Testqt10.rar (can only upload till 200MB)

avisynth:
QTInput("C:\TESTMOV\009.mov")

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FDecimate.dll")

AssumeTFF()
converttoyuy2()
trim(1,0)
TFM(mchroma=false, pp=5)

FDecimate(threshold=0.5)

delayaudio(.07)

AssumeFPS(24000,1001)
----------------------------------------------
VIRTUALDUB:
cropping X1 offset: 4
brightness/contrast of your need (here extreme example: b=-16% c=+12%) output: YUV,24fps <---YOU DO NOT NEED THIS FUNCTION,
instead use null transform placeholder for cropping
Filter Resize : 100,209 x 100 @mode:precise bicubic (A=0.75) output: YUV 24fps

Compression: Cineform HD Codec V7.1.7
 
Last edited:
HDMI-Cable

You have to pay attention only to use high-speed cable from specification 1.3 up,
class A or Class C (mini-HDMI). This spec. is 24 bit RGB/36 bit YUV, Deep Color 30, 36 und 48 bit RGB/YUV, xvYCC-Colour (IEC 61966-2-4)
8,16 GBit/s (340 MHz × 8 bit × 3)
Note: HDMI is "consumer-oriented" development, therefore can understand Barry´s disappointment for filming-needs, for our intentions to function with GH2/recording don´t handle with cheapiest cables (price from 5$ to 200$- gold-price! but no need for 200$cable -only for SuperStars)

further: 1.3a,b,c has error corrections to 1.3 , 3D-transmittion, goes until 1080i (!!!)
1.4 has 4k-solution, added Ethernet-channel (for Vitaly-April-foolishes directed in your GH2 - i call it the "Vitaly-Inside.Cable"),
1.4a will be 3D-Standard (for still picture 3D need 1.3a,b,c up) in 1080p/24Hz, 720p/50 or 60Hz
 
Last edited:
FIRST POST UPDATE

I've updated the first post with:

* A new section on ProRes with links
* Link to Avisyth 2.60 alpha
* Link to VirtualDub
* General clean-up to make the sections easier to read

Everything is now there to get you going.
 
Hey Ralph.

Great! I can't wait to see the results. I do need some last little piece of help.
If i load the AVS file into VirtualDub, what do i do then?!
I've tried to Save Avi, but then i end up with a file 5 times bigger and with weird color moire all over.

If you can help me out with that last part of the chain, that'd be terrific!

UPDATE: is there a way to save to Prores MOV?

Thanks,

Martin


FIRST POST UPDATE

I've updated the first post with:

* A new section on ProRes with links
* Link to Avisyth 2.60 alpha
* Link to VirtualDub
* General clean-up to make the sections easier to read

Everything is now there to get you going.
 
I'm not familar with virtualbox. How is virtualbox set up ? do you have a copy of windows installed inside of it?

here's the thing: you cannot encode to Prores on a PC , but you can decode it

vdub can only export AVI wrapped videos - which sucks for importing into mac applications like FCP (unless you use the external encoder feature)

The filesize is large , because you didn't select compression (video=>compression)

I would probably ditch vdub and use ffmpeg to encode to DNxHD (MOV wrapped) which FCP will accept . ffmpeg can accept avs scripts directly, and you can make a windows batch file to encode , for example, all the files in a directory
 
I would probably ditch vdub and use ffmpeg to encode to DNxHD (MOV wrapped) which FCP will accept . ffmpeg can accept avs scripts directly, and you can make a windows batch file to encode , for example, all the files in a directory

This sounds good for Mac people. If somebody wants to write step by step instructions, I'll add it into the first post.
 
martin will have to help with the testing , but I can provide instructions on a PC


some questions first for martin:

1) did you "fix" the prores file first in QT 10 ? the green border ?

2) what does the preview in vdub look like ? do you get the weird colors before exporting? there might be graphics driver issues running through your virtualization software

(you can still use vdub to preview .avs scripts)

try this:
options=> preferences=> display => uncheckmark use directx for display panes





1) create your avs scripts - there are some avs batch script creators, I think Ralph made some links to some tools in the 1st post ?

2) download a binary of ffmpeg for windows and place a copy of ffmpeg.exe into same directory as your video files, and .avs files (your 1 folder should have the .mov and .avs files)
http://hawkeye.arrozcru.org/

3) write the following in notepad, save it, change the extension from .txt to .bat . Double click the .bat file to process all the .avs files in the directory

Code:
for %%a in ("*.avs") do ffmpeg -i %%a -vcodec dnxhd -b 175M -an %%~na.mov
pause


Note that batch script is only valid for the 1920x1080p23.976 variant of DNxHD and gives the 175Mb/s 8-bit 4:2:2 variety.

There is no audio in the script "-an" . If for some reason you wanted audio change the script to "-acodec copy" instead of "-an" . That will give uncompressed audio in the .mov wrapper, but AFAIK, the HDMI audio is useless

If you wanted the 1920x1080p23.976 115Mb/s variant of DNxHD , substitute "-b 115M" for "-b 175M"

If you wanted the 1920x1080p23.976 36Mb/s proxy variant of DNxHD , substitute "-b 36M" for "-b 175M"
 
left green-line correction
for Mac and non-Mac people:

add a line to AVS-File before AssumeFPS(..: "Crop(4, 0, 0, 0).BilinearResize(1920, 1080)"
then it runs in what you like, tested with mpeg4-output in ffmpeg
 
@daidalos
There is a faint double green/purple line on the right border as well :)

You may or may not want to add that as an option for a workaround

Well hopefully there will be a permanent fix in firmware , cropping and resizing isn't ideal IMO
 
Hi all.

I succesfully installed the dnxhd codec, ffmpeg and all the things necesary in the right spot.
The script executes and ffmpeg comes with the following error:

[buffer @ 01F55240] Invalid pixel format string '-1'
Error opening filters!

And hangs.


Martin.
 
@martin

it's working for me on a PC



1) post the exact script you are using

2) try adding ConvertToYUY2() at the end the end of the script

3) which ffmpeg binary are you using ? I used a 32-bit static build from that link

4) can you preview one of the .avs scripts in vdub / mpc/ or avspmod ? => can you preview it successfullly ?
 
PDR.

Yes that all works! I added ConvertToYUY2 at the end. Does that degrade my original footage in any way?

Here is the script i've used now. I used the script on page one, instead of the one a few pages back. Hope it's OK for pal and prores:

LoadPlugin("C:\Program Files\AviSynth 2.6\plugins\QTSource.dll")
LoadPlugin("C:\Program Files\AviSynth 2.6\plugins\TIVTC\TIVTC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.6\plugins\FDecimate\FDecimate.dll")

QTInput("C:\Program Files\AviSynth 2.6\PROCESSING\009.mov")
AssumeTFF()
TFM(mchroma=false, pp=5)
FDecimate(threshold=0.5)
delayaudio(.07)
AssumeFPS(24000,1001)

# Chroma Fix - Optional, but highly recommended
FixBrokenChromaUpsampling()

# Seperates the YUV channels. YV24 seems neccessary for the split and remerge to work.
ConvertToYV24(chromaresample="spline36")
Y = Tweak(sat=0, coring=false)
U = UToY()
V = VToY()

# Shifts the YUV channels individually. In this case subpixel(halfpixel) shifting.
U = U.Spline36Resize(u.width,u.height,0.5,-0.5)
V = V.Spline36Resize(v.width,v.height,0,-0.5)
Y = Y.Spline36Resize(y.width,y.height,0,0.5)

# Manually squeezes the chroma down to 4:2:0 and back. Prevents further shifting.
U = U.Spline36Resize(u.width,u.height/2)
V = V.Spline36Resize(v.width,V.height/2)
U = U.Spline36Resize(u.width,u.height*2)
V = V.Spline36Resize(v.width,v.height*2)

# Recombines individual YUV channels.
YToUV(U,V,Y)

# Depending on the source file you may need to convert from YV24 back to YUY2/YV12.
ConvertToYUY2()
 
PDR.

Yes that all works! I added ConvertToYUY2 at the end. Does that degrade my original footage in any way?

no it doesn't degrade it with adding ConvertToYUY2(), but there are compression lossess (DNxHD is a lossy format, the compression is very similar to ProRes422 - so it would be like incurring 1 round of generation loss - it would be similar to re-encoding prores422 to prores422)

YUY2 is 4:2:2 subsampled Y'CbCr . The chroma fix part of the script is working in YV24 (Y'CbCr 4:4:4) just for intermediate processing. You cannot do a "handshake" in software between 444 => 422 without properly converting it first or if the recieving software has provisions to accept it. In this case ffmpeg cannot "see" Y'CbCr 4:4:4 properly, so you convert it back to YUY2 which is the same sampling as the original Prores422

If you read the 2nd last line of it says "# Depending on the source file you may need to convert from YV24 back to YUY2/YV12." :)

In avisynth anything that is commented out "#" is like a rem statement or doesn't affect the actual processing - they are just meant for comments


If you wanted no compression loss, you would need to use uncompressed (e.g. v210, 10-bit 4:2:2), or a losslessly compressed format like huffyuv. v210 is huge in filesize, many times larger than Prores422.



Can you test it out if huffyuv is compatible with FCP? I don't think the ffmpeg variant of huffyuv is compatible with mac. But at least that would give mac users a losslessly compressed option. For most people, DNxHD 175 will be "good enough" , but if you pixel peep, you can see differences

Code:
for %%a in ("*.avs") do ffmpeg -i %%a -vcodec huffyuv -an %%~na.mov
pause


or if you wanted use -vcodec v210 , which works for sure, but huge filesizes
 
Last edited:
Everyone...
The workflow GH2 -> Ninja -> Avisynth+FFMpeg+DnxHD -> FCP/Mac works!! Got it all working!!
Resulting footage looks perfectly allright to me! But please have a look at the result here and check for me, if there are any dupe frames or other damage: http://mediatube.marvelsfilm.com/GH2_PAL.mov (294 MB)
I didn't worry about the green stripes yet.

Wow!!

Thanks Ralph and PDR for the great help and effort!

Martin
 
Here is a quick and dirty side-by-side comparison. Left AVCHD from camera, right Ninja->AviSynth.
The Avisynth version has elevated levels and there seems to be a small and constant vertical shift, but that can be the compression on the left.

BUT... There is a horrible hickup around the 9 sec. mark. Auch!
Anyone knows what causes this, and what i have to tweak?
Is there an application that i can use to automatically detect these defects? As a kind of quality check?

http://mediatube.marvelsfilm.com/dual_h264.mov (63 MB)

By the way; look at the difference in transitions between colors on the slate !! HDMI rules!


Martin
 
Back
Top