CodeFormer icon indicating copy to clipboard operation
CodeFormer copied to clipboard

#Generated video without sound

Open BiubiuGreen opened this issue 2 years ago • 4 comments

Hi, Why is there no sound in the generated video? My original video has sound. I've tested it three times. Is there something wrong?

BiubiuGreen avatar Nov 02 '22 13:11 BiubiuGreen

The current inference script only supports video frame enhancement, its workflow is as follows:

1. Extract frame images from the input video 
2. Enhance frame images by CodeFormer and RealESRGAN 
3. Write the enhanced images into the output video

The sound is not considered in this frame enhancement pipeline.

You can easily add video sound via other editing software such as Adobe Premiere Pro, iMovie, etc.

Also, you are welcome to update our script and report a PR to us :-)

sczhou avatar Nov 03 '22 09:11 sczhou

@BiubiuGreen You can use FFmpeg to add the audio back into your video

Instructions:

Install FFmpeg (Mac) Install FFmpeg (Windows)
- Open Terminal - Open Powershell
- Install Homebrew - Install Chocolatey
- run brew install ffmpeg - run choco install ffmpeg

FFmpeg Command

ffmpeg -an -i $VIDEO -vn -i $AUDIO -c:v copy $OUTPUT

  • $VIDEO = path to improved video
  • $AUDIO = path to original video (with audio)
  • $OUTPUT= path to output e.g:"/output.mp4"

ababilinski avatar Nov 12 '22 18:11 ababilinski

@sczhou Thank you for your patience in explaining and making me understand why the video has no sound.💜

I'm glad you invited me to update the script. However, my coding ability is limited. I have to change the video file name manually every time I upload a video. The script is not automated enough.

I am worried that it will add workload to you.😂


@ababilinski Thank you for your guidance on my specific commands. 💜

It helped me a lot and I'll try what you said later.

BiubiuGreen avatar Nov 26 '22 17:11 BiubiuGreen

Hi @BiubiuGreen, the updated CodeFormer scripts can add back the original sound into enhanced video. Welcome to have a try! :hugs:

sczhou avatar Dec 22 '22 12:12 sczhou

Hi @BiubiuGreen, the updated CodeFormer scripts can add back the original sound into enhanced video. Welcome to have a try! 🤗

@sczhou I tried it, but still no sound

954L avatar Jun 15 '23 09:06 954L