Encoder delays video/advances audio out of sync MEP17

tom-holden wrote on 5/5/2019, 9:39 PM

This is a fork from the discussion Burn abort (encoder error) MEP17 in which system details were provided. The movie in question was assembled from 11 MTS HDTV files shot from a Sony camera. The files were assembled in sequence with minor edits, titles, 9 chapter markers - nothing fancy. The audio was on the left channel only so it was converted to mono. Audio and video are in sync when played from the arranger, anywhere in the movie. However, every Export and Burn I've tried, MPEG-2, MP4, WMV has audio and video going progressively out of sync until at the end, audio leads video by around 2.4 seconds!

Examining the 11 source MTS files, the following "Audio Delay relative to video" stats are reported:

-67 ms
-619
-617
-572
-600 Subtotal = -2475 ms
-67
-598
-585
-583
-602
-589 Subtotal = -3024 ms
-------
-5499 ms

I'm not sure what this parameter means and if it has any bearing on the problem. The first subtotal is close to the observed delay but that may be coincidence and totalling the individual delays may be pointless. From what I have found, the camera is flagging that there is this offset between the video and audio streams in that file. If that's the case, then the editor/arranger is compensating for those delays very well (near 100%) while the encoder is doing poorly, i.e., only 55% if one were to consider the delays to be cumulative.

Can anyone shed any light on what's going on, going wrong and if there is a setting or fix for it?

Thanks,

Tom

Comments

johnebaker wrote on 5/6/2019, 4:19 PM

@tom-holden

Hi

. . . . The audio was on the left channel only so it was converted to mono . . . .

This may be the cause of the issue, ideally you should duplicate the left channel into the right channel and export with the audio setting as the default ie stereo - 48 kHz (48000) samplerate. The audio will still appear centre stage.

To duplicate the left channel into the right channel select right click the video clips and select Audio function, Audio Cleaning then select the tab an options shown below

HTH

John EB

 

 

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

tom-holden wrote on 5/6/2019, 10:06 PM

John, I tried your suggestion although I was dubious that it would have any benefit. As best I remember, the audio stream is always two channels or more and that these options merely set flags in the frames to tell the decoder what to do with them. Whether that's right or wrong, the "DVD quality" MPEG-2 file I created slips sync just as the others do.

The export failed with about 23 minutes to go at 1:33. The MPG file is playable and sync was off by about 2 seconds at the end. The file size is 4.13 GB (4,438,325,248 bytes) which is similar to the "estimated split point" for dual layer DVD and a little more than FAT32's file size limit of 4GB, neither of which may have any connection to the failure. For reference, file properties reports the video encoded at 8000kbps, total at 8224kbps, frame rate 29.97fps (same as the source MTS files).

Your comment in another post about frame rate may be the key to my problem. If the Export/Burn procedure decodes the 29.97fps source into a 30fps intermediary and encodes back to 29.97, there is potential for slippage if there is an error in reframing in either the video stream or audio stream. The discrepancy between the two rates is 0.1%. If that is the sole factor in slippage, over the course of 110 minutes it would amount 6.6s. Subjectively, I see 2.4s so maybe there is an internal error.

Or, has the audio become independent of the video as a result of my machinations? In the editor, I can move them separately. Is there a way to lock them back together?

Tom

johnebaker wrote on 5/7/2019, 5:35 AM

@tom-holden

Hi

If the audio has been modified externally ie seperated from the video for adjustment or is from a separate recording device then this is likely that it is no not synced to the video, so a slight clock rate (time) drift is possible.

You could try stretching the audio by 2.4 secs to see if this improves the synchronisation.

. . . . the audio stream is always two channels or more and that these options merely set flags in the frames to tell the decoder what to do with them. Whether that's right or wrong . . . .

IIRC that is for 5.1 and higher surround sound and the flags tell the decoder which streams, for 5.1 there are 3, goes to which speakers.

For stereo the method I indicated actually copies the left (or right) into the other channel.

HTH

John EB

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

tom-holden wrote on 5/7/2019, 4:18 PM

