This project has moved and is read-only. For the latest updates, please go here.

Audio Sync issues MP2/MP3/AAC in TS and AVI unprocessed profiles when commercials cut

May 20, 2013 at 10:57 PM
All was well until one of the point 2.3.12.x releases (Don't recall the precise version) conversion to WTV worked and I could follow it with wtvconverter to change the output wtv to dvr-ms to be compatible with my external media devices and all was well.

With WTV broken I've been looking for the easiest substitute, one that does not require conversion, the MPEG2 video stream in the WTV is of good quality, my goal is to change the container with minimum processing and produce output compatible with WMC and my media devices. The rub is the AC3 audio, it is not compatible with my media devices and needs to be converted to either MP2, MP3 or AAC.

I have spent hours, wade thru the documentation on this site and whatever I could find on the Internet and tried dozens of experiments, what I have found is that either the AVI MPEG-2 Unprocessed or TS Unprocessed profiles when simply substituting MP2, MP3 or libvo_aacenc for copy in ffmpeg-audioac3 and work beautifully when not removing commercials.

The moment I introduce commercial removal, no matter what permutation I try, the audio starts out in sync but comes out of sync at some random time, stopping and restart the video in either WMC or a media device restores synchronization for short periods.

In desperation I tried a two stage conversion, first cutting commercials using either of the stock unprocessed profiles and then the either of the unprocessed profiles with the MP2/MP3 or AAC conversion without commercial removal, this had logistical challenges but surprisingly did not produce usable output, still suffered from audio sync and sometimes lack of video.

I am open to any ideas, would really like to get this resolved, help appreciated.
May 21, 2013 at 12:20 AM
You're on the right track. You can also try MKV format with ffmpeg and copy for the vcodec.

Regarding Audio sync have tried updating to the latest version. There are some changes in the past few weeks that might help with commercial cutting issues.

Try using preconversioncommercialremoval=trueand false with the latest BETA

May 21, 2013 at 1:02 AM
Sounds like I can make up an MKV unprocessed similar to AVI and TS Unprocessed from your comment.

Looking at my device manual for MKV I see it supports Dolby Digital which looks to be AC-3, but I've gone down this track of conversion to MP2/MP3/AAC as I've never seen it play the AC3 from MCEBuddy output. Are there any options I can add to the ac3 codec that might alter this format? I suspect something very subtle here might be the answer.

I have been using the latest Beta, I used this mornings today. I've found that preconversioncommercialremoval helps a little, enough that I used it but does not resolve the audio sync.

I also noticed ForceWTVStreamsRemuxing=true, particularly that it only supports one audio stream, but that might be a good thing in this case?
May 21, 2013 at 2:26 AM
you can try it, never hurts. I'm a little confused about the audio sync isue. Can you upload a sample WTV file and teh profile you're using that creates teh audio sync issue, I will try to replicate and see if it can fixed.

May 22, 2013 at 1:03 AM
I uploaded the original wtv, profile and avi into a directory Audio Sync Issue. Might not have been the best choice as you have to jump to about the middle but once you do that it should be in sync, after several minutes it should come out of sync. This particular video exhibited the behavior more consistently than others.

Thank you for looking.
May 22, 2013 at 3:50 PM
I checked it out, something funny about the AVI container and ffmpeg, can't do much, during remuxing it's losing timestamp sync.

I would suggest use TS unprocessed instead of AVI unprocessed and it's working perfectly. If you need anohter format try MKV format by adding this to the profile

AVI is never a good container to use which is why I've always regretted adding support for it. If you need to use it, use the regular AVI profile
May 23, 2013 at 2:50 AM
Thank you for pointing me to MKV, it seems to work well all around but with ffmpeg it seems to add an additional remux step.

I could use your advise about volume, play back volume is relatively low, sounds about 60% of the original wtv, this is my current profile:

[MKV Unprocessed]
ffmpeg-general=-threads 0
ffmpeg-video=-vcodec copy -f mpegts -map 0:a -map 0:v
ffmpeg-audio=-acodec copy
ffmpeg-audioac3=-acodec copy -af volume=1.0

I'll try a volume boost of more that 1 db but I'm not sure why it would be so muted to start with. I have checked Multichannel audio and unchecked DRC with little effect.

Just as an interesting side note, the following worked on all but my WD Live TV Plus:

[MKV Unprocessed]

and was very fast, suffered from the identical volume issue.

Appreciate your time and help, almost there!
May 23, 2013 at 1:11 PM
Ran another test, removed the ffmpeg-remuxto=.mkv, and re-ran so I have side by side the ts which is remuxed to mkv.

Playing each I hear the difference in the audio, the audio in the mkv is noticeably muted on all devices and in WMC.

I see in the log, a program MKVMerge which is a third party application, seems to be many options, is there a way to pass options to this program?

Examining the ts and mkv side by side, the mkv is smaller, about 6.5 Gb vs. 8.5 for the ts. Examining the mediainfo I see that the text stream is dropped when remuxing the ts into the mkv and some differences in both the video and audio streams but not sure what might be significant.

Audio MediaInfo Audio #1

TS ID : 256 (0x100) - MKV ID : 1
TS Codec ID : 129 - MKV Codec ID : A_AC3

Audio MediaInfo Audio #2

TS ID : 257 (0x101) - MKV ID : 2
TS Codec ID : 129 - Codec ID : A_AC3

Any suggestion, help, advise appreciated...
May 23, 2013 at 1:34 PM
Loss of volume while converting from WTV is normal, I too have hte same issues when converting to MP4. For me the answer was simple, in the conversion task page I increased the volume slider to 2.55 and it fixed my issue.

May 23, 2013 at 1:37 PM
BTW, the loss of volume is characteriszed by the playback codec and not the remuxer. MKVMErge only changes the package from TS to MKV, does not alter the streams themselves, but the playback codec changes if I'm correct (or maybe it doesn't) either way, it the playback codec which is responsible for the audio volume.

