The video will have noise and we need to listen to the video and pick the section which have only noise so that we can remove that from the video.
ffmpeg -i input.mp4 -ss 00:00:13.000 -t 00:00:02 noise.wav
The same noise file can be used for cleaning all the videos taken in the that room.
-
Extract the audio from the video
$ ffmpeg -i input.mp4 -sameq tmpaud.wav
-
Create noise profile from noise file.
$ sox noise.wav -n noiseprof noise.prof
-
Remove noise
$ sox tmpaud.wav tmpaud-clean.wav noisered noise.prof 0.21
Referene: http://www.zoharbabin.com/how-to-do-noise-reduction-using-ffmpeg-and-sox
$ /usr/local/bin/ffmpeg -i input.mp4 -itsoffset -0.9 -i tmpaud-clean.wav -map 0:0 -map 1:0 -acodec aac -strict -2 -vcodec copy output.mp4
We've also added audio offset of 0.9 seconds here. This you'll have to listen to the audio and figureout how much is the delay between audio and video.
ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:00:20.000 output.mp4