faceswap icon indicating copy to clipboard operation
faceswap copied to clipboard

Plugin to merge frame to video with audio

Open ruah1984 opened this issue 8 years ago • 9 comments

HI , can we add a plugin to merge frame to video with audio?

ruah1984 avatar Jan 11 '18 21:01 ruah1984

Hello,

I don't understand the request. Can you provide more info please ?

Clorr avatar Jan 12 '18 10:01 Clorr

He asks a plugin which converts frames into the video and adds original audio from source video into fake video.

Jack29913 avatar Jan 12 '18 11:01 Jack29913

:-D Frame, not flame!

I currently have in mind the @shaoanlu method with moviepy, but I have not much time to work on it. There is a draft pull request if you want to have a look

Clorr avatar Jan 12 '18 11:01 Clorr

In my view this can be archived with FFMPEG easily. So it's not a priority. I'm waiting for GAN with masking it will be a game changer if its like in those gifs

Jack29913 avatar Jan 12 '18 11:01 Jack29913

Can you provide some guidelines to @ruah1984 , if he needs some ?

Clorr avatar Jan 12 '18 12:01 Clorr

For the gan plugin, the classes are somewhat ready in https://github.com/shaoanlu/faceswap-GAN/blob/master/temp/faceswap_GAN_keras.ipynb I have to merge them, hopefully later today

Clorr avatar Jan 12 '18 12:01 Clorr

sorry for the typo. no hurry i think i can wait until GAN plugin ready in deepfakes/faceswap. thanks.

ruah1984 avatar Jan 12 '18 12:01 ruah1984

sure. i use these commands.

frames to video ffmpeg -f image2 -framerate <fps_of_source_video> -i "img (%d).jpg" -vcodec libx264 -profile:v high444 -refs 16 -crf 0 -preset ultrafast input_0.mp4

adding sound ffmpeg -i input_0.mp4 -i source.mp4 -c copy -map 0:0 -map 1:1 -shortest out.mp4

before using these commands, you should copy source frames to merged folder and say NO when it asks if it should overwrite existing files. You should do thing step because there might be some frames without faces in them or algorithm may have failed to detect faces for specific frames. If you fail to do this step correctly final video and audio won't sync.

Jack29913 avatar Jan 12 '18 13:01 Jack29913

I'm closing this as I consider it to be handled in #10

Clorr avatar Feb 02 '18 17:02 Clorr