Skip to content

Commit 2f65a0f

Browse files
committed
Add split video
Add split video Signed-off-by: Bensuperpc <[email protected]>
1 parent 5d4558b commit 2f65a0f

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Commands.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ For encoding, creating, recording or downloading videos
150150
- [`youtube-dl-playlist-audio`](#youtube-dl-playlist-audio)
151151
- [`add-video-watermark`](#add-video-watermark)
152152
- [`add-video-logo`](#add-video-logo)
153+
- [`split-video`](#split-video)
153154
- (WIP)
154155
### clean-arch
155156

@@ -761,6 +762,14 @@ Add logo (ex: .png) in video
761762
$ add-video-logo <input video> <logo> <overlay X (from from the top-left)> <overlay Y (from from the top-left)> <output>
762763
```
763764

765+
### split-video
766+
767+
Split video in part of x time
768+
769+
```bash
770+
$ split-video <input video> <time (00:20:00 for parts of 20 minutes)>
771+
```
772+
764773
### screen-capture
765774

766775
Screen capture (Video only) with ffmpeg and x11grab

video/split-video.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#//////////////////////////////////////////////////////////////
3+
#// ____ //
4+
#// | __ ) ___ _ __ ___ _ _ _ __ ___ _ __ _ __ ___ //
5+
#// | _ \ / _ \ '_ \/ __| | | | '_ \ / _ \ '__| '_ \ / __| //
6+
#// | |_) | __/ | | \__ \ |_| | |_) | __/ | | |_) | (__ //
7+
#// |____/ \___|_| |_|___/\__,_| .__/ \___|_| | .__/ \___| //
8+
#// |_| |_| //
9+
#//////////////////////////////////////////////////////////////
10+
#// //
11+
#// Script, 2021 //
12+
#// Created: 11, August, 2021 //
13+
#// Modified: 11, August, 2021 //
14+
#// file: - //
15+
#// - //
16+
#// Source: //
17+
#// OS: ALL //
18+
#// CPU: ALL //
19+
#// //
20+
#//////////////////////////////////////////////////////////////
21+
22+
23+
type ffmpeg >/dev/null 2>&1 || { echo "ffmpeg could not be found" >&2; exit 1; }
24+
25+
if (( $# == 2 )); then
26+
ffmpeg -i "$1" -c copy -map 0 -segment_time "$2" \
27+
-reset_timestamps 1 -f segment output%03d.mkv
28+
else
29+
echo "Usage: ${0##*/} <input video> <time (00:20:00 for parts of 20 minutes)>"
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)