PDA

View Full Version : How to adjust audio stream



mrcreosote
November 2nd, 2009, 11:46 AM
Hi:

DVDDecrypter
VideoReDo Plus Beta 2.5.7.604
HandBrake 0.9.3

This is my first post to this forum. Let me say how very impressed I am with VideoRedo - much better than another program I had tried (Avi*****). Keep up the excellent work!

I have encountered a problem, and would be grateful for advice. I only started recording TV shows to a DVD recorder 2 months ago, and there has been tons to learn about video formats and editing, so go easy please!

OK. I've got my DVD source (.mp2 and.ac3 in .VOB container). Next step, DVD Decrypter to rip the TV program as a single (large) .VOB with no stream demuxing. Onto VideoRedo. Put the .VOB once through the QuickStream Fix rinse. Back to VideoReDo to trim commericals from the post-QSF file. Save the edited file as .MPEG, straight pass-thru .mp2 and .ac3 (i.e. no encoding at this stage). Lastly, encode the edited .MPEG with HandBrake (H.264 and .aac in .MP4 container).

This sequence has worked fine - until I ran into a problem with a particular TV show recording.

I use MediaPlayerClassic. When I use MPC to check the .MPEG file saved in VideoReDo, audio sync is perfectly fine all thoughout the TV show.

However, when I check the same program after encoding as .MP4 with HandBrake, audio is clearly out of sync. By fiddling with audio shift in MPC, it turns out the audio must be brought forward 175ms. When I do that, the .MP4 plays in sync from start to end. So I guess the audio sync issue is "constant" i.e. doesn't flutter at different points in the TV show.

