Adudio out of sync

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Phillie14586
Posts: 12
Joined: Wed Dec 24, 2014 4:51 pm

Adudio out of sync

Post by Phillie14586 » Thu Apr 26, 2018 12:16 pm

I record some TV shows using EyeTV3. Sometimes I like to watch some recordings on my laptop when traveling and don't need high resolution so I compress them with Handbrake. In EyeTV I cut out the commercials before giving them to Handbrake. In the past about 5% of the time I would get an encoding with the audio out of sync. The beginning of the video the audio is fine, it is over time the audio gets out of sync. To fix the problem I would use EyeTV and export the file to 1080p then use handbrake to compress. This works but EyeTV takes forever to export files. A couple days ago I went to compress some videos and Handbrake said there was a new version so I downloaded and installed it. I tried compressing about 8 files, the audio was out of sync with every file. I took one of the files and exported it with EyeTV then compressed the new file with Handbrake and all is fine. This is all done on a mid 2010 MacPro running High Sierra. Is there something else I can do to keep the audio in sync? The other interesting issue is even though past files that had in sync audio in quicktime on my mac had out of sync audio using Windows media player but was fine with VLC on Windows.

Log files
Out of sync

In sync

Phillie14586
Posts: 12
Joined: Wed Dec 24, 2014 4:51 pm

Re: Adudio out of sync

Post by Phillie14586 » Tue May 01, 2018 11:49 am

I mostly fixed my problem. The first thing was to go back to 1.0.7. Next I used the Very Fast 720P preset. To get the files a little smaller I changed the quality slider to 25. Not sure what I based my original preset on but modifying the very fast 720P mostly fixes the audio problems. I still had 2 files last night with out of sync audio but before that could have been 5-6.

kfreeb
Posts: 64
Joined: Wed Sep 01, 2010 4:10 pm

Re: Adudio out of sync

Post by kfreeb » Tue May 01, 2018 3:29 pm

I'm having the exact same problem.

I recently upgraded my Mac to one that can run High Serra, (Mac Pro 12 core 3.33 GHz) so I also updated my old copy of Handbrake from and old beta, version: (6509svn x86_64) to the newest version available at the time, version: (20180227205614-369b4f6-master)

It's hit and miss with files that I edit from TV, (Tivo Mpeg2 kmttg downloaded, edited with MPEG StreamClip) but is very consistent on the "miss" with those files that end up out of sinc. I can encode the edited files, over and over with the same result, (out of sinc). I actually have several files that demonstrate this problem consistently, however if I encode the same files, using the old version of handbrake, (6509svn x86_64) the resulting encoded file is "in sinc". FYI: Yes the old handbrake still runs under High Serra beautifully, (thank heavens!)

I was first thinking that it was possibly my old settings brought over from the old handbrake so I used the new Apple TV settings that came with the new handbrake, the results were the same, "out of sinc". I would be willing to make one of these Mpeg2 source files available for testing by the developer community if they wish to test, but I would need a drop box that could accommodate a file of about 2GB in size. Uploading the file for me is not an issue, I have a very fast upload connection.

For now, the new Handbrake is not usable for files that are edited from TV.

One thing I should add is, the Mpeg2 file when played in VLC is in sinc, it is only the m4v encoded file that ends up out of sinc, when played in VLC, or streamed over Plex to and Apple TV gen 4 or any other playback device, via Plex. The finalized m4v file its self, is out of sinc.
Last edited by kfreeb on Tue May 01, 2018 3:35 pm, edited 2 times in total.

User avatar
s55
HandBrake Team
Posts: 9187
Joined: Sun Dec 24, 2006 1:05 pm

Re: Adudio out of sync

Post by s55 » Tue May 01, 2018 5:33 pm

@Phillie14586 Can you provide a short sample file with the problem please? (Google Drive, Dropbox, OneDrive etc all good options for sharing)

The out of sync one, has stream errors. HandBrake has tried to correct audio sync to the tune of about 100ms.
It would be also interesting to know if running the file though a stream repair helps.