May 23, 2013 at 3:51 PM
The forest thru the trees, didn't even see the volume slider and I've worked that panel dozens of times!

More experimenting, raising the volume all the way (1000) when producing ts files has a noticeable effect and raises the volume almost back to the original wtv. However, then running the ts thru MKVMerge reduces the volume back down to what it has been all along.

I'll take a look at the MKVMerge options and manually run it on the ts to speed the process, don't recall seeing a specific option that effects volume, all evidence so far is it is reducing volume to a per-determined level which is just low even to make it difficult to understand speech even with Windows and MCE volume at 100%.
May 23, 2013 at 10:01 PM
Found a working solution, aac audio, changing the ac3 audio profile line to:

ffmpeg-audioac3=-acodec aac -ab 256k -strict experimental -cutoff 15000

Produces good results, good audio, good video with default settings in the profile.

Not sure what was up with MKVMerge but it is working with aac.

May 23, 2013 at 10:54 PM
you can try one more thing, instead of ffmpeg-remuxto you can use ffmpeg-ext=mkv (which will use ffmpeg and mkvmerge)

May 23, 2013 at 10:54 PM

May 23, 2013 at 10:55 PM
if you're using ac3 audio try enabling DRC which typically will boost the volume

May 24, 2013 at 11:32 AM
I've been wondering why one had to do something like this:


and not just as you suggested, go directly to mkv, now I see you can and that is very helpful.

The final profile I ended up with is:

[MKV Unprocessed Video AAC Audio]
ffmpeg-general=-threads 0
ffmpeg-video=-vcodec copy -map 0:a -map 0:v
ffmpeg-audio=-acodec copy
ffmpeg-audioac3=-acodec aac -ab 256k -ac 2 -strict experimental -cutoff 15000

My inclination after my struggle to find a replacement container for WTV and volume issues with AC-3 is to suggest that perhaps this profile or similar should be added to the standard profiles to help others. The minor down side is MKV files in Windows 7 and WMC do not show meta data, a trade off I can live with.

Appreciate the help, open to any improvements to the above profile.
May 24, 2013 at 1:52 PM
ffmpeg is good at mkv conversions but sometimes may have an issue, if you face it then try remuxing to mkv since that uses mkvmerge

May 24, 2013 at 2:45 PM
Interesting you should post about problems with mkv conversions, last night the majority of the recordings were success but two failed that look to be caused by rain and wind that caused pixelation and break up, in both cases the failure was AFTER commercial removal, so yes, trying a more vigorous conversion on recordings I care about would be excellent.

I'll add an enhancement request, I'm thinking it would be great on failed conversions that have gotten this far, it would be great to be able to specify a directory to move this TS that could be either handled manually or by another monitor. Failing this or in addition to, for failed conversions, it would be great to have another setting in regard to what to do with the original file (ie delete, archive, sync), to specify a failed folder. Again these could then either be manually processed or the target of a monitor to do more vigorous processing.
May 24, 2013 at 5:46 PM
It's much simpler. If you are deletin or archiving original files the only files left behind would be those which failed conversion. But I will look into an idea for a button to show a history of files and their status.

May 25, 2013 at 10:43 AM
I see you've already added the a button to show history, very useful and of course you are correct about the failed files being left behind but what I was trying to get at was a method of making sure there is a disposition of all files and more to the point a method of automation. By moving the failed files to another directory, since it is easy and possible to define additional monitors to pickup the files and process. In my situation the failure rate is not high, not a big deal but it would be slick and IMHO consistent with the existing architecture.

Thank you, will start testing the latest beta this weekend.
May 27, 2013 at 1:02 AM
Done, next build you'll see an option for failed conversion move original. There's a new settings windows through whichyou can access it.