I 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.
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.
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-issu...X/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 Handbrake 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!
+ Reply to Thread
Results 1 to 9 of 9
So the problem is only with variable frame rate MP4? Why not just use constant frame rate? VFR rarely gives you more than 1 or 2 percent better compression, at the expense of compatibility with a lot of players. It's not a good tradeoff.
Thanks for the reply, jagabo.
Actually, anytime I selected Constant Frame Rate and checked the encoded file with MediaInfo, it still showed the video as Variable Frame Rate. So either MediaInfo doesn't report properly or there is a setting in Handbrake that overrides the Constant Frame Rate setting making it continue to be Variable Frame Rate. I did read in numerous places that MP4 container didn't like Variable Frame Rate but any trials I did, did not seem to make any difference.
When I had Handbrake configured to High Profile 4.1, I would get audio sync issues with either CFR or VFR.
It wasn't until I changed the Profile and Level that I was able to get audio sync. I have audio sync whether I have CFR or VFR selected.
If your MKV is in sync, then muxing to MP4, the resulting video SHOULD be in sync. But it depends on what you want. There are programs that you can take your audio and video from the MKV container and drop it into the MP4 container. You might lose some features of the MKV because the MP4 doesn't hold as much information (audio tracks, subtitle support, etc). It may be possible to switch containers without any recoding so that you can keep the video and audio track(s) as there were in the MKV container which would save a ton of time.MovieWatcher666
Handbrake SHOULD create an CFR MP4. And WDTV Live SHOULD play High/4.1 MP4 with proper A/V sync.
Regarding mediainfo and CFR/VFR, a few people in the handbrake forum are saying mediainfo incorrectly reports cfr as vfr. That might be possible. TV DVDs that I encode to mp4 with handbrake (set to 23.976 constant frame rate) are identified by mediainfo as variable frame rate, sometimes with unusual max frame rate.
Frame rate mode : Variable
Frame rate : 23.976 fps
Minimum frame rate : 23.974 fps
Maximum frame rate : 90 000.000 fps
Mediainfo will report cfr if I use a mkv container.
Through all my searching on the net I thought that I read that MediaInfo was reporting frames rates incorrectly but I couldn't remember where. There was also another program recommended that does the same thing as MediaInfo but I can't remember that name of it either. It was apparently reporting proper frame rates.MovieWatcher666