(Any thoughts on why the .MPEG file plays in sync versus .MP4 file which doesn't? I am guessing that the playback engine in VideoReDo and MPC "sees" that the audio is 175ms late and adjusts accordingly at playback, while HandBrake lines up the video and audio streams at "point zero" and introduces at 175ms shift at encoding aka the audio starts 175ms too soon. I must admit this is a total newbie guess, and would happily be corrected.)

I had hoped to use VideoReDo to embed the audio shift by using Tools>Adjust Audio and moving the slider forward 175ms. But when I save the .MPEG file and subsequently encode wiht HandBrake in .MP4, no change i.e. .MPEG file in sync, .MP4 file still out 175ms.

Question: How do you use VideoReDo to save a 175ms shift in the audio stream?

Thank you in advance for your reply.

txporter
November 2nd, 2009, 12:44 PM
It could have to do with how you are encoding with Handbrake. You might be better off heading over to that forum (http://forum.handbrake.fr/) to ask the question.

It is likely due to conversion from interlaced video to progressive. You can try forcing the video to a certain frame rate rather than letting Handbrake decide. You can also try with/without detelecine/decomb to see if that makes a difference.

mrcreosote
November 2nd, 2009, 01:23 PM
Thanks for the quick reply. I'm grateful for the advice.

While HandBrake may be part of the issue, I do have a real question about VideoReDo.

Namely, how do you shift the audio stream and save the shift in a new .MPEG file?

I mean, does the Tools>Audio Adjust only make a difference at playback within VideoReDo, or can you use that setting to save a shift in audio to a new .MPEG file?

Thanks again for considering my question.

txporter
November 2nd, 2009, 01:58 PM
Based on this post (http://www.videoredo.net/msgBoard/showthread.php?t=9391), it seems like you should be able to adjust the audio on the MPEG with the Adjust Audio tool.

I use VRD+ quite a bit, but I haven't used DVDDecrypter in quite some time. I use AnyDVD now, and just rip the whole thing to my HDD. Then I just use Open DVD Folder from within VRD+ to open up the ripped files. I haven't had any audio sync issues that I can notice.

I burn in all of my subs now when I create mp4s. If the DVD contains subs, then I rip the DVD with AnyDVD and open those files directly in Handbrake to do my conversions. If the DVD has captions rather than subs, then I open the DVD in VRD+ and output as a file. I then rip the captions with T2SAMI and burn them back in with XVID4PSP when converting to mp4. With either method, I haven't noticed an audio/video sync issue. It is possible that it is coming from the use of Decrypter (although I would expect QSF to fix any of those issues) or from your mp4 conversion settings. Of course it is possible that it is something from VRD, but I haven't noticed anything in ~4 years of use that makes me think VRD causes sync issues.

zaphod7501
November 2nd, 2009, 06:34 PM
I mean, does the Tools>Audio Adjust only make a difference at playback within VideoReDo, or can you use that setting to save a shift in audio to a new .MPEG file?

Thanks again for considering my question.
Yes you can save the audio corrected file. After applying the correction, close the box and save the file to a new name.

mrcreosote
November 6th, 2009, 02:16 PM
Thanks zaphod, sorry I took so long to acknowledge your reply. I'll try your recommended method next chance I get.

In the spirit of sharing info for the sake of helping others, I want to explain what (I think) I've learned. I recognize that what follows only touches on VideoReDo Plus tangentially, but I do have genuine VRD+ questions at the end of this post!

Per my first post, the issue is .MPEG (.mp2 and .ac3) files that play back in audio-video (lip) sync after ripping with DVDDecrypter and editing with VRD+, but fall out of sync after encoding to .MP4 (H.264 and .aac) with HandBrake. Just a reminder, I use Media Player Classic (MPC) to verify my files at every stage.

After scouring the HandBrake forum, I came across a key post. The issue was: what happens when the video stream in a recording starts before the audio stream? (I don't mean a "leading silence" - I mean for example when the first 2 video frames have no audio stream associated with them, or to put it another way, the audio stream only starts in the 3rd frame.) The poster claimed that MPC only starts playback at the point where the audio stream begins! In this way, the first 2 video frames are discarded by MPC, but the audio starts in sync with the 3rd video frame onwards.

A Google search was unable to confirm this statement. But in my (very) limited experience, it makes sense. To analyse my .MPEG, I used DGIndex's timestamp utility, which reported back that the audio was (on average) ~135ms behind the video i.e. the audio stream only starts 135ms after the video stream begins. Similarly, the blue line in VRD+'s Audio Graph does not appear until the 3rd frame, ~150ms after the video stream begins. Yet on playback with MPC, my .MPEG is in lip sync! So I'm ready to accept what the HandBrake forum poster said - MPC only starts playback where the audio stream begins. Do you agree? - if this is wrong, please reply to set the record (& me) straight.

OK, for .MPEGs where the first 2 video frames have no associated audio, what happens when you encode to .MP4? Again, the HandBrake forum suggests that by design, HandBrake lines up the video and audio streams at the same "point zero" and starts to encode to .MP4 from there. That means the audio stream is encoded to start at the 1st video frame, not the 3rd. Out of sync! - which is confirmed when playing back the encoded .MP4. In MPC, I have to use View>Options>Internal Filters>Audio Switcher and enter "+175ms" to delay the audio stream relative to the video stream. In effect, I have forced MPC to start audio playback at the 3rd video frame. Presto, the .MP4 is back in lip sync! (At least to my eyes, +175ms looked better than +135ms suggested by DGIndex, but the principle is the same.)

So how to encode an .MP4 in sync? Well, before zaphod replied, I admit I went back to Avi***** and "copied" with a +175ms timeshift the .MPEG I edited with VRD+. Using HandBrake to encode that +175ms timeshifted file, the resulting .MP4 played back in perfect lip sync in MPC with no audio delay adjustment required at playback. What did Avi***** do to solve the problem? A careful listen makes plain that Avi***** lined up the video and audio streams at "point zero", but 175ms into the program Avi***** restarted the audio stream. So you get "1st frame/1st sound", "2nd frame/2nd sound" and then at 175ms the critical "3rd frame/1st sound", "4th frame/2nd sound", "5th frame/3rd sound" and so on. We are in sync again! (A tell-tale "stutter" at the beginning of the .MP4 gives it away - "1st sound, 2nd sound, 1st sound, 2nd sound, 3rd sound, etc.")

This is how I understand matters, and I only want to sincerely share information to be helpful to others. But please, for the benefit of all who read this thread, any expert who trumps my limited experience should correct any misinformation.

My VideoReDo Plus questions.

1. Using Tools>Audio Adjust in VRD+ to introduce a +175ms timeshift, does VRD+ behave the same way as Avi***** i.e. restart the audio stream +175ms into the program? If not, what does Tools>Audio Adjust do to the audio stream?

2. Looking at VRD+'s Audio Graph to gauge the delay between the video and audio streams seems very imprecise. Does VRD+ have a better way to precisely measure the difference between where the video stream and the audio stream starts? Or is DGIndex the only way? Or is there a better way?

Thanks you for your patience reading this long post, and also thanks in advance for your reply.

phd
November 6th, 2009, 08:53 PM
If you manually adjust the sync in VRD, an appropriate number of frames would be cropped so both have the same length