I am using java process builder to merge audio and video files on OS X (10.6.4) but it is working too slow, for a audio and video of around 15sec it is taking around 1 hour to merge which is tooooo... much. could some tell me what could be the issue?

The merge command:

ffmpeg -i audioFile.au -i videoFile.mp4 -sameq -ar 4100 -y mergedFile.mp4

FFmpeg version:

  • What are your hardware specs? What are the specifics of the video (resolution, bitrate, etc.)? – slhck May 18 '11 at 14:57
  • Are you using Java or ffmpeg? Your quoted line only shows ffmpeg. Are you starting it from a Java process? If so, try starting it from the shell and see whether it's equally slow. – CarlF May 18 '11 at 16:04
  • Is it possible to post the video and audio files somewhere where others can experiment with them? Do you have the same problem with other audio and video files, or only these specific files? – CarlF May 19 '11 at 12:18

Try this out:

ffmpeg -i audioFile.au -i videoFile.mp4 -ar 4100 -y -vcodec copy mergedFile.mp4  

When supplied -vcodec copy, ffmpeg just copies the video stream instead of reencoding. If you do not need an audio reencode as well, you could use:

ffmpeg -i audioFile.au -i videoFile.mp4 -y -acodec copy -vcodec copy mergedFile.mp4  
| improve this answer | |
  • WoW, it's so much faster, Can you explain what this parameters do? -y -acodec copy -vcodec copy – Ali Akhtari Apr 11 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.