Log in

View Full Version : MeGUI - Re-encoded x264 causes odd audio sync (not a typical one)


homerpez
4th June 2008, 10:36
I'm hoping someone has had this happened to them, and has fixed it:

I'm trying to take a backup...

1. 1080p H.264 Video + AC3 audio (MKV)

And convert it into...

2. 720p x264 Video + AC3 audio (MKV)

To do this, I would use the "AVS Script Creator" to open the original MKV, resize, set the frame type, etc... and encode with all the recommended x264 settings. Then, I would take the 720p video, and remux the original MKV file (making no changes to the audio stream).


--pass 2 --bitrate 2740 --stats ".stats" --keyint 240 --min-keyint 24 --ref 5 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --subme 6 --partitions p8x8,b8x8,i4x4,p4x4 --merange 32 --threads 4 --thread-input --progress --no-psnr --no-ssim --output "output" "input"

On some of these, I get the typical "offset" sync problem, which is easy to fix in MKVmerge. BUT... on one especially, I have a new problem.

The 720p recode plays the first few minutes normally. Then at a certain time in the video, the picture seems to "choke", and the audio is offset from that point on. So a simple offset will no longer compensate.

The original source material is totally in sync the whole time, only the recode does this.

It's not my machine (Q6600 Quad Core with 4GB Ram), or the audio stream (which was left unchanged). It definitely has something to do with the way MeGUI and X264 compiled the video stream.

Has anyone else had a similar problem? And... is there any setting I can tweak to ease this "choking" effect on the encode?

Thanks in advance! :thanks:

EDIT: I also just confirmed that this occurs both when using ffdshow or PowerDVD 8 playback filters so, the problem is definitely in the x264_MeGUI encode...

Adub
4th June 2008, 23:12
For one, MeGUI has nothing to do with it. It is probably your x264 settings. MeGUI just provides a simple interface for setting up x264, and then hands off all control to the encoder itself. What version of x264 are you using?

homerpez
5th June 2008, 02:07
Version says "859-3 Jarod's Patched Build" (this is the version MeGUI updates to, and says it's the latest.) I'm trying an old VFW version and Virtualdub as we speak, to see if an older version of x264 doesn't do this.

Definitely is something in the x264 settings, as I've been trying everything I know and the result is the same every time...

This is really baffling me because I've done numerous (over 100 probably) encodes with x264 now, and this is the first time that the video stream stutters like this, causing the audio to not sync up.

So far I've tried to activate "Trellis" (1- Final MB as suggested), the misc computations, B-Frame mode on Spatial, then "auto"... then tried upping the bitrate to something so high that it would eliminate that being an issue... every encode I have done has this same effect, every time.

It's as though on every encode, it adds frames... or loses them... or simply can't keep up with them. This doesn't make sense, as the 1080p version was also encoded in x264, and plays just fine in the same spot of video. I'm this close to just keeping the huge version (though it's the last one of a series this happened to, go figure).

What setting would govern what's happening here?

Adub
5th June 2008, 02:26
Did this start happening AFTER you updated to that version of x264?

rebkell
5th June 2008, 02:33
Definitely is something in the x264 settings, as I've been trying everything I know and the result is the same every time...

Version says "859-3 Jarod's Patched Build" (this is the version MeGUI updates to, and says it's the latest.) I'm trying an old VFW version and Virtualdub as we speak, to see if an older version of x264 doesn't do this.

This is really baffling me because I've done numerous (over 100 probably) encodes with x264 now, and this is the first time that the video stream stutters like this, causing the audio to not sync up.

So far I've tried to activate "Trellis" (1- Final MB as suggested), the misc computations, B-Frame mode on Spatial, then "auto"... then tried upping the bitrate to something so high that it would eliminate that being an issue... every encode I have done has this same effect, every time.

It's as though on every encode, it adds frames... or loses them... or simply can't keep up with them. This doesn't make sense, as the 1080p version was also encoded in x264, and plays just fine in the same spot of video. I'm this close to just keeping the huge version (though it's the last one of a series this happened to, go figure).

What setting would govern what's happening here?

Have you tried extracting he 264 stream from the original mkv and running dgavcdec on it, and see if it squawks anywhere. My guess would be that it's the source file, there is some glitch that doesn't show up on playback, but when run through directshowsource or whatever you're decoding the original mkv with, that it's not decoding it quite right(what encoder are you using to feed the source to x264?)

I just read that you have tried two encoders, PowerDVD and ffdshow, I still suspect the source.

homerpez
5th June 2008, 11:33
Ok, after some exhaustive tests... I've still not arrived at a solution. Something is clearly in my x264 settings that causes this problem (or does not fix it).

Encoding with the older VFW build (Virtualdub + Core 55 build 658, whatever that is) produced the same effect yet again.

Encoding with ffdshow as the decoder enabled for h.264 produced this effect.

Encoding with PowerDVD 8 as the decoder enabled for h.264 produced this effect.

Encoding with either of those, and a 7000 bitrate average (both filters) produced this effect also.

@ rebkell: I wasn't aware of this program before, but I ran it, and the only thing I noticed was a bitrate spike at about the time this effect happens. On the original 1080p, it plays just fine. But the encoder just seems to choke on it, even with the bitrate cranked up. (It's also an anime, where there's huge spots of low movement.. even with the bitrate cranked way too high for 720p, this still occurs).

@ Merlin7777: This seems to be having this effect on any encode I do, with older or newer x264 builds, and with almost any bitrate or setting... VFW builds, command line builds, meGUI or otheriwse.

Especially baffling because the person who encoded the source material (not me) apparently had no trouble.... it's totally in sync, until I use the settings above (using any filter, and any bitrate it seems).

Is there anything left to tweak? Or am I simply screwed?...

EDIT: Just curious... I don't know why this would be, just call it a hunch... is there some limit to the INPUT bitrate that any of the programs in meGUI can handle?

Since the only noticable feature of the source video is that bitrate spike, I wonder if it's just too much for one of the programs... Avisynth? x264?......