Avidemux Forum

Avidemux => Windows => Topic started by: shriokitsu on March 25, 2017, 10:21:35 PM

Title: MKV Extra Frames / Audio Sync
Post by: shriokitsu on March 25, 2017, 10:21:35 PM
I recently upgraded my avidemux from an old version.  I primarily use it to convert anime from mkv to mp4 and hardsub the subtitles, and have been using it for many years without any problems.

In the old version, when I would open an mkv file, there would always be some extra frames there.  Sometimes it would only be a fraction of a second of video, other times a whole ten seconds.  If I didn't crop it out, it would cause the audio to be out of sync.  Avidemux would place the video at the correct time and you could see there would be a small amount of time in the time counter ( i.e. 00:00:00.567 / 00:24:00.000 ).  All I had to do was hit the B marker and delete, and I was good to go.

In the new version, avidemux doesn't recognize these extra dummy frames, but I know they are still there because the audio is out of sync.  However, there is no longer any apparent way to delete them.  If anyone knows what I am talking about and has figured a way around this, please let me know as I have spent quite a few hours trying to figure this out.  Many thanks!
Title: Re: MKV Extra Frames / Audio Sync
Post by: Jan Gruuthuse on March 26, 2017, 06:50:48 AM
Have you tried re-muxing with latest mkvtoolnix gui (https://mkvtoolnix.download/) before processing with avidemux?
Title: Re: MKV Extra Frames / Audio Sync
Post by: eumagga0x2a on March 26, 2017, 09:33:25 AM
Please provide a sample (the initial ~300 MiB of the source video you are trying to hardsub). There are no "dummy frames". If the video stream doesn't start with a keyframe, everything before the first keyframe gets discarded. It the video contains B-frames, you get a video where the first keyframe has a non-zero timestamp. Some videos have early B-frames, which are displayed before the first keyframe.
Title: Re: MKV Extra Frames / Audio Sync
Post by: shriokitsu on March 26, 2017, 11:16:21 PM
Quote from: Jan Gruuthuse on March 26, 2017, 06:50:48 AM
Have you tried re-muxing with latest mkvtoolnix gui (https://mkvtoolnix.download/) before processing with avidemux?

I tried it on your suggestion.  Unforntunately, it did not seem to make a difference.
Title: Re: MKV Extra Frames / Audio Sync
Post by: shriokitsu on March 26, 2017, 11:21:43 PM
Quote from: eumagga0x2a on March 26, 2017, 09:33:25 AM
Please provide a sample (the initial ~300 MiB of the source video you are trying to hardsub). There are no "dummy frames". If the video stream doesn't start with a keyframe, everything before the first keyframe gets discarded. It the video contains B-frames, you get a video where the first keyframe has a non-zero timestamp. Some videos have early B-frames, which are displayed before the first keyframe.

Thanks for the info.  I am far from an expert at this.  Here is a link to the video: https://goo.gl/udPeqT (https://goo.gl/udPeqT).  The audio is in sync if watched in a player, but isn't when opened in avidemux.  If remuxed, the audio and subtitles end up out of sync.
Title: Re: MKV Extra Frames / Audio Sync
Post by: mean on March 27, 2017, 05:50:54 AM
The audio looks alright after saving as mkv (copy/copy)
The process might add a constant shit to subtitles

What is your process ?
Title: Re: MKV Extra Frames / Audio Sync
Post by: mean on March 27, 2017, 06:28:53 AM
The video is  special
Audio & video both start at 10sec
Title: Re: MKV Extra Frames / Audio Sync
Post by: eumagga0x2a on March 27, 2017, 07:50:47 AM
Quote from: mean on March 27, 2017, 06:28:53 AM
The video is  special
Audio & video both start at 10sec

It this case Avidemux and ffprobe massively disagree. ffprobe reports:


  Duration: 00:23:54.13, start: 0.000000, bitrate: 1904 kb/s


Avidemux adds aforementioned 10 seconds to the values.

I can confirm that saving in copy mode keeps A/V sync.
Title: Re: MKV Extra Frames / Audio Sync
Post by: mean on March 27, 2017, 09:41:56 AM
Indeed there is a bug there
Title: Re: MKV Extra Frames / Audio Sync
Post by: eumagga0x2a on March 27, 2017, 09:50:18 AM
Is there a chance you would like to fix it in 2.6.19?
Title: Re: MKV Extra Frames / Audio Sync
Post by: mean on March 27, 2017, 09:54:43 AM
I'll fix it in the other branch, too risky
Title: Re: MKV Extra Frames / Audio Sync
Post by: mean on March 27, 2017, 10:00:59 AM
scratch that, it's an easy fix
Title: Re: MKV Extra Frames / Audio Sync
Post by: eumagga0x2a on March 27, 2017, 10:06:29 AM
This sounds great, thanks.
Title: Re: MKV Extra Frames / Audio Sync
Post by: shriokitsu on March 28, 2017, 01:28:30 AM
Just downloaded and installed avidemux_2.6.18_r170327_win64.exe from the nightly builds.  Problem is not present in this release.