Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th November 2019, 02:29   #1  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Error: Number of encoded frames does not match the source

Hello,

As I might post in the wrong thread, I decided to post it in here.

I really need any possible help for this one, as I could not understand why I had this error...

The thing is, I have encoded some m2ts file to mp4 with subtitle added. As the file is interlaced, I need to do some deinterlacing using QTGMC and it resulted in a 3 days time encoding, which is totally fine to me, but I could not seem to get it right. At first, everything seemed to work just fine. Until I have this error: Number of encoded frames does not match the source.

I have tried to find this issue online, but it seems that nobody have ever experienced this issue before though.

Does anyone know what is the reason for this error, and how do I fix it? I will put the log under the post.

Thank you in advance.
AceZ666 is offline   Reply With Quote
Old 19th November 2019, 02:33   #2  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Below is the log for my encoding.
Quote:
-[Error] Log for job2 (video, Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~.m2ts.avs -> Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~.m2ts.264)
--[Information] [18/11/2019 11:33:03 PM] Started handling job
--[Information] [18/11/2019 11:33:03 PM] Preprocessing
--[Information] [18/11/2019 11:33:03 PM] AviSynth input script
---[NoImage] LoadPlugin("E:\Encode\Program\MeGUI\MeGUI_2836\tools\lsmash\LSMASHSource.dll")
---[NoImage] LWLibavVideoSource("E:\Encode\Entertainment\Film\Sub\AKB\Takamina\Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~.m2ts")
---[NoImage] #deinterlace
---[NoImage] #crop
---[NoImage] #resize
---[NoImage] #denoise
---[NoImage] Import("C:\Program Files (x86)\AviSynth\plugins\QTGMC.avsi")
---[NoImage] LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\mvtools2.dll")
---[NoImage] LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
---[NoImage] LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\nnedi3.dll")
---[NoImage] LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\RgTools.dll")
---[NoImage] Import("C:\Program Files (x86)\AviSynth\plugins\SMDegrain.avsi")
---[NoImage] Import("C:\Program Files (x86)\AviSynth\plugins\AnimeIVTCmod.avsi")
---[NoImage] Import("C:\Program Files (x86)\AviSynth\plugins\IResize.avsi")
---[NoImage] LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\TDeint.dll")
---[NoImage] AssumeTFF()
---[NoImage] QTGMC(Preset="Slower")
---[NoImage] LoadPlugin("E:\Encode\Program\MeGUI\MeGUI_2836\tools\avisynth_plugin\VSFilter.dll")
---[NoImage] TextSub("E:\Encode\Entertainment\Film\Sub\AKB\Takamina\[S&M][BD] Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~ [1080p].ass", 1)
--[Information] [18/11/2019 11:33:49 PM] resolution: 1920x1080
--[Information] [18/11/2019 11:33:49 PM] frame rate: 60000/1001
--[Information] [18/11/2019 11:33:49 PM] frames: 493920
--[Information] [18/11/2019 11:33:49 PM] length: 02:17:20.232
--[Information] [18/11/2019 11:33:49 PM] aspect ratio (avs): 16:9 (1.778)
--[Information] [18/11/2019 11:33:49 PM] color space: I420
--[Information] [18/11/2019 11:33:49 PM] Job command line: "cmd.exe" /c ""E:\Encode\Program\MeGUI\MeGUI_2836\tools\ffmpeg\ffmpeg.exe" -loglevel level+error -i "E:\Encode\Entertainment\Film\Sub\AKB\Takamina\Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~.m2ts.avs" -strict -1 -f yuv4mpegpipe - | "E:\Encode\Program\MeGUI\MeGUI_2836\tools\x264\x264.exe" --preset slow --crf 18.0 --keyint 599 --bframes 7 --ref 12 --rc-lookahead 60 --me umh --subme 10 --no-fast-pskip --sar 1:1 --frames 493920 --output "E:\Encode\Entertainment\Film\Sub\AKB\Takamina\Takahashi Minami Sotsugyou Tokubetsu Kinen Kouen ~10-nen no Kiseki~.m2ts.264" --stdin y4m -"
--[Information] [18/11/2019 11:33:49 PM] Process started
--[Information] [18/11/2019 11:33:49 PM] Standard output stream
--[Information] [18/11/2019 11:33:49 PM] Standard error stream
---[Information] [18/11/2019 11:35:01 PM] y4m [info]: 1920x1080p 1:1 @ 60000/1001 fps (cfr)
---[Information] [18/11/2019 11:35:02 PM] x264 [info]: using SAR=1/1
---[Information] [18/11/2019 11:35:02 PM] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
---[Information] [18/11/2019 11:35:02 PM] x264 [info]: profile High, level 5.0, 4:2:0, 8-bit
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: frame I:181 Avg QP:17.58 size: 76266
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: frame P:6655 Avg QP:20.35 size: 44686
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: frame B:22451 Avg QP:22.49 size: 14029
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: consecutive B-frames: 3.3% 2.4% 3.5% 31.0% 9.4% 39.7% 4.1% 6.6%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: mb I I16..4: 37.8% 54.7% 7.5%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: mb P I16..4: 14.1% 22.3% 1.0% P16..4: 37.3% 9.3% 6.4% 0.0% 0.0% skip: 9.5%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: mb B I16..4: 1.5% 2.2% 0.1% B16..8: 35.3% 5.8% 1.0% direct: 5.4% skip:48.7% L0:48.2% L1:42.2% BI: 9.7%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: 8x8 transform intra:59.0% inter:78.8%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: direct mvs spatial:100.0% temporal:0.0%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: coded y,uvDC,uvAC intra: 19.4% 46.3% 13.0% inter: 8.6% 19.6% 1.4%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: i16 v,h,dc,p: 48% 20% 9% 23%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 7% 43% 5% 7% 7% 6% 6% 5%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 7% 10% 9% 15% 14% 11% 10% 8%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: i8c dc,h,v,p: 34% 30% 24% 12%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: Weighted P-Frames: Y:9.2% UV:7.3%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: ref P L0: 46.0% 6.7% 17.3% 7.7% 5.6% 4.3% 3.5% 2.1% 1.8% 1.7% 1.5% 1.5% 0.2% 0.0%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: ref B L0: 69.1% 11.2% 6.4% 3.5% 2.6% 2.1% 1.8% 1.2% 1.0% 0.7% 0.4%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: ref B L1: 94.6% 5.4%
---[Information] [19/11/2019 3:29:12 AM] x264 [info]: kb/s:10252.15
---[Information] [19/11/2019 3:29:12 AM] encoded 29287 frames, 2.08 fps, 10252.15 kb/s
--[Error] [19/11/2019 3:29:12 AM] Final statistics
---[Information] [19/11/2019 3:29:12 AM] Constant Quality Mode: Quality 18 computed...
---[Information] [19/11/2019 3:29:12 AM] Video Bitrate Obtained (approximate): 607 kbit/s
---[Error] [19/11/2019 3:29:12 AM] Number of encoded frames does not match the source: 29275/493920
AceZ666 is offline   Reply With Quote
Old 19th November 2019, 10:34   #3  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,664
Your source:

