Reply to topic

ffmpeg - replace sound without re encoding video advice...

kalimerox
Registered Member
Posts
175
Karma
0
I m looking for a solution to replace the audio in a video file, without re encoding the video...the idea is to render a first draw of a film and then replace the audio in process of editing the sound design, without touching the picture (and making lossy renderings from there.. )


do you have an idea how this could be done? i guess with an ffmpeg command this should be possible, but i m so bad with the commandline i m afraid.. if anyone could give me an example how to type this in? i searched the forums and found that the optin
-codec copy

should make it possible? But how would i do that, saying i have a video.mp4 and want to replace the
sounda.wav
with a
soundb.wav
?


Thank you :) :)
capslock
Registered Member
Posts
698
Karma
4
OS
What you want to do is called remuxing and muxing: Separate video and audio from a container. Then you want to mux the new audio and video. Maybe this article helps: http://stackoverflow.com/questions/1293 ... ping-issue
kalimerox
Registered Member
Posts
175
Karma
0
thanks capslock,

it s easier to search for when you know the right terms, I ll look it up ...
kalimerox
Registered Member
Posts
175
Karma
0
think it worked out!

i used this command to change the audio of a video file , hopefully without re encoding the video

f
Code: Select all
fmpeg -i input.mp4 -i input.mp3 -c copy -map 0:0 -map 1:0 output.mp4



difficulty i had was: i wanted to use a .wav file as the sound source, but this didnt work out, i had to convert the audio to aac before with audacity...
User avatar CorrosiveTruths
Registered Member
Posts
87
Karma
0
OS
kalimerox wrote:think it worked out!

i used this command to change the audio of a video file , hopefully without re encoding the video

f
Code: Select all
fmpeg -i input.mp4 -i input.mp3 -c copy -map 0:0 -map 1:0 output.mp4



difficulty i had was: i wanted to use a .wav file as the sound source, but this didnt work out, i had to convert the audio to aac before with audacity...


If you did something liiiikkkee:

ffmpeg -i input.mp4 -i input.wav -acodec aac -vcodec copy -map 0:0 -map 1:0 output.mp4

that would have recoded the wav to whatever you wanted (aac in this case), you can specify which streams you want to copy or not.
kalimerox
Registered Member
Posts
175
Karma
0

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], boospy007, claydoh, Exabot [Bot], Google [Bot], nshiell, Sogou [Bot], TG