View Full Version : Bug (stuttering) when using QTGMC with Vapoursynth
absence
3rd March 2016, 19:58
I've used QTGMC with AviSynth before, and wanted to try VapourSynth. It seems I've run into a bug, but I have no idea in which component. Here's the source file I used: http://file.meyersproduction.com/hg10/00009.MTS.zip (AVCHD 1080i60)
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.ffms2.Source(source='e:/00009.mts',fpsnum=30000,fpsden=1001) # specify fps manually because ffms2 reports 2x actual fps
clip = haf.QTGMC(clip, Preset='Fast', TFF=True)
clip = clip[0:200]
clip.set_output()
VSPipe.exe test.vpy -y e:\test.y4m
At the beginning of the resulting video, the picture hangs/stutters because a single frame is repeated for a second or so. All components are the latest binaries for 64-bit that I found in various forum threads and on Github.
poisondeathray
3rd March 2016, 20:17
Your clip was shot in "24p" mode. Ie. it's telecined , aka "24p in 59.94i" , aka "3:2 pulldown"
You would need to IVTC to return the original 23.976 fps, not deinterlace
This assumes you're not experiencing other problems with ffms2, which is very buggy with transport streams. That's probably what you're actually referring to with the single frame repeat. So I would try l-smash instead, it's more reliable at least on Windows. Apparently linux versions have problems.
absence
3rd March 2016, 20:46
Thank you. My actual footage isn't telecined, I just picked something that was already online to avoid uploading, and didn't notice. If ffms2 has problems with transport streams, that's probably the cause of the repeated frame. I guess it also explains why it reports the wrong frame rate to begin with. However, when I use L-smash the whole VSPipe process crashes. No Python exception, just the plain "VSPipe.exe has stopped working" message from Windows.
import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()
clip = core.lsmas.LWLibavSource('e:/00009.mts')
clip = haf.QTGMC(clip, Preset='Fast', TFF=True)
clip = clip[0:200]
clip.set_output()
Edit: I also tried LibavSMASHSource, which gives me a Python exception and [importer: Error]: failed to find the matched importer.
poisondeathray
3rd March 2016, 21:18
I'm using older x64 vapoursynth and lsmash (r785) versions - but the actual vspipe to ffmpeg process works for me
However, the output is jerky (ignoring the 3:2 repeats for now), almost like wrong field order fwd/back, or mixed up frames . It suggests both lsmash and ffms2 have problems with your clip (interlaced AVC transport streams are known to cause this). However, the same avisynth version of l-smash , except 32bit, works fine without the order issue.... hmmm....
poisondeathray
3rd March 2016, 21:44
I checked with l-smash r859 x64 for vapoursynth and it works as expected (with the 3:2 repeats, but no additional jerkiness)
Sharc
3rd March 2016, 21:45
Try
LWLibavVideoSource("C:\...path...\00009.MTS")
AssumeTFF()
telecide().tdecimate()
It returns progressive 23.976 fps video
Edit:
Sorry, you want to try vapoursynth .....
but anyway, ffms still has issues with interlaced transport streams.
absence
4th March 2016, 00:48
There's definitely something fishy going on. I tried converting the mts to mkv (ffmpeg fails with an error about unknown timestamps, so I used mkvmerge). Again LWLibavSource crashed, LibavSMASHSource couldn't read it, and ffms2 caused stuttering. I tried converting to mp4, and this time LibavSMASHSource could read it, but there was still stuttering. Only when I decompressed the mts to raw video and read it with vsrawsource, it finally worked. That's very inconvenient though, 20 minutes of raw video takes about 100 GB disk space...
WorBry
4th March 2016, 01:50
Your clip was shot in "24p" mode. Ie. it's telecined , aka "24p in 59.94i" , aka "3:2 pulldown"
You would need to IVTC to return the original 23.976 fps, not deinterlace
Yep, the clip is from a Canon HFG10 recorded in what Canon calls 24PF. Poisondeathray, recall this thread ?
http://forum.doom9.org/showthread.php?t=170018
However, the output is jerky (ignoring the 3:2 repeats for now), almost like wrong field order fwd/back, or mixed up frames . It suggests both lsmash and ffms2 have problems with your clip (interlaced AVC transport streams are known to cause this). However, the same avisynth version of l-smash , except 32bit, works fine without the order issue.... hmmm....
Similar observations with 50i/60i AVCHD.mts clips with regard to field order mix-ups:
http://forum.doom9.org/showthread.php?p=1758595#post1758595
stax76
4th March 2016, 02:56
DGSource works fine btw.
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r'D:\Software\Medien\DGDecNV\DGDecodeNV.dll')
clip = core.dgdecodenv.DGSource(r'D:\Temp\Video\00009 temp files\00009.dgi')
clip = core.vivtc.VFM(clip, 1)
clip = core.vivtc.VDecimate(clip)
clip.set_output()
poisondeathray
4th March 2016, 03:48
Similar observations with 50i/60i AVCHD.mts clips with regard to field order mix-ups:
http://forum.doom9.org/showthread.php?p=1758595#post1758595
Yes I sort of glanced over that previously. But in this clip here, it works with r859, at least for Windows x64 l-smash build.
WorBry
4th March 2016, 04:21
I'm still using r804 with AVISynth i.e. what comes with MeGUI. Haven't tested this clip, but it had no problems with 50i/60i AVCHD.mts clips I looked at:
http://forum.doom9.org/showthread.php?p=1758622#post1758622
The crash problem of L-SMASH-Works does happen with r875, but not with previous r859. So it seems there is a bug introduced in the commits after r859. In the meantime just use r859 until the bug is fixed.
Where can one find these earlier versions to compile for VapourSynth ?
absence
4th March 2016, 11:14
LWLibavSource with r859 does indeed work, and there appears to be no stuttering. It's based on ffmpeg's libavformat however, which has already proven problematic, so I don't know if the result can be trusted to be completely stutter-free. Are there any tools available that can decode AVCHD to raw video or similar that are not based on ffmpeg? That way I could get a "second opinion" and compare. I seem to recall reading about a non-ffmpeg library for transport streams, but for the life of me I can't find it now.
WorBry
4th March 2016, 14:16
Are there any tools available that can decode AVCHD to raw video or similar that are not based on ffmpeg?
For AVISynth, yes - Donald Graft's DGDecIM and DGDecNV:
http://rationalqm.us/mine.html
Both require a nominal license fee.
WorBry
6th March 2016, 02:22
I don't know how to clone from a specific commit via git command. But you can browse the repository at specific commit on github, like https://github.com/VFR-maniac/L-SMASH-Works/tree/58dd7bc1cc18338cb3f634cb3df1147af66f5b3f goes to r859, and use that "Download ZIP" button to get the files.
Thanks.
I managed to compile libvslsmashsource.so from that L-SMASH-Works commit using:
cd L-SMASH-Works/VapourSynth
./configure
make -j$(nproc)
sudo checkinstall --pkgname=vslsmashsource --pkgversion="1:$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)" \
--backup=no --deldoc=yes --delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes --fstrans=no --default
as per:
http://forum.doom9.org/showthread.php?p=1757577#post1757577
There were some warnings during the checkinstall about it not being git, but it appears to load mts files OK without crashing, at least using LWLibavVideoSource.
stax76
6th March 2016, 04:06
For AVISynth, yes - Donald Graft's DGDecIM and DGDecNV:
http://rationalqm.us/mine.html
Both require a nominal license fee.
DGDecNV supports both VapourSynth and AviSynth.
WorBry
6th March 2016, 05:17
DGDecNV supports both VapourSynth and AviSynth.
Sorry, yes, as per your earlier post:
DGSource works fine btw.
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r'D:\Software\Medien\DGDecNV\DGDecodeNV.dll')
clip = core.dgdecodenv.DGSource(r'D:\Temp\Video\00009 temp files\00009.dgi')
clip = core.vivtc.VFM(clip, 1)
clip = core.vivtc.VDecimate(clip)
clip.set_output()
Sm3n
24th September 2016, 16:12
DGSource works fine btw.
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r'D:\Software\Medien\DGDecNV\DGDecodeNV.dll')
clip = core.dgdecodenv.DGSource(r'D:\Temp\Video\00009 temp files\00009.dgi')
clip = core.vivtc.VFM(clip, 1)
clip = core.vivtc.VDecimate(clip)
clip.set_output()
I'm looking for this x64 plugin. It was originaly uploaded here I guess https://forum.doom9.org/showpost.php?p=1739340&postcount=49 unfortunately the link is dead.
cheers
Edit: No need, I am able to load avsplugin, I just replaced "core.dgdecodenv.DGSource" with "core.avs.DGSource"
core.avs.LoadPlugin(path=r'D:\DGDecodeNV.dll')
vid = core.avs.DGSource(dgi=r'D:\0_eng2.dgi')
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.