This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] Interlaced files encoded lossless, muxed with mencoder in AVI, are 10% shorter
#1
The bug in few words:
- interlaced files encoded with lossless video codecs muxed with mencoder in AVI, gives 10% skipped frames, so 10% shorter duration (this also destroys the sound).
This bug occurs only with (in parenthesis when the bug doesn't occur):
- interlaced files (but not with progressive files)
- encoded with lossless video codecs like FFV1, UT Video, FFvHuff (but not with lossy codecs like x264)
- muxing to AVI container (but not with muxing to MKV container; for muxing to MKV, mkvmerge is used instead of mencoder)
- muxing using mencoder (but not with muxing using ffmpeg)
Temporary fix, for the users of Hybrid, until this bug is fixed:
- replace mencoder with ffmpeg, for muxing to AVI (Config > Containers > Avi Settings: "Always use ffmpeg for muxing" ... to be selected/checked).
or
- use MKV instead of AVI to mux with the default mencoder, then (if AVI is needed instead of MKV, for example Premiere Pro doesn't import MKV files) remux/transcode from MKV to AVI using Avidemux or Video Container Changer, both free softwares.
This bug occurs also with the latest version of mencoder (r38407) which I downloaded (version released after the latest version of Hybrid which uses mencoder r38359).
If the bug comes solely from mencoder.exe, then why to not make ffmpeg default (instead of mencoder) for muxing to AVI, in the future versions of Hybrid ?
Bug in more words:
- in these output AVI files the duration is 10% shorter, example: 54 seconds, while if the output is MKV the duration is the same as the original M2TS file: 1 minute.
- the bug occurs at step: "creating avi file with mencoder" when the progress reach 90%, instead to continue until 100% (like: 91%, 92% ... 99%, 100%), it jumps to the next step.
- the debug file shows lines "Skipping frame", 1 in 10 frames are skipped.
- the sound cannot be heard in VLC, and in Premiere Pro the sound is just loud noise, possible because of the skipped frames.
Steps to reproduce the bug:
Input files:
- 1080/50i files from Sony camcorder (h264 + AC3 in M2TS file)
Output files:
- 1) interlaced 1080/25p files with FFV1 lossless codec, but without to use deinterlacing (FFV1 changes 50i to 25p without to use deinterlacing) = this was only to test this bug, I always use option 2)
or
- 2) deinterlaced 1080/50p files with FFV1, FFvHuff, UT video, all lossless codecs, and using QTGMC deinterlacing (I didn't tried other deinterlacers)
At the option 1), without deinterlacing, the steps are:
- Base: Video: FFV1; Audio: auto add (first); Default container: avi
- FFV1: Interlacing: top field first
- Audio: Misc: Ignore reencode and pass-through when audio format doesn't change (is selected)
In the image attached/posted, the 3 output files seen are:
- AVI with mencoder.avi = shorter in size and duration than the other 2 files and than the original file
- MKV with mkvmerge.mkv
- AVI with ffmpeg.avi
I have 3 debug files, but I can't upload them here because these are over the size limit for upload ("The maximum size for that type of file is 200 kilobytes"). These debug files are created with "Steps to reproduce the bug", option 1) for output files, from above:
- "HybridDebugOutput - AVI with mencoder.txt" = muxing with mencoder, bug here (skipped frames, 54 seconds instead of 1 minute)
- "HybridDebugOutput - MKV with mkvmerge.txt" = muxing with mkvmerge, no bug here, only if needed for comparison with "HybridDebugOutput - AVI with mencoder.txt"
- "HybridDebugOutput - AVI with ffmpeg.txt" = muxing with ffmpeg, no bug here, only if needed for comparison with "HybridDebugOutput - AVI with mencoder.txt"
If needed I can send on e-mail or at Contact, these debug files, also the input and output video files.
"HybridDebugOutput - AVI with mencoder.txt" shows many lines like these:

