Log in

View Full Version : Troubles with DirectShowSource and MTS


wqcr
24th April 2013, 06:49
Hello,
for the last 7 days I've been trying to convert 1080i MTS video to 720p@50fps using Avisynth+QTGMC. Everything works fine but the resulting clip sort of "lags" at the beginning and on the end. At first I thought it is caused by ffdshow, so I switched to CoreAVC, but the problem persisted, even with Skip deblocking is selected.
This is the script I use:


Directshowsource("00083.mts")
AssumeTFF
QTGMC( preset="very fast" )
Spline36Resize(1280, 720)


Converting procedure: load AVS into Virtualdub, select Fast Recompress, output codec Lagarith and Save AVI
As MT 2.6 QTGMC version is inefficient on my CPU, I try to run two instances of VDub with the source video splitted into two parts, so any kind of "lags" that would appear only on the beginning and on the end are now in the middle of the clip.

Is there any way how to fix those "lags"?
I've already tried DSS2, but with no reasonable results (VBR>CBR). Perhaps how to completely avoid DirectShowSource when loading MTS files to Avisynth?

Thanks!
PS: Link to the resulting clip (xvid mpeg4): link (https://dl.dropboxusercontent.com/u/3664253/photo/avs2.rar)

wqcr
24th April 2013, 14:39
OK, I got it to work somehow using DGAVCDec (oldie, but goodie, thanks Neuron2) and AVCSource.
A bit of warning though, DGAVCDec probably doesn't support MTS files, so you need to demux them to TS (with TSMuxer). Then you load your TS file to DGAVCIndex, save project, call the project file from Avisynth script and voila! It works, even with seeking. But it's truly tedious work, so I am still open for better solution.

Edit: False alarm, it does not work well, DGAVCDec introduced some artefacts to the video

Selur
24th April 2013, 17:32
Have you tried FFVideoSource ?

wqcr
24th April 2013, 20:17
Have you tried FFVideoSource ?
Yes and it was the worst actually. The clip "lagged" for the entire length and FFMpeg through Virtualdub even reported "Seeking is severely broken".

wqcr
27th April 2013, 08:25
I believe I've located the problem - AVISYNTH and VIRTUALDUB. Both are unable to decode properly using directshowsource. Video Enhancer used the same set of Directshow plugins and no problems, unfortunately it generates some "weird" avis that Virtualdub report with error and is unable to resave them.
So my thought of a workaround - use ffdshow video decoder and apply the avisynth script through it, then use VfW enabled converter to decode MTS through directshow and convert it to Matrox MPEG2 iFrame AVI

Now it breaks down - can anybody please recommend me some VfW enabled video converter that can import through directshow?

What puzzles me though, AVCHD (MTS) is one of the most widespread formats for semi-pro and consumer use. After 7 years of AVCHD existence I cannot believe that the only way to import it to Avisynth is through DSS. MPEG-2 has similar frame sequence, yet it is no problem to load it (mpeg2source). Perhaps I am doing something wrong as this topic is not much discussed, like the only one who has difficulties importing MTS is me.

Selur
27th April 2013, 09:03
After 7 years of AVCHD existence I cannot believe that the only way to import it to Avisynth is through DSS.
Normally FFVideoSource, LWLibavVideoSource, DGDecNV and if the video stream is MPEG-2, DGDecode should also work.

wqcr
28th April 2013, 07:02
Normally FFVideoSource, LWLibavVideoSource, DGDecNV and if the video stream is MPEG-2, DGDecode should also work.

LWLibavVideoSource is finally working well (even audio is synced)! Thanks, Selur for your suggestions. ;)