Sxjdwang / TalkLip

373 stars 34 forks source link

about output file tmp.avi and tmp.mp4 #1

Closed chikiuso closed 1 year ago

chikiuso commented 1 year ago

Good morning,

It is a good project, I just have a try, it run the following command :

python3 inf_demo.py --video_path ./input.mp4 --wav_path ./voice.wav --ckpt_path ./global_contrastive.pth --avhubert_root ./avhubert

It run without error , but the output file tmp.avi is just 21Kb and could not play properly, and the tmp.mp4 is 0 kb, may I have your suggestion what wrong I did? or I missed something? thanks.

Sxjdwang commented 1 year ago

You can remove '-loglevel quiet' in the 434-th line of inf_demo.py and re-run it for details of the error.

chikiuso commented 1 year ago

Hi @Sxjdwang , thanks for your suggestion, I just remove the '-loglevel quiet', it seems the line is used to turn tmp.avi into mp4, it failed to convert as the input codec is unrecognizable and I found that the tmp.avi is still a few Kb file and could not be played , do I missed somthing? here is the message I got :

Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from './voice.wav': Duration: 00:00:30.02, bitrate: 256 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s [avi @ 0x55df41723800] Could not find codec parameters for stream 0 (Video: mpeg4 (DIVX / 0x58564944), none, 180x180): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #1, avi, from 'tmp.avi': Metadata: encoder : Lavf58.45.100 Duration: N/A, start: 0.000000, bitrate: N/A Stream #1:0: Video: mpeg4 (DIVX / 0x58564944), none, 180x180, 25 fps, 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #1:0 -> #0:0 (mpeg4 (native) -> h264 (libx264)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native)) Press [q] to stop, [?] for help Cannot determine format of input stream 1:0 after EOF Error marking filters as finished Conversion failed!

About the AVhubert, I haven't put any checkpoint or model under its folder, is it ok? or I should put some checkpoint there? thanks.

Sxjdwang commented 1 year ago

For inf_test and inf_demo, no av-hubert checkpoint is required.

I find a bug in inf_demo.py that I suppose the width and height of output videos are the same when I set cv2.VideoWriter(). I have fixed it. You may try it again.

chikiuso commented 1 year ago

thanks a lot, it work fine!