2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  0.8s    20f ( 1%)  0.00fps Trem:  0min 1307mb  A-V:0.076 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  0.8s    21f ( 1%)  0.00fps Trem:  0min 1301mb  A-V:0.080 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  0.8s    22f ( 1%)  0.00fps Trem:  1min 1295mb  A-V:0.084 [0:0]
Pos:  0.9s    23f ( 1%)  0.00fps Trem:  0min 1237mb  A-V:0.048 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  0.9s    24f ( 1%)  0.00fps Trem:  0min 1235mb  A-V:0.052 [0:0]
Skipping frame!
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  0.9s    25f ( 1%) 23.83fps Trem:  1min 1232mb  A-V:0.056 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.0s    26f ( 1%) 24.60fps Trem:  0min 1230mb  A-V:0.060 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.0s    27f ( 1%) 22.78fps Trem:  1min 1227mb  A-V:0.064 [0:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.0s    28f ( 1%) 23.47fps Trem:  1min 1225mb  A-V:0.068 [175765:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.1s    29f ( 1%) 22.41fps Trem:  1min 1224mb  A-V:0.072 [175648:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.1s    30f ( 2%) 23.02fps Trem:  1min 1222mb  A-V:0.076 [175594:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.2s    31f ( 2%) 22.48fps Trem:  1min 1220mb  A-V:0.080 [175675:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.2s    32f ( 2%) 23.09fps Trem:  1min 1219mb  A-V:0.084 [175605:0]
Pos:  1.2s    33f ( 2%) 23.78fps Trem:  0min 1180mb  A-V:0.048 [169940:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.2s    34f ( 2%) 22.93fps Trem:  1min 1180mb  A-V:0.052 [175562:0]
Pos:  1.3s    35f ( 2%) 23.46fps Trem:  0min 1179mb  A-V:0.056 [175740:0]
Skipping frame!
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.3s    36f ( 2%) 22.49fps Trem:  1min 1179mb  A-V:0.060 [175719:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.4s    37f ( 2%) 23.00fps Trem:  1min 1179mb  A-V:0.064 [175910:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.4s    38f ( 2%) 21.97fps Trem:  1min 1179mb  A-V:0.068 [175964:0]
2022.12.28 - 07:25:30_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.4s    39f ( 2%) 22.47fps Trem:  1min 1179mb  A-V:0.072 [176050:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.5s    40f ( 2%) 21.65fps Trem:  1min 1178mb  A-V:0.076 [175842:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.5s    41f ( 2%) 22.08fps Trem:  1min 1178mb  A-V:0.080 [175654:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.6s    42f ( 2%) 21.16fps Trem:  1min 1178mb  A-V:0.084 [175557:0]
Pos:  1.6s    43f ( 2%) 21.63fps Trem:  1min 1151mb  A-V:0.048 [171168:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.6s    44f ( 3%) 22.03fps Trem:  1min 1151mb  A-V:0.052 [175515:0]
Skipping frame!
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.6s    45f ( 3%) 21.49fps Trem:  1min 1152mb  A-V:0.056 [175452:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.7s    46f ( 3%) 21.87fps Trem:  1min 1152mb  A-V:0.060 [175511:0]
2022.12.28 - 07:25:31_Windows 10 Version 2009 (64bit)_2022.11.28.1 - level 9: Mencoder output: Pos:  1.7s    47f ( 3%) 21.58fps Trem:  1min 1153mb  A-V:0.064 [175530:0]

Version of Hybrid: the latest (Hybrid rev 2022.11.28.1)
OS: Windows 10 Pro, 64bit, Version 22H2, OS build 19045.2364
Please, read the 'Infos needed to fix&reproduce bugs,..'-sticky before you post about a problem.


Attached Files Thumbnail(s)
   
Reply
#2
Since you got the debug output files, could you also zip&attach them?
-> will try to reproduce the issue here.


Cu Selur
Reply
#3
I attached the debug files as zip file.
Reply
#4
Thanks. Smile
Reply
#5
I tried to reproduce it by:
Using an interlaced MPEG-2 file, passing through the audio and reencoding the video to FFV-1 interlaced.
Remuxing the output once with mencoder, once with FFmpeg.
Content was identical of both files.

I then used an m2ts with interlaced avc content, passing through the audio and reencoding the video to FFV-1 interlaced.
Remuxing the output once with mencoder, once with FFmpeg.
Now I got the same result as you, the mencoder file seems to be missing frames.

=> I can reproduce the issue, I'm looking into it some more.

Cu Selur
Reply
#6
Think I found a solution.
Adding '-mc 0' to the mencoder call seems to fix the issue for me.
=> Will build and package a Hybrid dev version and send you a link to it via pm in ~15min, so you can check whether this also fixes the issue for you.

Cu Selur
Reply
#7
Send you the link via pm.
Let me know whether this also fixes the problem for your files.

Cu Selur
Reply
#8
It took longer for me to install the developer version, because I was the first Avast Antivirus user to install this version, so Avast sent automatically 2 files to their lab for testing, after the response that the files are clean, for every file in the 64bit directory I received a message that the file is corrupt and to choose between: Try again, Skip (I pressed this button for every about 30 files) or Cancel installation, until I cancelled, and started again the installation with Avast disabled, and this time the installation worked.
About bug and the developer version received with the fix '-mc 0' for mencoder:
- the duration and the file size with mencoder is now correct, the same as with mkvmerge and ffmpeg
- "creating avi file with mencoder" no longer stops at 90% (and jumps at the next step), but continues to 91% until 100%
- the debug file don't show skipped frames
- but the audio (like in my first post) still cannot be heard in VLC and Premiere Pro
According to the mencoder specification:
-mc 0 -noskip to ensure A/V sync
-mc 0 should always be combined with -noskip for mencoder, otherwise it will almost certainly cause A-V desync
If -noskip wasn't added to this developer version, maybe this is the cause for the audio problem with mencoder.
Reply
#9
Will add '-noskip' and send you a new version once I'm through with it.
Reply
#10
Send you a new link.

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)