TMElyralab / MuseTalk

MuseTalk: Real-Time High Quality Lip Synchorization with Latent Space Inpainting
Other
2.51k stars 308 forks source link

训练视频预处理,音视频帧率如何调整 #75

Closed gobigrassland closed 4 months ago

gobigrassland commented 4 months ago

(1)项目提到要求hdtf训练集都处理成25fps,可以使用ffmpeg处理

ffmpeg -i input.mp4 -r 25 output.mp4

(2)原始视频中音频部分,都是44.1kHZ。音频部分是不是不需要调整

(3)推理代码中,音频部分是一秒50个mel特征,如果视频fps不能被50整除,是否会影响模型效果呢

        center_idx = int(vid_idx*50/fps)
        left_idx = center_idx-audio_feat_length[0]*2
        right_idx = center_idx + (audio_feat_length[1]+1)*2

请问原始训练集,视频帧率与音频 是这样处理的吗?

gobigrassland commented 4 months ago

whisper paper: All audio is re-sampled to 16,000 Hz, and an 80-channel logmagnitude Mel spectrogram representation is computed on 25-millisecond windows with a stride of 10 milliseconds.

whisper 原论文提到音频都重采样为16000Hz。是不是MuseTalk训练数据预处理,将视频帧率调整为25fps,将音频调整为16000Hz呢?

ffmpeg -i input.mp4 -r 25 -ar 16000 output.mp4
czk32611 commented 4 months ago

whisper应该会在laod音频时自动将音频转换成16k Hz https://github.com/TMElyralab/MuseTalk/blob/main/musetalk/whisper/whisper/audio.py#L22

czk32611 commented 4 months ago

(3)推理代码中,音频部分是一秒50个mel特征,如果视频fps不能被50整除,是否会影响模型效果呢

(3)推理代码中,音频部分是一秒50个mel特征,如果视频fps不能被50整除,是否会影响模型效果呢

其实我们没有实验过,但是代码是兼容这种情况的