Since this involves compressing the file, it will take (much longer) than the first method. h264 video and aac audio compression: ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest -c:v mpeg4 -c:a aac output.mp4 Remove all audio streams / tracks ffmpeg -i input -map 0 -map -0:a -c copy output -map 0 selects all streams from the input.-map -0:a then deselects all audio streams from the input. The stream index starts counting from 0, so audio stream 10 would be 0:a:9. If you want to convert (and compress) the file in one operation, you can use this one-liner to export an MP4 file with. map -0:a:2 then deselects audio stream 3. Note that this is a lossless (and fast) procedure, it will just copy the content from the source files. The output.avi file will have the same video content as input2.avi, but with audio from input1.mp4. Then you can use this one-liner to copy the audio from one file to the other: ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest output.avi with this commandline I put an audio track to a mp4 that don't have any audio: ffmpeg.exe -y -i source.mp4 -i audiotrack.wav -vcodec copy -c:a ac3 -b:a 256k -aspect 16:9 output.mp4 Now I wonder: and for audio replacement and IF the source.mp4 have jet any audio track (or audio tracks) can I modify the commandline so that the only audio that.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |