deface icon indicating copy to clipboard operation
deface copied to clipboard

Any idea how to keep the audio?

Open eladcandroid opened this issue 4 years ago • 3 comments

eladcandroid avatar Nov 17 '20 13:11 eladcandroid

Since the video processing code is based on imagio, there is no easy way to integrate this functionality inside the code, but with ffmpeg you can easily merge the audio track of your original file (let's call it video1.mp4) and the anonymized video without sound that is produced by deface (video1_anonymized.mp4) and write it to a new video file (video1_anonymized_with_original_sound.mp4):

ffmpeg -i video1_anonymized.mp4 -i video1.mp4 -c copy -map 0:v:0 -map 1:a:0 video1_anonymized_with_original_sound.mp4

Does this help you?

mdraw avatar Nov 26 '20 01:11 mdraw

noob question - I'm only just taking a first look, but could this be passed into the --ffmpeg-config option to do this all in one go?

mrmattnewell avatar Jul 06 '21 13:07 mrmattnewell

Automatic audio transfer from soure videos should be easy to implement once https://github.com/imageio/imageio/pull/799 is merged and released I hope.

mdraw avatar May 18 '22 13:05 mdraw

@mdraw https://github.com/imageio/imageio/pull/882 was merged

I think an argument like --keep-audio would be extremely useful.

eisraeli avatar Apr 12 '23 13:04 eisraeli