Code:
----[Information] FrameCount: 246960
----[Information] FrameRate: 29.970
----[Information] Duration: 02:17:20.232
----[Information] ScanType: MBAFF
After QTGMC() must be:

Code:
--[Information] [18/11/2019 11:33:49 PM] frame rate: 60000/1001
--[Information] [18/11/2019 11:33:49 PM] frames: 493920
--[Information] [18/11/2019 11:33:49 PM] length: 02:17:20.232
If you only get:
Code:
---[Information] [19/11/2019 3:29:12 AM] encoded 29287 frames, 2.08 fps, 10252.15 kb/s
maybe there are a decoder crash at that point.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 19th November 2019, 11:16   #4  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Quote:
Originally Posted by tebasuna51 View Post
Your source:

Code:
----[Information] FrameCount: 246960
----[Information] FrameRate: 29.970
----[Information] Duration: 02:17:20.232
----[Information] ScanType: MBAFF
After QTGMC() must be:

Code:
--[Information] [18/11/2019 11:33:49 PM] frame rate: 60000/1001
--[Information] [18/11/2019 11:33:49 PM] frames: 493920
--[Information] [18/11/2019 11:33:49 PM] length: 02:17:20.232
If you only get:
Code:
---[Information] [19/11/2019 3:29:12 AM] encoded 29287 frames, 2.08 fps, 10252.15 kb/s
maybe there are a decoder crash at that point.
Thank you very much for your reply.
If that is the case, then what should I do to fix this issue? Should I change the decoder, or change the code?
AceZ666 is offline   Reply With Quote
Old 19th November 2019, 11:31   #5  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
I'm currently using L-MASH to decode my video. Should I change to FFMS or Direct Show Source?
AceZ666 is offline   Reply With Quote
Old 19th November 2019, 12:08   #6  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
Does it always stop at the same point?

You could also try installing the latest Avisynth+ to see if it works better.
https://github.com/AviSynth/AviSynthPlus/releases
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 19th November 2019, 23:02   #7  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Quote:
Originally Posted by Boulder View Post
Does it always stop at the same point?

You could also try installing the latest Avisynth+ to see if it works better.
https://github.com/AviSynth/AviSynthPlus/releases
It always stops at around 3k frames, so I should upgrade Avisynth?

But what is the main reason for this issue to occur? I've been trying to find it for a considerate amount of time...
AceZ666 is offline   Reply With Quote
Old 20th November 2019, 08:22   #8  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 621
First things first, I would not recommend using QTGMC with such a long input in one shot. 493920 frames at 2.08 fps is 2.75 days, and anything could go wrong.

If I'm doing this, I'd split the video into multiple chunks (multiple AVS with Trim()s), run QTGMC without textsub, and encode to lossless avi (lagarith) or visually lossless 264 (--qp 6 for example), then join them together and put your subtitle on for the final encode. This not only gives you a much better error tolerance (only need to redo from save point), it also allows you to encode multiple chunks in parallel, if you have CPU resource to spare.

