View Full Version : how to cut off audio to match video length when muxing mp4?
lansing
27th July 2012, 01:01
I wanted to mux video and audio in a mp4, but the audio is longer than the video, and every time I tried to mux, the final output info still shows the length of the audio. How do I cut off the excessive part?
blubb444
27th July 2012, 02:01
It really depends on how the audio is encoded. If it's in a lossless format like PCM (WAV) or FLAC, you can simply import it into let's say Audacity, trim it there, re-export it as lossless and mux it, this way you don't have any quality degradation. If it's MP3 then you can still cut losslessly with tools like mp3DirectCut. I don't know if there are similar tools for other common codecs such as AAC or AC3.
Be aware though that the MP4 container officially supports only MP1, MP2, MP3, AAC and sometimes AC3 as audio streams. If you have another audio file, simply mux as MKV, unless you want to play it on a device that only supports MP4.
lansing
27th July 2012, 02:43
ok I tried with mkv, everything works as expected, i guess mp4 container are still not smart enough yet.
sneaker_ger
27th July 2012, 05:13
Tracks can have different lengths in mkv, too. It's not a really question of mp4 vs mkv.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.