我有一堆.mp4文件(无DRM)。每个文件包括一个儿童电视节目的两集。我想简单地将文件一分为二而无需重新编码。最好的方法是什么?最好使用GUI(因为我需要跳到每个文件的正确部分以找到两个情节之间的分隔线)。
谢谢,
建议您在媒体播放器中打开视频,以找到要分割的时间。然后,您可以将ffmpeg与以下脚本一起使用。它不会重新编码视频。
#!/bin/bash
# Split Video Script
# Usage: script_name file_name split-point
# Example: split_video_script bugs_bunny.mp4 31:23
# Instructions:
# 1. Type the name of your script (if it is already added to ~/bin and marked as executable).
# 2. Type the file name including path to it if necessary.
# 3. Type the time where you want to split the video. It goes in minutes:seconds
# Get length in seconds
length=$(echo "$2" | awk -F: '{print ($1 * 60) + $2}')
# Get filename without extension
fname="${1%.*}"
# First half
ffmpeg -i "${fname}.mp4" -c copy -t "$length" "${fname}1.mp4"
# Second half
ffmpeg -i "${fname}.mp4" -c copy -ss "$length" "${fname}2.mp4"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句