Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any idea how to keep the audio? #4

Closed
eladcandroid opened this issue Nov 17, 2020 · 4 comments
Closed

Any idea how to keep the audio? #4

eladcandroid opened this issue Nov 17, 2020 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@eladcandroid
Copy link

No description provided.

@mdraw
Copy link
Member

mdraw commented Nov 26, 2020

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
Copy link

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
Copy link
Member

mdraw commented May 18, 2022

Automatic audio transfer from soure videos should be easy to implement once imageio/imageio#799 is merged and released I hope.

@mdraw mdraw added enhancement New feature or request question Further information is requested labels Jun 7, 2022
@eisraeli
Copy link

@mdraw imageio/imageio#882 was merged

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

@mdraw mdraw closed this as completed in 48b655e Apr 23, 2023
StealUrKill pushed a commit to StealUrKill/anonfaces that referenced this issue Sep 21, 2023
commit 1976ac5
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Wed Jul 19 16:06:50 2023 +0200

    readme: Add docs for mosaic filter

commit 4a91126
Merge: 7082b35 d9393c6
Author: Martin Drawitsch <martin.drawitsch@gmail.com>
Date:   Wed Jul 19 16:01:07 2023 +0200

    Merge pull request ORB-HD#42 from Shazi199/master

    add replace with mosaic option

commit d9393c6
Author: shazi199 <shazi199@gmail.com>
Date:   Fri Jul 14 16:40:00 2023 +0800

    add replace with mosaic option

commit 7082b35
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Tue Jul 4 15:36:59 2023 +0200

    Use LRU cache for shape transformation

    Only cache transform if shapes are actually the same

commit 814e6a2
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Tue Jul 4 15:22:23 2023 +0200

    Don't cache input shapes because they can vary

    Input shape transforms were previously only calculated once (i.e. for
    one frame / one image) and then cached for all subsequent calls.
    This is fine in 99% of use cases but if you want to process differently
    shaped inputs in the same deface process (given multiple input paths),
    this leads to crashes or even silently incorrect outputs.

    Transforms now have to be recalculated for each frame but this is
    very cheap, so it's okay to do this for the sake of better stability.

    Fixes ORB-HD#41

commit a023f97
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Mon Jul 3 22:54:34 2023 +0200

    Switch model to bn-optimized version, update docs

    Slightly improves resource usage. End results are the same.
    Closes ORB-HD#39.

commit c555264
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Mon Jun 5 03:24:33 2023 +0200

    Auto-select optimal ORT Execution Provider

    Accelerated onnxruntime execution providers like OpenVINO are now
    automatically selected for inference if available. The presumably fastest
    provider is chosen by default. To override this choice you can use the new
    --execution-provider CLI argument.

    Fixes ORB-HD#40.

commit ca5c651
Author: Martin Drawitsch <martin.drawitsch@gmail.com>
Date:   Tue May 2 01:05:37 2023 +0200

    readme: Add links to badges

commit 5647935
Author: Martin Drawitsch <martin.drawitsch@gmail.com>
Date:   Mon May 1 22:34:42 2023 +0200

    readme: Add badges for PyPI and build

commit f80dfaa
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Mon May 1 22:19:12 2023 +0200

    readme: Update description

commit 79f4cb4
Author: Martin Drawitsch <martin.drawitsch@gmail.com>
Date:   Mon May 1 14:44:15 2023 +0200

    Use github workflow for publishing

    Publish on PyPI automatically when a tagged release is detected.

commit 5ae6ded
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Mon Apr 24 02:32:55 2023 +0200

    Switch to pyproject.toml for meta data and build

    Eliminating the need for many setup files and versioneer

commit 48b655e
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Mon Apr 24 01:44:02 2023 +0200

    Add --keep-audio option

    With --keep-audio the audio track is carried over to the output file if
    the input is a video.

    Fixes ORB-HD#4

commit 0d2eba8
Merge: 852286e d013a08
Author: Martin Drawitsch <martin.drawitsch@gmail.com>
Date:   Tue Jan 10 17:47:42 2023 +0100

    Merge pull request ORB-HD#28 from mysablehats/master

    Fixes inconsistent fps issues (fps reading vs fps writing)

commit 852286e
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Tue Jan 10 17:25:40 2023 +0100

    Automatically convert images to RGB color space

    Inference only works in RGB, so RGBA and grayscale images need to be
    transformed first. Output is always RGB, regardless of input format.

commit edfe190
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Tue Jan 10 17:11:56 2023 +0100

    Fix centerface type hint

commit d013a08
Author: Frederico B. K <frekle@kth.se>
Date:   Thu Jun 9 10:36:07 2022 +0200

    fix 25fps issue

commit b1f0656
Author: Frederico B. K <frekle@kth.se>
Date:   Thu Jun 9 10:34:37 2022 +0200

    fix 25fps issue

commit b80a601
Author: mdraw <martin.drawitsch@gmail.com>
Date:   Wed May 18 15:48:53 2022 +0200

    Support overriding fps in --ffmpeg-config flag

    fps value still defaults to source fps, but you can now override it
    to e.g. 15 through --ffmpeg-config='{"fps": 15}'.

    Thanks for the report @Karl48071

    Closing ORB-HD#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants