s9roll7 / animatediff-cli-prompt-travel

animatediff prompt travel
Apache License 2.0
1.17k stars 105 forks source link

MP4 movie output codec and Discord #237

Open SoftologyPro opened 4 months ago

SoftologyPro commented 4 months ago

This is a minor issue, but I would appreciate a fix if possible.

Having a quick look at the code it seems to save MP4 videos as H264 codec. These play OK once double-clicked in Windows, but when attached to Discord they do not auto-play inline and need to be downloaded first. ie you do not get the thumbnail with a play triangle button, you just get the file as a filename showing with a download option.

I use FFmpeg outside AnimateDiff Prompt Travel to make MP4 H264 videos and those movies always play inline for Discord.

Is there a simple fix for this?

Otherwise, the workaround if you want to have a well behaved Discord attachment is to use Handbrake to convert the output mp4 to a video format that Discord likes.

Thanks.

SoftologyPro commented 4 months ago

OK, I found the issue. src\animatediff\rife\ffmpeg.py line 208 Change libx265 to libx264

Results now play inline for Discord and upload fine to Twitter. No more Handbrake or other conversion needed.