Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small number of extra frames added, causing sync issues #47

Open
Milliarde89 opened this issue Apr 15, 2021 · 9 comments
Open

Small number of extra frames added, causing sync issues #47

Milliarde89 opened this issue Apr 15, 2021 · 9 comments

Comments

@Milliarde89
Copy link

I have done several encodes lately (first of all thanks for the excellent program!!) and have noticed that on some of the movies I've done they end up out of sync with the audio, typically more so as time goes on.

I updated to all the latest versions but am still encountering the problem. For example, I am encoding a Blu-Ray x264 rip of a movie - the original movie has a total of 124480 frames (duration 1:26:31) but the AV1 encoded movie has a total of 124486 frames (duration 1:26:32). So somehow 6 frames are being added, causing the video to be slightly behind the audio the further into the movie you go.

I've attached screenshots of the original and encoded, both after navigating to frame 100000 in MPC-HC.

If it matters, I've used the default ffmpeg scene detect, typically do a resize down to 720p, and use the settings in the attached image.

It's driving me crazy, any idea what the issue is or if I'm doing something wrong?

settings
orig_100k
av1_100k

@Alkl58
Copy link
Owner

Alkl58 commented Apr 15, 2021

Yeah, thats sadly a often reaccuring issue.
Most of the reason where because of some meta-data / frame placement issue from the source video. Thats why often re-encoding beforehand works.
If you want, you can send me the source video for testing purpose.
Else I will recommend to use equal chunking with re-encoding.
Many Greetings

@Milliarde89
Copy link
Author

Is this an issue just with neav1e or with aomenc itself? When you say to re-encode the source, do you mean just putting it through ffmpeg with c:v copy or to convert to uncompressed or something? I can send you the source but it has happened on multiple videos so if there is a reliable solution I would be 😄

@Milliarde89
Copy link
Author

I re-encoded using the same settings but using PySceneDetect instead of ffmpeg scenedetect and it turned out correct, interesting...

@Milliarde89
Copy link
Author

Well I tried a different movie using PySceneDetect and it's slightly better, but still 4 extra frames. I guess I will try with re-encoding it first.

@Alkl58
Copy link
Owner

Alkl58 commented Apr 17, 2021

Yeah, sadly it's always a hit or miss if it works with re-encoding / different splitting options.
Personally I always re-encode to x264 crf 0, then use equal chunking with reencoding. With this combination I never had lost/added frames.

Is this an issue just with neav1e or with aomenc itself?

It's more or less an ffmpeg issue.

When you say to re-encode the source, do you mean just putting it through ffmpeg with c:v copy or to convert to uncompressed or something?

In equal chunking mode there is the option to re-encode during splitting process (re-encodes the video by default with x264), else what I mean by re-encoding is to do -c:v libx264 -crf 0 (as an example)

@Milliarde89
Copy link
Author

I think I understand now. Doesn't equal chunking imply that the encode won't be as efficient, if it's not splitting based on scene changes?

@Alkl58
Copy link
Owner

Alkl58 commented Apr 17, 2021

Technically you are correct, but keep in mind that depending on the chunking length that efficiency loss is very small and can be ignored. ^^

@j-rodman
Copy link

I'm experiencing audio desynching in 2.0.6 in general. I've gotten this using pyscenedetect as well as fixed sized chunks.
I've usually been doing this at low quality (like 35) , 2 pass encoding, speed 2 or 3, and with the lag-in-frames set to 48 in the advanced options. I transcode the audio to opus.

The updater says everything is at 2002.03.24 (except "Manual Update" which i have no idea what that is.)

Does this belong in a separate issue? Or .. otherwise? I can't find any recommended settings.

youer-mam added a commit to youer-mam/NotEnoughAV1Encodes that referenced this issue May 31, 2022
@Alkl58
Copy link
Owner

Alkl58 commented Feb 27, 2023

Maybe the commit Fix Input Seeking Frame Inaccuracy (Scene Based Splitting) fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants