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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th July 2015, 02:39   #1  |  Link
minoglow
Registered User
 
Join Date: Nov 2014
Posts: 4
MeGUI x264 encoding seems causing frame skipping

Hi, first of all, I'm not a native English speaker so please excuse my bad English.

I know this is community about backing up DVD/BD, and actually the source that I'm trying to encoding is game-recording(capturing)-video, but Google says here is the best place about encoding (especially x264 and MeGUI), so I come here. If my ask is inappropriate in here, please tell me which community/forum I should go; I'll really appreciate it.

Lastly, I'm really and really new about this scene; so my question will be really trivial, (like.. you don't need theoretical mathematician professor to solve basic Linear equation, right?) but it literally drives me crazy so I desperately need a help.

OK, here's a thing:

I captured my game play screen with with Dxtory using mainly Lagarith codec or 264vfw lossless at 1080p60.

This is my codec setting for capture (actually, nothing special though):

Lagarith (link)
x264vfw (link)

After capture, I encoded my video to reduce its size with MeGUI/x264, all the setting is basically default except crf value is 18.

my x264 setting in MeGUI (link)

The problem is here:

the encoded file causing like frame.. I don't know how to express this exactly; (due to my English) skipping? popping? shaking? stuttering?

Well, a picture is worth a thousand words, here are the files:

https://drive.google.com/folderview?...Dg&usp=sharing

The folder includes all the file relative except encoded file before muxed. (original source file, avs, ffindex, encoded file after muxed) (of course, the frame gets problem even before muxed)

(there are Lagarith version and x264vfw version both, to confirm this problem)

or Youtube:

original source (capture)
after encoding

