Skip to main content

Split one media file into many based on a list of offsets

Project description

A tool that takes a media file and a list file with offsets and processes the list file to split the media file up into pieces using ffmpeg.

Usage

Example usage:

$ splitmedia media.file list.txt output_path

Output

Splitting the Quake soundtrack:

$ splitmedia "Quake Soundtrack.m4a" list_file.quake quake_output
OFF 000:00:00.000 DUR 000308.000 01_QuakeTheme.m4a
OFF 000:05:08.000 DUR 000146.000 02_Aftermath.m4a
OFF 000:07:34.000 DUR 000500.000 03_TheHallofSouls.m4a
OFF 000:15:54.000 DUR 000366.000 04_ItisRaed.m4a
OFF 000:22:00.000 DUR 000444.000 05_ParallelDimensions.m4a
OFF 000:29:24.000 DUR 000519.000 06_Life.m4a
OFF 000:38:03.000 DUR 000336.000 07_Damation.m4a
OFF 000:43:39.000 DUR 000388.000 08_Focus.m4a
OFF 000:50:07.000 DUR 000213.000 09_Falling.m4a
OFF 000:53:40.000 DUR 000315.000 10_TheReaction.m4a
...

Dependencies

List File Example

Also provided as list_file.formats in the project:

0:00:00.123 filepart1
0:03:10     filepart2
0:09:20     filepart3
1300        filepart4
1345.456    filepart5
1347        filepart6

List File Notes

  • Offsets can be integers or full time specifications

  • Seconds can be decimals

  • Can have hash-prefixed comments

  • Can have empty lines (for organization)

  • The filenames will be sanitized (innappropriate characters removed) automatically

Command Line

Command line help:

usage: splitmedia [-h] media_filepath list_filepath output_path

Split the media file into multiple parts by times

positional arguments:
  media_filepath  File-path of the media file
  list_filepath   File-path of the list
  output_path     Output path

optional arguments:
  -h, --help      show this help message and exit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splitmedia-0.2.1.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file splitmedia-0.2.1.tar.gz.

File metadata

  • Download URL: splitmedia-0.2.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for splitmedia-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7f0b93896285a081a7902f71b3ec2d8ad913c060e4df11ce63375ff43c9295d2
MD5 98d76ae7363aac27fb37e93672e768cd
BLAKE2b-256 946e167fcfb4c9f3adf61ea0f28f135d30d01ca7fc5058dcfe7ad58654dc6245

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page