With error prone files, it's a game of whack a mole. You can help one situation and break another which is generally why it's better to try repair the stream than handle the millions of possible error conditions on decode. It's entirely possible the decoder is no longer tolerant of this particular error.

If you can share a sample, that would be helpful.

Phillie14586
Posts: 12
Joined: Wed Dec 24, 2014 4:51 pm

Re: Adudio out of sync

Post by Phillie14586 » Wed May 02, 2018 5:31 pm

I will try to get you source files with corresponding HB logs. I am wondering if this is a time code issue. When EyeTV cuts out the commercials it does not repair the time code so there are jumps where the cuts were made. The HB files always start out okay but it is at the end that the audio gets out of sync. It is also interesting that this is player dependent. I screen the HB files with QuickTime on my Mac and only keep the ones that work there. These same files in Windows Media Player may or may not work properly but in VLC on Windows they always work. I am not sure if that is something you will be able to figure out or not.

You mention a stream repair, what is that? Is that what EyeTV does when it exports a file since it fixes the time codes?

kfreeb
Posts: 64
Joined: Wed Sep 01, 2010 4:10 pm

Re: Adudio out of sync

Post by kfreeb » Tue May 15, 2018 5:35 am

I still use Mpeg Streamclip, even though it is not supported any longer, but still works just fine under the current Mac OS and it does correct timecode. The files that are out of sync on my system are timecode correct after editing, so that is not the problem with this sync issue.

To be able to correct this problem, it will take a full 42 minute TV show file, ( size is after editing) to do a proper test if the new Handbrake is ever fixed, which is why I offered to upload a test file that exhibits the sync issue.

My info is above on the test I ran, against the old and new versions of handbrake.

For now, the old handbrake is my only choice for edited TV programs, if I want to avoid the out of sync issue.

I just need to know were to send the test file, If anyone is interested?

DioPress
New User
Posts: 1
Joined: Sat May 26, 2018 8:30 pm

Re: Adudio out of sync

Post by DioPress » Sat May 26, 2018 8:35 pm

I am having the same problem as the OP with the newest version of Handbrake. It is specifically affecting files that have been split/concat'd, when ffmpeg gives the message "on-monotonous DTS in output stream". The audio is fine in the original format (.ts), and the audio only gets out of sync when converting to mp4. I saw the recommendation to try and repair the stream. I have tried to find information on how to go about doing that, but nothing I have tried seems to work. Could you possibly provide some more information and/or reference to the proper way to do this?

User avatar
BradleyS
Moderator
Posts: 1356
Joined: Thu Aug 09, 2007 12:16 pm

Re: Adudio out of sync

Post by BradleyS » Sat May 26, 2018 8:39 pm

Many people recommend VideoReDo on Windows.

Phillie14586
Posts: 12
Joined: Wed Dec 24, 2014 4:51 pm

Re: Adudio out of sync

Post by Phillie14586 » Tue Jun 05, 2018 6:49 pm

s55,
Sorry for the delay getting back to you.I was having problems with my backups and did not have the original video file that would not encode correctly. I now have a video file that has the audio out-of-sync after being compressed in Handbrake. I can also post the log files. I exported the video from EyeTV and have that file and the good compressed file also. This is copyrighted material so I am hesitant to share the whole file. Would a section of the file around the point where the audio gets out of sync be the most useful?

User avatar
s55
HandBrake Team
Posts: 9187
Joined: Sun Dec 24, 2006 1:05 pm

Re: Adudio out of sync

Post by s55 » Tue Jun 05, 2018 7:23 pm

Any short sample that reproduces is fine.

musicvid
Veteran User
Posts: 3100
Joined: Sat Jun 27, 2009 1:19 am

Re: Adudio out of sync

Post by musicvid » Thu Jun 07, 2018 4:30 pm

Your video is a transport stream, and the most common cause is dropped frames from stream errors. Post your logs. As extreme as your case sounds, even VideoRedo (or Subler for Mac)may not correct it 100%, but it's your best shot.

Post Reply