Quantcast
Channel: phi-net.gr
Viewing all articles
Browse latest Browse all 5

Stream splitter

0
0

Here we present a bash script for unix systems, for large multimedia file splitting with the use of index files containing timestamps. Script invokes ffmpeg internally (or any compatible tool). Usually this kind of files can be downloaded from popular multimedia sources, eg youtube, along with a free-styled index file. We wanted to create a multimedia splitter much more generic than the famous mp3split. An index file is a sequence of stanzas in the form:

(part name) (one or more spaces) (time spec)

The (time spec) is the start time of the part. The end time is expected to be found in the next stanza, or equals the end of stream, if no other stanzas exist in the index file.

This script is quite flexible, as you can see in its source code. Feel free to download it here and contact me at emnazlidis at gmail dot com

To run this script you will need a fairly recent version of bash (as of 09/2015), of ffmpeg and any POSIX compatible sed.

So, say you wave downloaded a big file

Best of Joy Division - Joy Division.mp4

with its index file “Best of Joy Division - Joy Division.mp4

Digital 00:00
Disorder 02:52
Shadowplay 06:22
New 10:14
Transmission 15:01
Atmosphere 18:38
Dead 22:48
She's 27:44
Love 32:40
These 36:07
Twenty 39:35
Heart 44:03
Incubation 49:53
Isolation 52:46


You may then invoke stream-split.sh as follows

$] ./stream-split.sh --src "Best of Joy Division - Joy Division.mp4" --ind "Best of Joy Division - Joy Division.mp4" --format '$numf - $name.aac' --ffmpeg-opts '-acodec copy'

to get the splitted multimedia bundle.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images