[FFmpeg-user] merging mp4 (h.264) and aac with acodec copy doesn't work

Marc ffmpeg at schmaili.com
Wed Jul 4 18:41:56 CEST 2012


I have a mp4 video clip (h.264) and a aac audio clip and try to merge 
them together with

   ffmpeg  "'.$videotrack.'" -i "'.$audiotrack2.'" -vcodec copy -acodec 
copy "'.$targetFile.'"

but it doesn't work. Only a very small target file is created  (28 kb 
instead of about 16 mb) which is corrupt. It only works if I replace the 
copy parameter with the aac audio codec. But I need this for a very time 
critical project so I do not want to reencode it because this takes too 
much time. Is it impossible to merge together a mp4 (h.264) video track 
and a aac audio track together with the copy parameter? If so, is there 
a workaround for it?

Best regards

More information about the ffmpeg-user mailing list