wave2future / LargeVideoClipper

Large Video Clipper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LargeVideoClipper

Large Video Clipper

The original intention of the tool

A friend of mine got a 90G video file in a mobile hard drive that needs to be edited. Due to the large file size, most general purpose computers cannot edit it. The large file needs to be cut into smaller video files. With the help of Anthropic's Claude, two methods were used to achieve the function of cutting large video files.

Please modify the path of the video file yourself; the code tentatively cuts the video into 10-minute segments.

Method 1: LargeVideoClipper1.py

Install ffmpeg and ffprobe. You can follow these steps:

  • Download ffmpeg: You can download it from https://ffmpeg.org/download.html, choose the Windows/Mac OS version

  • Unzip the downloaded file, and run in the terminal:

    # bash
    sudo mv ffmpeg /usr/local/bin 
    sudo mv ffprobe /usr/local/bin
    
  • Then you can call ffmpeg and ffprobe in Python.

I have experimented with cutting a 2G video file, which took 2-3 minutes.

Method 2:LargeVideoClipper2.py

Use the MoviePy video processing library instead of ffmpeg and ffprobe. I have experimented with method two to cut a 1.5G video file, which took about 20 minutes.

# bash
pip install moviepy

Due to differences in computer platforms, video formats, etc., there may be some bugs or issues in the above methods when actually used. If you encounter any issues when implementing this solution, feel free to submit them in the "Issues" section of this GitHub repository. I will respond promptly and provide suggestions for solutions. Pull Requests with any suggestions for improving this solution are also welcome.


分割大视频文件工具

工具制作初衷 一个朋友有一个存在移动硬盘中的90G左右的视频文件需要剪辑,由于文件太大,一般配置的电脑都剪辑不了。需要将大文件剪辑成小的视频文件。 借助Anthropic的Claude的帮助,用了两种方法来实现切割大视频文件的功能。

视频文件的路径请自行修改;代码中暂定切割成10分钟一段视频。

方法一:LargeVideoClipper1.py

安装ffmpeg和ffprobe。可以按照以下步骤进行:

  • 下载ffmpeg:可以从 https://ffmpeg.org/download.html 下载, 选择对应的 Windows 或 Mac 版本

  • 解压下载的文件,在终端运行:

    # bash
    sudo mv ffmpeg /usr/local/bin
    sudo mv ffprobe /usr/local/bin
    
  • 然后就可以在Python中调用ffmpeg和ffprobe了。

实验了下方法一切割2G左右的视频文件,用时2-3分钟。

方法二:LargeVideoClipper2.py

使用视频处理库MoviePy代替ffmpeg和ffprobe。

实验了用方法二下切割1.5G左右的视频文件,用时20分钟左右。

# bash
pip install moviepy

About

Large Video Clipper


Languages

Language:Python 100.0%