ORB-HD / deface

Video anonymization by face detection
MIT License
684 stars 95 forks source link

Any idea how to keep the audio? #4

Closed eladcandroid closed 1 year ago

mdraw commented 4 years ago

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?

mrmattnewell commented 3 years ago

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?

mdraw commented 2 years ago

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.

eisraeli commented 1 year ago

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

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