Also you definitely want to try AviSynth+.
MeteorRain is offline   Reply With Quote
Old 20th November 2019, 11:33   #9  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Quote:
Originally Posted by MeteorRain View Post
First things first, I would not recommend using QTGMC with such a long input in one shot. 493920 frames at 2.08 fps is 2.75 days, and anything could go wrong.

If I'm doing this, I'd split the video into multiple chunks (multiple AVS with Trim()s), run QTGMC without textsub, and encode to lossless avi (lagarith) or visually lossless 264 (--qp 6 for example), then join them together and put your subtitle on for the final encode. This not only gives you a much better error tolerance (only need to redo from save point), it also allows you to encode multiple chunks in parallel, if you have CPU resource to spare.

Also you definitely want to try AviSynth+.
I understand, guess that I will have to do it that way as it does not seem to go pass 20k frames though.

But I still wonder what is the main reason to cause this issue? Like tebasuna51 said above, it might be because of a decoder crash, so is there any way to prevent it?
AceZ666 is offline   Reply With Quote
Old 20th November 2019, 12:24   #10  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,636
Quote:
Originally Posted by AceZ666 View Post
It always stops at around 3k frames, so I should upgrade Avisynth?

But what is the main reason for this issue to occur? I've been trying to find it for a considerate amount of time...
The old Avisynth is nearly not as stable as Avisynth+ so a complex function like QTGMC may easily cause crashes. I don't know if MeGUI utilizes any multithreading, Avisynth+ also has that part covered.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 20th November 2019, 15:29   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,266
Did you check system logs, Computer Management/Event Viewer/windows Logs/Application.
May be something in there that did not propagate up to MeGUI log. [check against stop time of MeGUI log]

EDIT: Also peek at other logs eg System too.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 20th November 2019 at 15:44.
StainlessS is offline   Reply With Quote
Old 21st November 2019, 02:40   #12  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Quote:
Originally Posted by Boulder View Post
The old Avisynth is nearly not as stable as Avisynth+ so a complex function like QTGMC may easily cause crashes. I don't know if MeGUI utilizes any multithreading, Avisynth+ also has that part covered.
I just installed avisynth+ and it does seem to be much faster, yet the problem is still there.

Quote:
Originally Posted by StainlessS View Post
Did you check system logs, Computer Management/Event Viewer/windows Logs/Application.
May be something in there that did not propagate up to MeGUI log. [check against stop time of MeGUI log]

EDIT: Also peek at other logs eg System too.
I took a look to the system log and it seems the problem was not coming from QTGMC at all. It reported with the error: 0xc0000005 that were coming from my ffmpeg.exe and VSFilter.dll.

So should I replace these two? Or there is no other way to resolve this...
AceZ666 is offline   Reply With Quote
Old 21st November 2019, 04:42   #13  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,266
Error 0xc0000005 is Access Violation, error in code somewhere, can happen where eg trying to read data from a memory pointer of 0.
Not 100% certain that problem resides in ffmpeg or VSFilter, but are most suspect culprits (VSFilter is favourite suspect).
Try with alternative VSFilter if possible (I have experienced bad versions of VsFilter with crashes, some versions are described as depricated or bugged),
or use some other subtitler.

EDIT: Here Pinterf version VSFilter from 2018, I have not tried it before(was not aware of it):- https://github.com/pinterf/xy-VSFilt.../tag/3.2.0.802
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 21st November 2019 at 05:03.
StainlessS is offline   Reply With Quote
Old 21st November 2019, 05:54   #14  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,293
Quote:
Originally Posted by MeteorRain View Post
First things first, I would not recommend using QTGMC with such a long input in one shot. 493920 frames at 2.08 fps is 2.75 days, and anything could go wrong.

If I'm doing this, I'd split the video into multiple chunks (multiple AVS with Trim()s), run QTGMC without textsub, and encode to lossless avi (lagarith) or visually lossless 264 (--qp 6 for example), then join them together and put your subtitle on for the final encode. This not only gives you a much better error tolerance (only need to redo from save point), it also allows you to encode multiple chunks in parallel, if you have CPU resource to spare.

Also you definitely want to try AviSynth+.
and instead of lossless mpp can be used if there are enough of ram
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 22nd November 2019, 05:55   #15  |  Link
AceZ666
Registered User
 
Join Date: Oct 2019
Posts: 10
Quote:
Originally Posted by StainlessS View Post
Error 0xc0000005 is Access Violation, error in code somewhere, can happen where eg trying to read data from a memory pointer of 0.
Not 100% certain that problem resides in ffmpeg or VSFilter, but are most suspect culprits (VSFilter is favourite suspect).
Try with alternative VSFilter if possible (I have experienced bad versions of VsFilter with crashes, some versions are described as depricated or bugged),
or use some other subtitler.

EDIT: Here Pinterf version VSFilter from 2018, I have not tried it before(was not aware of it):- https://github.com/pinterf/xy-VSFilt.../tag/3.2.0.802
it seems that the issue does come from my VSFilter, as when I tried with a different version of it, everything worked like a charm!

Thank you very much for your help, as well as all the helps I got.

Thank you very much!!!!
AceZ666 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.