(Please set 720p60 or 1080p60 when you watch Youtube's link)

Where you should look:
  • at 0~18 sec, mountain moving in background.
  • at 30~38 sec, ジュゲム(寿限無, Jugemu; Lakitu in English)'s shadow. The shadow is blinking stably, and it should keep looking grey, but encoded file looks black or empty sometimes.

I thought potplayer was a problem, but checking by Youtube it is definitely the encoded file itself has a problem.

So.. why is this happening? What setting should I use in x264 (MeGUI) to solve this problem?

Thank you for read this, and thanks in advance for your help and kindness.
minoglow is offline   Reply With Quote
Old 20th July 2015, 19:06   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,228
On my side using MPC-HC 1.7.9. with built-in LAV 0.65 the 1920x1080 file ....x264.avi plays nice at 60fps,
using 6 of 12 cores (i7 4960X) at 14%, background (mountains and stuff) moving steadily, no framedrops.

The shadow under the start guy comes properly encoded in black as existent only ever other frame.
This is of course only visible for me if I step manually through the frames.

Otherwise while playback I get a more or less smooth grey impression of this shadow,
only rarely granular, depending on onset of display tearing.
Normal for my setup, as I did not use any refined timing software right now.
P.S. Just updated to madVR 0.88.20: Granularity gone. Pure grey.

Ah: OSD tells me something strange: movie 25.000fps (says source filter) !
Yep, LAV Splitter / Decoder see something flagged as 25fps, and seem to handle that gracefully.
Other players may not do so.
mediainfo sees 60.000fps.

Container correctly fps flagged and bitstream not ?
You may want to tell the fps to x264.
(I seem to remember that x264 assumes 25fps as default if fps can not be determined from input
but this is not listed in --fullhelp)
Add --fps 60
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."

Last edited by Emulgator; 20th July 2015 at 19:54.
Emulgator is offline   Reply With Quote
Old 20th July 2015, 23:24   #3  |  Link
minoglow
Registered User
 
Join Date: Nov 2014
Posts: 4
Thanks for reply.

Quote:
Originally Posted by Emulgator View Post
no framedrops.
Well, actually that is also the point. There is no frame drops. A video player says it is at 60fps steadily. I didn't say 'it is not framedrops problem' though. (but also, I never say I have frame drops)

Quote:
Originally Posted by Emulgator View Post
The shadow under the start guy comes properly encoded in black as existent only ever other frame.
This is of course only visible for me if I step manually through the frames.
Quote:
Originally Posted by Emulgator View Post
Ah: OSD tells me something strange: movie 25.000fps (says source filter) !
Actually, what you watched is not the file encoded with MeGUI, it is the file recorded(captured) by Dxtory using x264vfw. Simply, the source (which has nothing problem). However, that is not your fault. I named file just x264, not x264vfw, so it is easy to confusing.

Here, I summarize again:

In Google dirve that I linked, these are the sources that captured by Dxtory, which, of course, have nothing problem.
  • recording dxtory lagarith.avi
  • recording dxtory x264vfw.avi

The files named -muxed in last is the files that encoded with MeGUI/x264. they both have same wrong frame problems:
  • recording dxtory lagarith.avi-muxed
  • recording dxtory x264vfw.avi-muxed

I added files that recorded by iPhone 5 in Google Drive, both of potplayer and youtube for confirm this.

EDIT:

Quote:
Originally Posted by Emulgator View Post
The shadow under the start guy comes properly encoded in black as existent only ever other frame.
This is of course only visible for me if I step manually through the frames.
Actually, that is good method to check and confirm this problem, and yes, I checked encoded files by stepping manually through the frames (in potplayer), and the shadow appears randomly, not in even frame regularly. (Also, there are frames that mountains are not moving at all)

OK, now I can say the problem more correctly and technically:
When encoding with MeGUI, some frames are just simply gone, and some frames are duplicated and replace gone frames.

Last edited by minoglow; 21st July 2015 at 00:36.
minoglow is offline   Reply With Quote
Old 20th July 2015, 23:50   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,015
Post the megui log file
poisondeathray is offline   Reply With Quote
Old 20th July 2015, 23:54   #5  |  Link
minoglow
Registered User
 
Join Date: Nov 2014
Posts: 4
Sorry, would you mind tell me how can I get MeGUI log file?

EDIT: Ah, there is a folder. I found it. OK; I uploaded in Google Drive.

Last edited by minoglow; 20th July 2015 at 23:58.
minoglow is offline   Reply With Quote
Old 20th July 2015, 23:58   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,015
Look in the megui folder, there should be a "log" or "logs" folder ( something like that I haven't used megui in a long time). It's a text file generated everytime you encode or even start up megui. It contains debugging information that can be helpful to see what is causing the problem
poisondeathray is offline   Reply With Quote
Old 21st July 2015, 00:11   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,698
It'll probably be ffms2 and it's frame rate conversion not playing nice with AVIs. The latest MeGUI (on the development update server) no longer uses ffms2 for AVI indexing as it caused a few problems. Mainly repeating/dropping frames when indexing AVIs and it's frame rate conversion was included in the script. Which in theory shouldn't be a problem. If the actual frame rate and the frame rate conversion in the script are the same, it should have no effect. I also had problems with indexing lossless video in AVIs with ffms2. It tended to crash.
If I'm correct, any of the following methods should fix the problem. You'll hopefully only need to use one.

- Remove the part highlighted in blue from the script MeGUI creates before encoding it. After removing it, use the preview to make sure the total number of frames doesn't change. If it doesn't, you should be good to go. It's the frame rate conversion that's causing problems with AVIs.

LoadPlugin("D:\Program Files\MeGUI_2525_x86\tools\ffms\ffms2.dll")
FFVideoSource("D:\Dxtory\Mario Kart recording dxtory lagarith.avi", fpsnum=60, fpsden=1, threads=1)

- When you open the AVI for indexing, choose L-Smash as the indexer instead of ffms2 (assuming you're not using an older version of MeGUI that doesn't include L-Smash).

- Don't open the AVI with the file indexer. Open the script creator from the Tools menu manually, then select the original AVI as the Input Video. MeGUI will ask how you want to open it. Choose AVISource.

- Remux the source AVI as an MKV with MKVMergeGUI, then use the MKV for encoding. You should be able to open that with the file indexer and index it with either ffms2 or L-Smash.

I'm not seeing the frame rate oddness Emulgator saw with MadVR, but I only downloaded one file because my internet connection is very slow and I haven't downloaded the source video, but when looking at "Mario Kart recording dxtory lagarith.avi-muxed.mkv" with MPC-HC and stepping through one frame at a time, it's easy enough to see there's lots of repeated frames, which seems very much like the ffms2/AVI problem. Hopefully the source isn't the same.

Edit: There's been a few new posts while I was writing this one, and it seems confirmed that duplicate/missing frames are the problem. It's very likely to be ffms2's frame rate conversion.

Last edited by hello_hello; 21st July 2015 at 00:22.
hello_hello is offline   Reply With Quote
Old 21st July 2015, 00:20   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,015
Thanks.

I looked at "Mario Kart recording dxtory x264vfw.avi" , which is the source file and it's fine. I can confirm the "muxed" version (ie the encoded version) has duplicate frames, and a few dropped frames.

I can reproduce your error with ffms2. The problem is the auto inserted fpsnum=60, fpsden=1. If you remove those , it works fine

This is what I think is going on:
Some versions of ffms2 will autodetect the frame rate as 59.94 FPS, not 60.0 FPS.
ffms2's fpsnum and fpsden will drop or duplicate frames to make up the frame rate that you specify (it's like avisynths' changefps() )
A "more correct" way of forcing the framerate would be to use AssumeFPS(60) , not the fpsnum, fpsden parameters

EDIT: oops I missed hello_hello's post, but he's saying the same thing
poisondeathray is offline   Reply With Quote
Old 21st July 2015, 01:05   #9  |  Link
minoglow
Registered User
 
Join Date: Nov 2014
Posts: 4
OK, Thanks everyone.

Thank you for confirming this problem. It proves I do not have some freak eye vision problem or something.

I confirm removing "fpsnum=60, fpsden=1," solve perfectly this problem. sweet!

Info() says the fps of my source is 59.9520 (60012/1001), this is where all starts. (when using ffms2 file indexer)

If I use AVISource instead of ffms2, AssumeFPS(60,1) added to script and Info() says fps is 60fps, and the end resulting is also fine.

However, If I choose L-Smash in file indexer, it failed to make avs script.

Log says Standard error stream/LWLibavVideoSource: bgr0 is not supported.

Anyway, thanks again professors. Now I'm free from pain and suffering.
minoglow is offline   Reply With Quote
Old 21st July 2015, 02:33   #10  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,698
Quote:
Originally Posted by poisondeathray View Post
EDIT: oops I missed hello_hello's post, but he's saying the same thing
Except I'm pretty sure it's a bug, not a frame rate detection problem. MeGUI uses MediaInfo to determine the frame rate and adds the conversion to the script, which is why I suggested checking the frame count with and without it. If it changes, it probably means there's missing/null frames, because for some reason ffms2 treats AVIs with null frames as variable frame rate and outputs the average frame rate. As does L-Smash. AVISource does what I'd expect should happen for AVIs. It outputs the correct constant frame rate and duplicate frames are used to replace null frames if need be. ffms2 and L-Smash don't unless you use the frame rate conversion.

MeGUI adds AssumeFPS() to the script when opening video with AviSource but that's because the script creator GUI has an option to change the speed of the video when AVISource is used (I have no idea why, but it's there), not because it needs to convert the frame rate.

Anyway..... all that aside, the problem with the frame rate conversion has been discussed a few times in the MeGUI thread and I've duplicated it myself and it only happens with AVIs as far as I know, so I assume it's a bug. If the frame rate conversion is the same as the actual frame rate, ffms2 still tends to drop/duplicate frames, only unnecessarily. Originally I thought it was muxer or frame rate related, but I think that turned out not to be the case. Nobody in the ffmegsource thread seemed particularly interested in looking at the problem though.
http://forum.doom9.org/showthread.ph...26#post1679226

Quote:
Originally Posted by minoglow View Post
Info() says the fps of my source is 59.9520 (60012/1001), this is where all starts. (when using ffms2 file indexer)
All it'd probably take for a 59.9520 average frame rate is a single null frame. Maybe two. I don't use that sort of capture software myself so I don't know how likely dropped frames would be when capturing, but the evidence seems to point in that direction. Which was the logic behind MeGUI adding the frame rate conversion stuff to the script in the first place. Oh well..... AVISource should be getting it right.

Last edited by hello_hello; 21st July 2015 at 02:53.
hello_hello 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 06:01.


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