WD TV Live and audio sync (lipsync) issues in MP4 and MKV video containers

Hello to all,

Just want to share so here it is.

My intent is to convert my video DVD and Blu-Ray library to digital copies to be played on my Western Digital TV Live HD Media Streaming device (current firmware version 2.01.86).  I wanted a device that did not recognize Cinavia so that I had no problems with DRM.  I would also like to stream through my PS3 using PS3 Media Server (for non-Cinavia content).

I have the WD TV Live and the PS3 connected by HDMI to my Yamaha receiver.  The receiver is then connected to the Panasonic 50” Plasma TV.  All my movies are located on my main computer with the movies and TV shows in shared folders.  The WD TV Live and PS3 have no problem seeing and accessing the Windows 7 shares that I have set up.  The video files stream directly from the computer to the WD TV Live without any additional transcoding (not though PS3 Media Server).  The video files stream though PS3 Media Server to the PS3 though.  I have the PS3 Media Server configured to allow the PS3 to transcode directly instead of PS3 Media Server doing the transcoding.

I chose to convert all my media to the MP4 container with x264 codec for video, AC3 5.1 DD for the first audio track and AC3 2.0 stereo for the second audio track (to stream for non-digital sound devices – Android tablets, etc.).  Also the WD TV Live and PS3 play MP4 video container as native without any further transcoding.  Therefore, fast forwarding, rewinding and chapter skipping works as required.

To convert to MP4, I have been using Handbrake Nightly Build (currently at version svn5960).  Settings are as follows:

1280 X proportional height (720p) for Blu-Ray and full resolution for all DVDs

Loose with Modulus 2 for Blu-Rays and Strict for DVDs leaving the full resolution with proper aspect.

Automatic cropping

All filters off

Video Codec H.264

X264 Preset - Slow

Variable Frame Rate

High H.264 Profile and 4.1 Level

Constant Quality 22

Audio set as above

Subtitles – when there are forced subtitles, I will burn in

Create Chapter Markers when available.

The Problem

 

After converting a number of DVDs and Blu-Ray disks, I have found a strange problem while playing all videos on the WD TV Live.  All the videos have a 200 ms audio sync issue.  The audio is ahead of the video by 200 ms.  When I select  Options on the WD TV Live and select Audio Lip Sync and adjust the audio with a -200 ms delay, the audio is perfectly in sync.  The 200 ms audio delay is consistent for the whole video (does not increase or decrease in duration).   While playing the exact same videos on the PS3 using PS3 Media Server, the audio is perfectly in sync.  There is no audio delay problem.  I can also play the video files on my computer using VLC and there is no apparent audio sync issue.

Also note, that I have tried the same type of encoding to an MKV file.  MKVs have the same audio sync problem (I am thinking because the MKV is just a container but the video and audio are inherently the same).

I  found a solution to fix the problem of all the DVDs and Blu-Rays that I have encoded to date so that I did not have to go back and rip and re-encode all the videos again (taking hours).  I installed MKVtoMP4.  I can open the MP4 video file directly into this program, select the audio streams and add a 200 ms delay.  The program then saves the video as a new MP4 video file leaving the video intact and the audio with the audio delay.  No re-encoding required.  The whole process only takes a few minutes.  When I test on VLC (PC), PS3 and WD TV Live, the audio is in perfect sync.

I  found it strange that I can add the audio delay and the videos still play OK on all the video devices I have.  I do not know yet the implications of this “fix” but I am willing to live with it until such a time as it is deemed necessary to actually rip and encode the videos from scratch again.

From researching this problem on Google, I have found some interesting things about aspects of video encoding.  Apparently, the WD TV Live does not like videos encoded with Variable Frame Rate from Handbrake.  I tried a Blu-Ray video with constant frame rate and have found the same audio sync problem.  There may also be a firmware issue with the WD TV Live that causes the audio sync issue.  There seems to be a lot of people complaining about this similar problem.  I found this particular complaint interesting.  http://community.wd.com/t5/WD-TV-Live-Streaming-Issues/Incorrect-audio-video-sync-issues-WITH-DIAGNOSIS-and-FIX/idi-p/615519.  It could be the root of all the problems if the WD TV Live is at fault.

In an effort to determine if the WD TV Live is at fault, I purchased a Matricom G-Box Midnight MX2.  It is an Android streaming media player with XBMC.  A really nice box with good software.  But I found that the XBMC had the same issue with audio sync as the WD TV Live.  I had to do the same -200 ms audio sync adjustment in the software to sync the audio and video.  But here is the funny thing.  If I streamed any of the movies using the Android BSPlayer video player that I installed from the Google store, there was absolutely no audio sync issues.  Still scratching my head on that one.  Anyway, I would have kept the Matricom box but the deal breaker was the Netflix on Android is still not High Definition with Dolby Digital 5.1 sound.  So I sent the box back for a refund.

Since I was able to have the same audio sync problem on the Matricom box as I do on the WD TV Live, I am less likely to believe that the WD TV Live is actually at fault.

So now I am at a point where I have “fixed” the videos I have processed so far and now looking for a solution to produce an MP4 video that does not have audio sync issues without the “fix”.

I have tried other programs with varying results.  Ripbot264 seemed to produce an MKV at 720p and 1 audio track AC3 5.1 that has perfect sync.  I don’t really want to use Ripbot264 because it doesn’t produce the final video file that I have set for myself.

Since I really like Handrake with its ease of use and excellent encoding capabilities, I have decided to do some further trials to see what changes I can make to get it to work with the WD TV Live. 

Sparing all the gory test details, I found a solution.  When I change the profile from High to Baseline and drop the level from 4.1 to 4.0, I have perfectly synced audio with video in an MP4 container with 2 audio tracks.  After doing about 5 movies with this setting, I found that they play on all my devices without any audio delay.  Such a simple solution!

I chose to document my issues and post on this forum to see if anyone else can benefit from my experience.  I was also hoping that maybe someone with more experience might be able to explain why my solution works.  I am the type that does not try to find out “WHY?” when it comes to computers.  I like to find what works and move on.

Please feel free to comment on my experience or ask any questions.  Thanks for reading!

Thanks for this. I am sure it will be helpful.