For stretching audio, I've learned that:

  1. You can't simply grab the end of the audio clip in the Arranger and drag it to the new length.
  2. Time stretch is an Audio Effect based on Tempo, not duration, which means having to convert the desired positive stretch in time to a negative adjustment in beats-per-minute, 120bpm being equivalent to 1x speed. For my case, I am trying tempos such as 119.956
  3. The MEP17 Time Processor displays Tempo to the first decimal place after coming back to it so 119.956 becomes 119.9 in the display. Not sure if it stores the setting to 3 decimal places but does seem to initially process to that resolution.
  4. You cannot apply the stretch proportionate to elapsed time across a group of audio objects; each is processed independently. The movie has to be exported and that file, now having just one audio object, can be audio stretched. Advisably, export to a high quality format to lower the risk of degradation due to multiple conversions.
  5. This contiguous intermediate file's audio is no longer in sync with the video. Use stretch to restore sync. At this point, add any Chapter Markers and other metadata that does not carry through from the initial project.
  6. Export this synchronised file to the desired end format as a test file to estimate how far out of sync the audio becomes in this file over its length.
  7. Now stretch the high quality intermediate file so it is out of synch by the same amount opposite to that of the test file. Export again using exactly the same settings as for the test file.
  8. Check synch. If not close enough, reiterate from 7, tweaking the Tempo as needed.

Have I succeeded in restoring sync to my movie. No. I've attempted with a shorter MOV movie from a different camera and got in the ballpark. Discovered that Batch Convert of the source file to a MP4 as my test file used settings different from Export and affects how much the audio gets negatively delayed (advanced).

This has been such an exercise that I'm on the verge of throwing up my hands and giving in to buying some new video editing software. MEP17 may not be incompatible with Windows 10 but it surely is with me! (And I even got Windows MovieMaker running under Win10 on my old laptop...)

tom-holden wrote on 5/10/2019, 9:56 PM

Final report. Abandoned MEP17+. Discovered that Windows 10 Photos app has a basic movie assembly and editing feature, storyboard style. I was able to throw together the 11 files, trimmed a couple, added pages of titles, images, credits and exported to its Small format MP4. Export took a couple of hours (a bit longer than real time) and came out in a 2GB file at 960x540, 30fps, 2301kbps with audio at 48kHz sample rate, 2-ch, AAC-LC, 128kbps. Audio and video quality are okay and there was no shift between them. The program has no means for converting the left channel (the one with audio content) into both channels or mono. While I cannot make scrolling credits nor place more than one caption in a clip, this not-so-slick movie is adequate for my purpose.

In short order I had it uploaded to my Google Drive, then moved it to my Google Photos folder whereupon I discovered that my YouTube account could import it from Photos. I dropped a running list (the same as what would have been the chapter markers on the DVD) into the YouTube Description and was pleasantly surprised that it converted all of the time marks into hyperlinks. With a little more research into such hyperlinks, I developed the list of 'chapter' markers that can be emailed or otherwise made available to others.

I've watched the movie on an Apple TV and on a smart TV. On those, I don't see a way to get at the YouTube Description and its hyperlinks as an equivalent to the DVD menu. Not a problem with a smartphone, tablet or computer.

Looking back in my Magix account and email, I see that I registered MEP17+ in 2011 and last raised a support ticket in 2016 about a DLLAV32.dll error when trying to write a DVD. While that must have been on a Windows 7 laptop, the agent stated that MEP17+ was not supported on Windows 8 and 10. It's odd that I got as far as I did on Windows 10 but I still contend that the audio shift issue cannot be caused by the OS - it has to be a MEP+ flaw that is so fundamental to movie making that the product should not have been released with it present.

I'm unsure that I will ever upgrade to a contemporary MEP given my experiences with earlier versions when they were current and given the cost of ongoing support. I'll have to give some careful thought as to what my movie making needs are going to be. Might they be satisfied by Photos or the rumoured successor to MS MovieMaker? Or if I need a power tool, maybe the free DaVinci Resolve...

Thanks to @emmrecs and @johnebaker for your patience and efforts to help.