Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4022402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:28:14+00:00 2026-05-20T10:28:14+00:00

I have an application that lets users record video from their webcams. The users

  • 0

I have an application that lets users record video from their webcams. The users record 3 clips, which are then combined into one video for playback.

I am having issues with the audio and video on the third clip sometimes being out of sync after converting to MP4.

Here’s how the process works now-

Combine AVI video files and insert transition videos in between using Mencoder to combine avi files.

mencoder.exe -oac copy -ovc copy -idx -o test.avi c:\temp\*.avi 

I get this error:

Muxer frame buffer cannot allocate memory!

1 duplicate frame(s)! 
1 duplicate frame(s)! 
1 duplicate frame(s)!
1 duplicate frame(s)! 
1 duplicate frame(s)! 
1 duplicate frame(s)!

However, the video is combined to avi and this AVI plays back without any audio sync issues.

Reindex using mencoder

mencoder.exe -idx TEST.AVI 

The video still plays fine at this point as an AVI.

Convert the AVI to MP4 using ffmpeg batch file:

set FFMPEG_DATADIR=c:\Presets
ffmpeg.exe -i "test.avi" -s 640x480 -y -strict experimental -acodec aac \
   -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vpre medium -vpre ipod640 -r 24 \
   -g 48 -b 520000 -threads 64 "out.mp4"

This all has to be done programmatically (no video editing GUI software) using command line tools in Windows.

Here are sample avi and mp4 files. The audio / video sync happens around the 1:03 mark. AVI doesn’t get out of sync, while the mp4 does.

http://trtemp.s3.amazonaws.com/new.avi

http://trtemp.s3.amazonaws.com/new.mp4

Does anyone have any suggestions to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:28:14+00:00Added an answer on May 20, 2026 at 10:28 am

    A couple of things:

    • I don’t find the source composite audio sync to be exactly perfect. It would be interesting to also see the original three source clips. A general rule is to always start with the highest quality source possible.
    • Can we assume the source three clips also have 48kHz 16-bit stereo audio too? If there is a conversion going on there then maybe this is an issue.
    • FFmpeg’s internal aac CODEC is experimental, and that is why you have to have that -strict experimental switch. Since you are having audio sync issues, this is an obvious candidate problem area. Consider using libfaac if available. (You very well may have to build your own FFmpeg compile.)
    • Using -threads 64 is not going to make it go faster no matter how many cores you have. Follow the generally accepted convention of # cores * 3 / 2. So, if you have 4 cores, the mast is 4 * 3 / 2 = 6. My own experiments with the -threads shows diminishing rates of return with each thread over 4-6 which zeros out (no benefit whatsoever) over 12-16 threads. At best, 64 threads will no have no impact. At worst, it will be slower or degrading the quality of your result.
    • Experiment with the -copyts option. “Copy timestamps from input to output.”
    • Experiment with the -async switch.

    Audio sync method.
    “Stretches/squeezes” the audio stream
    to match the timestamps, the parameter
    is the maximum samples per second by
    which the audio is changed. -async 1
    is a special case where only the start
    of the audio stream is corrected
    without any later correction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an ASP.NET application that allows users to edit and insert data
I am developing an application that uses Entity Framework and WPF with MVVM design
I have two applications that use same database. Let's call them Site and API.
I have an application with a very simple UI. Most of the work (bulk
(MAC) hi... i m using a policy banner application which writes something on a
As part of a loading screen for an offline-enabled web application I'm building (
I'm wondering what's better for my server (speed, etc), considering CPU, bandwidth and diskspace
Im just getting started on this whole WPF thing, and need to understand some
I want to learn how practical using an LDAP server (say AD) as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.