{dplayer src=" https://cdn.9ywk.com/wx/ywx.mp4 " /}

principle

  1. Export each picture of the video
  2. ASCII conversion for each frame
  3. Compose the converted ASCII image into video

Please refer to this article for Python installation
https://www.9ywk.com/Python.html

Library to be installed for Python

opencv

 pip3 install opencv-python

pillow

 pip3 install pillow

After installing the library, place the video in the folder of the py script and modify it video_path The next parameter is your video path name to run

 if __name__ == '__main__': video_path = 'video/heiren.mp4' save_pic_path = 'cache_pic' save_charpic_path = 'cache_char'

The default exported video is .avi Format, you can modify about 107 lines of code, such as mp4

 video_writter= VideoWriter('video/new_char_video.mp4' ,

source code

https://github.com/hongcyu/char_painting

Final explanation

The script does not process audio, which can be processed by other software.


End
If you think my article is useful to you, please feel free to appreciate it