Well that's interesting! return(vid1) plays as normal, but vid2 and vid3 just displays the last frame of the video, so that explains the silence.. as that last frame that plays for another 44 minutes is mute. Very strange.
Ah i see, that's sorted it now. Playing back in MPC-HC sync is fine, still goes mute at the moment TFM was applied and stays like that, as before.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 60 of 64
Thread
-
-
If you play
AVISource("F:\Video Clip.avi")
TFM()
Is it "mute?"
Something is wrong with your vid2 and vid3, perhaps the frame number references, or the video itself - maybe seek problems with AVISource . What kind of AVI is it ? What does mediainfo say about it ?
(And a 10x speedup for AVS classic MT x86 , vs. AVS+ MT x64 is "not typical" ; likely there were other issues, such as memory bottlenecks, caching, page file . In the absence of bottlenecks you might expect ~20-50% faster . Still faster, but not 1000% faster) -
My guess is he derived the trim values looking at a QTGMC'd version of the video (which has twice as many frames). But the trims are made on the source video. So all the trims after the first are beyond the end of the source video. Hence the single frame, the last frame of the video. That is why I asked how many frames there are in v.
-
It's not mute, but the sound is failing to keep up with the video, going very stuttery, almost like it might be a problem with the video itself. The original source is MP4 but i converted it to Lagarith Lossless AVI in Virtualdub to get the video to load properly in Avisynth. Though it always renders and plays fine with just QTGMC on, but still had to trim out the frozen frame problem at the end. Perhaps i'd get better results without decompressing the video and loading the original MP4, i just got used to using AVISource i guess, as it seemed easier to work with. Having played the AVI file back it plays twice as fast whilst the sound plays normal before the video stops midway through and sound continues.. so that's what has been causing all the issues i think.
Tried loading the original MP4 using LSmash, and no more end of frame problem, the video ends where it should, but all sound is mute now. How do i enable the audio?
Code:SetFilterMTMode("DEFAULT_MT_MODE", 2) v = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4") LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") vid1 = v.trim(0,119200).AssumeTFF().AssumeFPS(25).yadifmod2(order=1, mode=1) vid2 = v.trim(119201,120637).AssumeTFF().AssumeFPS(25).TFM(pp=0).ChangeFPS(50) vid3 = v.trim(120638,132580).AssumeTFF().AssumeFPS(25).yadifmod2(order=1, mode=1) vid1 ++ vid2 ++ vid3 Prefetch(5)
-
You can use AudioDub()
eg.
Code:SetFilterMTMode("DEFAULT_MT_MODE", 2) vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4") aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") v = AudioDub(vid,aud) vid1 = v.trim(0,119200).AssumeTFF().AssumeFPS(25).yadifmod2(order=1, mode=1) vid2 = v.trim(119201,120637).AssumeTFF().AssumeFPS(25).TFM(pp=0).ChangeFPS(50) vid3 = v.trim(120638,132580).AssumeTFF().AssumeFPS(25).yadifmod2(order=1, mode=1) vid1 ++ vid2 ++ vid3 Prefetch(5)
-
-
Does original go out of sync ? Ignore what it looks like
Code:vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4") aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") AudioDub(vid,aud)
-
The video is playing very speedy now, but sound is playing at normal speed.
-
We already know that LSMASHVideoSource() misinterprets the field rate as the frame rate. Just add .AssumeFPS(25) at the end of the first line.
-
-
The video rendered all 44 minutes, but then just froze on the batch file, so never finalised itself, thus no encoded file at the end.
-
I don't know why your encoding locked up but... 44 minutes at 25 fps is 66000 frames. As I suspected, your trim numbers are all wrong.
-
Well the encode keeps freezing up at frame 133293, which i assume is the maximum number of frames of the video (accounting for becoming 50 progressive frames to emulate the smooth playback of simultaneous interlaced fields) No idea were to put the trims to apply the TFM, as it corresponds far beyond the number of frames in the AvsPmod preview, about frame 238180.
Curiously AvsPmod reports it being 1 hour and 28 minutes long, when the video is only 44 minutes long.Last edited by Master Tape; 22nd Jan 2020 at 10:38.
-
Is the original video ok as decoded by Lsmash? Check return v . Seek in mpchc or avspmod. Check the framecount
Code:vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4").AssumeFPS(25) aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") AudioDub(vid,aud)
https://github.com/HolyWu/L-SMASH-Works/releases
You can see the frame numbers in avspmod in the status bar (current and total). Check each part individually for framecount. Seek to each part individually. You don't have to waste time encoding anything (preview in avspmod or mpchc) . If the script is ok, then maybe something else is wrong like the encoder (I doubt it)
Do a new set of trims. Add the Trims afterwards @50fps so you know exactly what you're getting
Code:SetFilterMTMode("DEFAULT_MT_MODE", 2) vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4").AssumeFPS(25) aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") v = AudioDub(vid,aud) vid1 = v.yadifmod2(order=1, mode=1) vid2 = v.TFM(pp=0).ChangeFPS(50) vid1.trim(start1,end1) ++ vid2.trim(start2,end2) ++ vid3.trim(start3,end3) Prefetch(5)
"vid2" is a TFM version then duplicated frames .
use return vid1 to get the reference frame numbers for your trims for start1,end1 , start3, end3 (replace those with the actual values)
use return vid2 to get the reference frame numbers for your trims for start2,end2 (replace those with the actual values)
If it's ok in avspmod or mpchc, change yadifmod2 with qtgmc and encode -
Total framecount is 13305.
Are you using current lsmash version ? some older versions might have problems
https://github.com/HolyWu/L-SMASH-Works/releases
You can see the frame numbers in avspmod in the status bar (current and total). Check each part individually for framecount. Seek to each part individually. You don't have to waste time encoding anything (preview in avspmod or mpchc) . If the script is ok, then maybe something else is wrong like the encoder (I doubt it)
Do a new set of trims. Add the Trims afterwards @50fps so you know exactly what you're getting
Code:SetFilterMTMode("DEFAULT_MT_MODE", 2) vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4").AssumeFPS(25) aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") v = AudioDub(vid,aud) vid1 = v.yadifmod2(order=1, mode=1) vid2 = v.TFM(pp=0).ChangeFPS(50) vid1.trim(start1,end1) ++ vid2.trim(start2,end2) ++ vid3.trim(start3,end3) Prefetch(5)
"vid2" is a TFM version then duplicated frames .
use return vid1 to get the reference frame numbers for your trims for start1,end1 , start3, end3 (replace those with the actual values)
use return vid2 to get the reference frame numbers for your trims for start2,end2 (replace those with the actual values)
If it's ok in avspmod or mpchc, change yadifmod2 with qtgmc and encode
Code:SetFilterMTMode("DEFAULT_MT_MODE", 2) vid = LSMASHVideoSource("F:\HDD\New Volume\150914-2138.mp4").AssumeFPS(25) aud = LSMASHAudioSource("F:\HDD\New Volume\150914-2138.mp4") v = AudioDub(vid,aud) vid1 = v.yadifmod2(order=1, mode=1) vid2 = v.TFM(pp=0).ChangeFPS(50) vid1.trim(0,237937) ++ vid2.trim(238285,240660) ++ vid3.trim(240710,264590) Prefetch(5)
-
Yes,
vid1.trim(0,237937) ++ vid2.trim(238285,240660) ++ vid1.trim(240710,264590) -
Video is out of sync with audio. There must be some sort of glitch being caused somehow. The audio plays for it's actual duration, but somehow the video plays for 1 hour 28 minutes, without looking too abnormal. Very odd.
-
Is that with QTGMC ? or yadifmod2 ? Slow hardware can cause the preview to go out of sync, but if script is ok, encode should be ok
what about vid1 and vid2 each separately ? out of sync ? What about with each with the trims ? -
Ok here's a new one.. A new video i'm working on has a presenter infront of a CGI background (green screen) and the background shimmers like mad when i apply QTGMC of course. I've tried TFM(pp=0) and then apply ChangeFPS(50) whilst this gets rid of the shimmer, the presenter isn't in full smooth motion, you get with 50 frames. How can you deal with an image that both has an interlaced and progressive source? without having to compromise one over the other?
-
Normally QTGMC() deals with that. I need a sample of the source video to see what's going on.
-
The background in that video has already been deinterlaced with a duplicate-field algorithm (or was just created that way). That is, the CGI background is really a 720x288 image doubled in height with a point resize. If you watched it on an interlaced TV it would bounce up and down like that too. So QTGMC is essentially duplicating what you would see on a CRT. Off the top of my head -- you might overlay a simple frame dup with a QTGMC where there are comb artifacts. I'll have to think about other fixes...
<edit>
Basicall, I just overlaid QTGMC where there is motion between frames. There's also something screwy with the chroma, hence the PointResize and nnedi3:
Code:########################################################################## # # Abs(v1-v2) # # Y channel only # Works for YUV only # ########################################################################## function AbsSubtract(clip v1, clip v2) { Subtract(v1, v2).ColorYUV(off_y=2) Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add") } ########################################################################## Mpeg2Source("VTS_01_2.demuxed.d2v", CPU2="ooooxx", Info=3) # mask of areas where there's motion between frames: diff = AbsSubtract(last, Trim(1,0)).mt_binarize(10).mt_expand(chroma="-128").Blur(1.0).SelectEvery(1,0,0) # double frame rate by duplication of one field dup = PointResize(width, height/2).nnedi3(dh=true).SelectEvery(1,0,0) # overlay QTGMC where there's motion Overlay(dup, QTGMC(), mask=diff)
</edit>Last edited by jagabo; 2nd Sep 2020 at 18:44.
-
My guess is "last" is undefined at that point in the script (as with all functions, Trim() assumes last if a named stream isn't specified). Post your entire script.
-
Code:
########################################################################## # # Abs(v1-v2) # # Y channel only # Works for YUV only # ########################################################################## function AbsSubtract(clip v1, clip v2) { Subtract(v1, v2).ColorYUV(off_y=2) Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add") } ########################################################################## vid = Mpeg2Source("F:\A Video Files\DVD Rips\Video.d2v", CPU2="ooooxx", Info=3) # mask of areas where there's motion between frames: diff = AbsSubtract(last, Trim(1,0)).mt_binarize(10).mt_expand(chroma="-128").Blur(1.0).SelectEvery(1,0,0) # double frame rate by duplication of one field dup = PointResize(width, height/2).nnedi3(dh=true).SelectEvery(1,0,0) # overlay QTGMC where there's motion Overlay(dup, QTGMC(), mask=diff) aud = FFAudioSource("F:\A Video Files\DVD Rips\Audio.mp2") AudioDub(vid, aud) DelayAudio(-0.192) Crop(0,0,-6,-4) Trim(34888,35555)
-
As I suspected your source is named vid, not last. And later you are implicitly using an undefined last, tossing out the filtered video and reverting to the original input. One way to fix the script is:
Code:########################################################################## # # Abs(v1-v2) # # Y channel only # Works for YUV only # ########################################################################## function AbsSubtract(clip v1, clip v2) { Subtract(v1, v2).ColorYUV(off_y=2) Overlay(last.ColorYUV(off_y=-128), last.Invert().ColorYUV(off_y=-127), mode="add") } ########################################################################## # note: vid= is gone Mpeg2Source("F:\A Video Files\DVD Rips\Video.d2v", CPU2="ooooxx", Info=3) # the input video is now implicitly named last # mask of areas where there's motion between frames: diff = AbsSubtract(last, Trim(1,0)).mt_binarize(10).mt_expand(chroma="-128").Blur(1.0).SelectEvery(1,0,0) # double frame rate by duplication of one field dup = PointResize(width, height/2).nnedi3(dh=true).SelectEvery(1,0,0) # overlay QTGMC where there's motion Overlay(dup, QTGMC(), mask=diff) aud = FFAudioSource("F:\A Video Files\DVD Rips\Audio.mp2") AudioDub(last, aud) DelayAudio(-0.192) Crop(0,0,-6,-4) Trim(34888,35555)
Code:Mpeg2Source("F:\A Video Files\DVD Rips\Video.d2v", CPU2="ooooxx", Info=3) diff = AbsSubtract(last, Trim(1,0)).mt_binarize(10).mt_expand(chroma="-128").Blur(1.0).SelectEvery(1,0,0)
Code:last = Mpeg2Source("F:\A Video Files\DVD Rips\Video.d2v", CPU2="ooooxx", Info=3) diff = AbsSubtract(last, last.Trim(1,0)).mt_binarize(10).mt_expand(chroma="-128").Blur(1.0).SelectEvery(1,0,0)
Similar Threads
-
Removing aliasing/shimmering from vertical objects?
By Master Tape in forum RestorationReplies: 9Last Post: 19th Dec 2019, 12:17 -
Encoding Problem
By m00511 in forum Newbie / General discussionsReplies: 2Last Post: 18th Dec 2018, 07:44 -
x264 encoding problem
By umbie in forum Video ConversionReplies: 20Last Post: 18th Nov 2018, 04:32 -
Encoding Problem
By m00511 in forum Newbie / General discussionsReplies: 13Last Post: 20th Jul 2018, 08:50 -
x264vfw - problem with encoding
By Colek in forum Video ConversionReplies: 3Last Post: 13th Sep 2015, 04:19