Log in

View Full Version : Getting square block artefacts while encoding


Arshad07
2nd December 2013, 11:54
Hello there,

I'm trying to encode TV caps, but the initial seconds of the output have got some artefacts which I don't know how to fix.

AVS Script

LoadPlugin("G:\xxx\directshowsource.dll")
DirectShowSource("G:\xxx.mkv", fps=25.000, audio=false, convertfps=true).AssumeFPS(25,1)
Load_Stdcall_Plugin("G:\xxx\yadif\yadif.dll")
Yadif(mode=1, order=1)
Spline64Resize(1280,720) # Spline64 (Sharp)
LoadPlugin("G:\xxx\avisynth_plugin\VSFilter.dll")
TextSub("C:\xxx\logo.ass", 1)

I'm encoding to 50fps by using Yadif with Bob. It happens with both LAV and ffdshow decoder.

Few examples:-

http://i.imgur.com/sTLKX7M.png
http://i.imgur.com/VccpZ6g.png
Sample:-
https://www.mediafire.com/?xnx1zuaeun6lnab


Any help is much appreciated.
Thank you.

feisty2
2nd December 2013, 12:21
your caps are already broken, I don't think there's any filter can remove artifacts like this
[edit]maybe the source is not damaged, probably just because of dss, change a source filter

Arshad07
2nd December 2013, 12:38
your caps are already broken, I don't think there's any filter can remove artifacts like this
[edit]maybe the source is not damaged, probably just because of dss, change a source filter

It's not present in the original caps.

feisty2
2nd December 2013, 12:43
It's not present in the original caps.

then it makes sense, typical dss error, use ffms2 instead

Arshad07
2nd December 2013, 13:15
then it makes sense, typical dss error, use ffms2 instead

How do I use that?

Thank you for your help.

feisty2
2nd December 2013, 13:22
How do I use that?

Thank you for your help.
http://avisynth.nl/index.php/FFmpegSource
ffvideosource ("xxxx")

Arshad07
2nd December 2013, 13:27
http://avisynth.nl/index.php/FFmpegSource
ffvideosource ("xxxx")

It worked thank you but, i have frame issues now :(

Sample

https://www.mediafire.com/?pfmy5cgdq73nb1r

Script

LoadPlugin("G:\xxx\tools\ffms\ffms2.dll")
FFVideoSource("G:\xxx.ts", threads=1)
Load_Stdcall_Plugin("G:\xxx\tools\yadif\yadif.dll")
Yadif(mode=1, order=1)
Spline64Resize(1280,720) # Spline64 (Sharp)

feisty2
2nd December 2013, 13:32
It worked thank you but, i have frame issues now :(

Sample

https://www.mediafire.com/?pfmy5cgdq73nb1r

Script

if your source is h264 interlaced ts, use dgnv
or

FFIndex("xxx.ts", demuxer="lavf")
FFVideoSource("xxx.ts", seekmode=-1, threads=1).selecteven ()

Arshad07
2nd December 2013, 13:48
if your source is h264 interlaced ts, use dgnv
or

FFIndex("xxx.ts", demuxer="lavf")
FFVideoSource("xxx.ts", seekmode=-1, threads=1).selecteven ()


DGNV is neuron's work right? I completely forgot and I dont have Nvidia card.

I'm trying the other method, but it's crashing MeGui.

feisty2
2nd December 2013, 13:54
DGNV is neuron's work right? I completely forgot and I dont have Nvidia card.

I'm trying the other method, but it's crashing MeGui.

I donno why megui crashes, I never used megui
maybe you can run "FFIndex (xxxx)" in ffmpeg and get the .ffindex file and then run the latter one in megui
[edit]if ffmpeg still crashes, use LWLibAVVideoSource

Arshad07
7th December 2013, 01:39
Update:

Source Sample

https://www.mediafire.com/?70yhvzphyj34a2s

Encode

http://www.mediafire.com/download/4m0sah172j55ple/sample.ts.mkv

Script


LoadPlugin("xxx\tools\ffms\ffms2.dll")
FFVideoSource("xxx.ts", seekmode=-1,threads=1).selecteven()
Load_Stdcall_Plugin("xxx\tools\yadif\yadif.dll")
Yadif(mode=1, order=1)
Spline64Resize(1280,720) # Spline64 (Sharp)


What am i doing wrong?

Thank you in advance.

Guest
7th December 2013, 02:28
What am i doing wrong? It seems ffms2 is having problems with some interlaced AVC streams. You could file a bug report and hope for a fix, but I think the problem has been known a fairly long time now already.

You can get a cheap VP5-based card and run it as a secondary adapter giving you support for CUVID. If I remember correctly you can do it even with an AMD primary adapter. (Can anyone confirm that?) Then you could run DGNV and get reliable frame-accurate decoding of these streams.

turbojet
7th December 2013, 02:51
Half the frames are being removed with selecteven() before deinterlacing. Move it to after yadif() but if speed isn't much of a factor you may want to try nnedi3() instead no need to use selecteven and the quality is much nicer to look at. If it's sports you may want to consider 50fps, yadif without the selecteven or nnedi3(field=-2).

As for source filter, with ts files the only ones that were reliable in my tests are the aforementioned lwlibavvideosource, dgnvsource and dss2mod (https://code.google.com/p/xvid4psp/downloads/detail?name=DSS2%20mod%20%2B%20LAVFilters.7z&can=2&q=) with preroll=50+. ffms2() has interlaced issues and rarely detects proper framerate. dss() can create sync issues as can dss2 and dss2mod without preroll.