PDA

View Full Version : AVCSource() + HD input = artifacts


florinandrei
12th July 2008, 03:38
As an HD source, I use AVCHD files made by a Canon HF100 (http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&fcategoryid=177&modelid=16187) camera, NTSC version. No processing is applied to these files prior to feeding them to AviSynth, they are downloaded straight from the camera's SDHC flash card. The camera is configured for maximum quality (up to 17 Mbps) 1080i. It is actually configured with a pretty mild gamma curve ("Cinema" mode) which reduces the noise and eases the load on the encoder.

Here's an AVCHD file:

https://dl.getdropbox.com/u/29966/00002.MTS

The .avs script is very simple:

AVCSource("test.dga")

I'm using AviSynth 2.5.7 and dgavcdec100a26 on Windows XP SP3. The system is Core 2 Duo 5200.

These are the commands I'm running:

del test.dga
C:\Progra~1\DGAVCIndex\DGAVCIndex.exe -i 00002.MTS -o test.dga -e
del test-hc.log
del test.m2v
C:\Progra~1\HCenc\HCenc.exe -ini test-HC.ini -i test.avs -o test.m2v -log test-hc.log -frames all

HCenc is version 0.23. The test-HC.ini file is:

*AUTOGOP 15
*CQ 5.000
*INTERLACED
*NOSCD
*MATRIX mpeg
*PRIORITY normal
*WAIT 1

This is the MPEG2 file generated:

https://dl.getdropbox.com/u/29966/test.m2v

Watch the window frame in the right-hand side of the image, especially towards the end of the clip, and also the bush under the window. There's brief but extensive artifacting that is not present in the master AVCHD file (I verified it on a PS3 and HD screen and it looks perfect).

If I need to do other tests let me know.

I may try to shoot more footage for testing but I'm not sure what are the conditions that make it more likely for this issue to appear.

Yoshiyuki Blade
12th July 2008, 03:44
Coincidentally, I just now sent neuron2 a PM regarding what seems to be the exact same issue. I'm convinced that it may be an issue with DGAVCIndex.

Blue_MiSfit
12th July 2008, 03:49
hmm... could be an issue with libavcodec not properly decoding all forms of interlaced AVC... You might have to use DirectShowSource with CoreAVC, since IIRC it handles all types of interlaced content correctly.

~MiSfit

florinandrei
12th July 2008, 03:57
hmm... could be an issue with libavcodec not properly decoding all forms of interlaced AVC... You might have to use DirectShowSource with CoreAVC, since IIRC it handles all types of interlaced content correctly.

I tried DirectShowSource and it has a problem - HCenc just hangs for a very long time at the end of the file. I have no idea which codec is actually called by DirectShowSource, I've a bunch of crap installed on that machine.
How do I tell DirectShowSource to use a specific codec for a specific type of material?

I will try your suggestion but at the same time it would be great to fix any issues that might occur with AVCSource.

Oh, BTW - you said it uses libavcodec. Well, IIRC ffmpeg (actually ffplay) is based on the same library, right? Well, ffplay does have some issues when playing AVCHD files, but I can't tell what is the cause. It could be the decoding library. It "almost" plays the files, but pretty badly.

EDIT: Windows Media Player hangs too at the end of the file. It's clearly a codec issue.

Yoshiyuki Blade
12th July 2008, 04:22
I don't think its a problem with the decoding process, as the artifacts appear once you index the file, and look through it in virtualdub.

EDIT: I re-read what you said, and actually, directshowsource looks to be working well. So everything seems to suggest that DGAVCIndex is causing these artifacting problems :eek:.

neuron2
12th July 2008, 05:25
I don't think its a problem with the decoding process, as the artifacts appear once you index the file, and look through it in virtualdub. I'll look at your sources, but it's almost certainly a problem with libavcodec. The reason you don't see it in DGAVCIndex but only when served via DGAVCDecode is that the artifacts affect only one field, and that field is discarded for display in DGAVCIndex to get half height for display.

I'll investigate and see if more recent versions of libavcodec do better, and whether the developers have any plans to address this annoying issue.

Yoshiyuki Blade
12th July 2008, 05:27
I'll look at your sources, but it's almost certainly a problem with libavcodec. The reason you don't see it in DGAVCIndex but only when served via DGAVCDecode is that the artifacts affect only one field, and that field is discarded for display in DGAVCIndex to get half height for display.

I'll investigate and see if more recent versions of libavcodec do better, and whether the developers have any plans to address this annoying issue.

Ah i see. Thanks for being informative as always, neuron2 :D. I forgot that libavcodec is involved with the decoding process.

Blue_MiSfit
12th July 2008, 07:49
There ya go - and ffmpegsource, and ffplay, and ffdshow, and vlc etc... :)

~MiSfit

florinandrei
12th July 2008, 09:16
There ya go - and ffmpegsource, and ffplay, and ffdshow, and vlc etc... :)

Yes. In fact, on Linux I am limited to open source software to play AVCHD, and as a consequence I don't have any reliable player for this type of material, because everyone either uses the same libraries, or don't support this format at all. :mad:

Blue_MiSfit
12th July 2008, 21:27
I *think* CoreAVC does support this. So, you could theoretically get WINE running, install CoreAVC and Media Player Classic.

Theoretically :)

WINE is not exactly simple..

~MiSfit