{"id":22249712,"url":"https://github.com/jakubvalenta/video-composer","last_synced_at":"2025-07-28T04:31:58.523Z","repository":{"id":7893492,"uuid":"56781902","full_name":"jakubvalenta/video-composer","owner":"jakubvalenta","description":"Batch cut and compose video clips","archived":false,"fork":false,"pushed_at":"2022-12-09T05:22:30.000Z","size":102,"stargazers_count":3,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-05-27T21:15:41.786Z","etag":null,"topics":["batch","composition","csv","cut","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakubvalenta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-21T14:47:22.000Z","updated_at":"2023-05-27T21:15:41.786Z","dependencies_parsed_at":"2023-01-11T17:15:48.377Z","dependency_job_id":null,"html_url":"https://github.com/jakubvalenta/video-composer","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fvideo-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fvideo-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fvideo-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fvideo-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubvalenta","download_url":"https://codeload.github.com/jakubvalenta/video-composer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227866566,"owners_count":17831814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","composition","csv","cut","video"],"created_at":"2024-12-03T06:28:21.382Z","updated_at":"2024-12-03T06:28:21.864Z","avatar_url":"https://github.com/jakubvalenta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Composer\n\nBatch cut and compose video clips.\n\nReads information about which video files to cut and at which timestamps from a\nCSV spreadsheet.\n\nWrites the cut clips either as separate files or joined in one video.\n\nUses [MoviePy](https://zulko.github.io/moviepy/index.html) under the hood.\n\n## Installation\n\n1. Install [Python \u003e= 3.9](https://www.python.org/).\n\n2. Install Video Composer as a pip package:\n\n    ``` shell\n    $ pip install -e .  # byexample: +pass\n    ```\n\n    This will make the executable `video-composer` available globally.\n\n## Usage\n\n### Input CSV spreadsheet\n\nVideo Composer takes a **semicolon-separated** CSV spreadsheet as its input. It\nmust have at least three columns:\n\n- video file path\n- timestamp where to start the cut; format:\n  `\u003chours\u003e:\u003cminutes\u003e:\u003cseconds\u003e.\u003cmilliseconds\u003e`\n- timestamp where to end the cut; format:\n  `\u003chours\u003e:\u003cminutes\u003e:\u003cseconds\u003e.\u003cmilliseconds\u003e`\n\nOptionally, a fourth column can be present:\n\n- intertitle text\n\nEmpty lines and lines starting with `#` will be ignored.\n\nExample:\n\n``` csv\n# my_composition.csv\nfoo.avi;00:12:24.677;00:12:40.860\nbar/spam.mp4;01:00:03.000;01:05:00.000;\"Intertitle text\"\n```\n\n### Testing videos\n\nBefore going on with the usage examples, let's first generate two testing videos\nand an input CSV spreadsheet.\n\n``` shell\n$ mkdir -p test  # byexample: +pass\n$ cd test\n$ [ -f testsrc.mpg ] || ffmpeg -f lavfi -i testsrc=duration=50:size=768x480:rate=25 testsrc.mpg  # byexample: +pass\n$ [ -f smptebars.mp4 ] || ffmpeg -f lavfi -i smptebars=duration=50:size=768x480:rate=25 smptebars.mp4  # byexample: +pass\n$ cat \u003e input.csv \u003c\u003cEOF\n\u003e testsrc.mpg;00:00:05,200;00:00:08,900;\"Foo!\"\n\u003e smptebars.mp4;00:00:40,000;00:00:42,500;\"Bar, spam...\"\n\u003e EOF\n```\n\n### Basic usage\n\nCut each source video specified in the input CSV and render each output video as\na separate file:\n\n``` shell\n$ video-composer -v input.csv --output clips  # byexample: +pass\n$ ls clips  # byexample: +norm-ws\nsmptebars-00_00_40_000-00_00_42_500.mp4\ntestsrc-00_00_05_200-00_00_08_900.mp4\n```\n\nCut each source video specified in the input CSV and join all output videos as\none file:\n\n``` shell\n$ video-composer -v input.csv --join output.mp4  # byexample: +pass\n$ ls output.mp4\noutput.mp4\n```\n\nIf your source video files are in a different directory, use the option\n`--clips` to specify their location:\n\n``` shell\n$ pushd .. \u003e /dev/null\n$ video-composer -v test/input.csv --join test/output2.mp4 --clips test  # byexample: +pass\n$ popd \u003e /dev/null\n$ ls output2.mp4\noutput2.mp4\n```\n\n### Specifying video format\n\nUse the `--video-ext` option to set the file extension of the file. Video\nComposer will then choose the right video codec automatically.\n\n``` shell\n$ video-composer -v input.csv --video-ext webm --output clips_video_format  # byexample: +pass\n$ ls clips_video_format  # byexample: +norm-ws\nsmptebars-00_00_40_000-00_00_42_500.webm\ntestsrc-00_00_05_200-00_00_08_900.webm\n```\n\nThere are also more options to set the output video FPS, to set the video codec\nexplicitly and to pass additional parameters to FFmpeg.\n\n``` shell\n$ video-composer -v input.csv \\\n\u003e                --video-fps 10 \\\n\u003e                --video-ext foo.webm \\\n\u003e                --video-codec vp8 \\\n\u003e                --video-params=\"-vf eq=gamma=1.5\" \\\n\u003e                --output clips_video_format_advanced  # byexample: +pass\n$ ls clips_video_format_advanced  # byexample: +norm-ws\nsmptebars-00_00_40_000-00_00_42_500.foo.webm\ntestsrc-00_00_05_200-00_00_08_900.foo.webm\n```\n\n### Posprocessing\n\nUse the options `--resize`, `--speed` and `--fadeout` to postprocess the video.\n\nWhen resizing the video, the video will be resized to cover the specified\nframe. Anything part of the video that doesn't fit the frame due to difference\nin aspect ratio will be cropped.\n\n``` shell\n$ video-composer -v input.csv \\\n\u003e                --resize 300x300 \\\n\u003e                --speed 0.5 \\\n\u003e                --fadeout 5 \\\n\u003e                --join output_postprocessed.mp4  # byexample: +pass\n$ ls output_postprocessed.mp4\noutput_postprocessed.mp4\n```\n\n### Intertitles\n\nUse the option `--intertitles` to prepend a intertitle clip to each output\nvideo. The default is 5s black video with a white centered text in Arial.\n\nThe text is read from the fourth column of the input CSV spreadsheet.\n\n``` shell\n$ video-composer -v input.csv --intertitles --join output_intertitles.mp4  # byexample: +pass\n$ ls output_intertitles.mp4\noutput_intertitles.mp4\n```\n\nYou can also specify custom intertitle text color, font, font size, position and\nduration.\n\n``` shell\n$ video-composer -v input.csv \\\n\u003e                --intertitles \\\n\u003e                --intertitle-color \"#ff0000\" \\\n\u003e                --intertitle-font \"DejaVu-Serif-Condensed\" \\\n\u003e                --intertitle-fontsize 96 \\\n\u003e                --intertitle-position 'top' \\\n\u003e                --intertitle-duration 5 \\\n\u003e                --join output_intertitles_custom.mp4  # byexample: +pass\n$ ls output_intertitles_custom.mp4\noutput_intertitles_custom.mp4\n```\n\n### More\n\nSee the full list of available options:\n\n``` shell\n$ video-composer -h  # byexample: +norm-ws +rm=~\nusage: Video Composer [-h] [-i INPUT] [-c CLIPS]\n                      (-o OUTPUT_DIR | -j OUTPUT_FILE) [-vf VIDEO_FPS]\n                      [-ve VIDEO_EXT] [-vc VIDEO_CODEC] [-vp FFMPEG_PARAMS]\n                      [-r RESIZE] [-rw RESIZE_WIDTH] [-rh RESIZE_HEIGHT]\n                      [-sp SPEED] [-fd FADEOUT] [-sb SUBTITLES] [-it]\n                      [-ic INTERTITLE_COLOR] [-if INTERTITLE_FONT]\n                      [-is INTERTITLE_FONTSIZE] [-ip INTERTITLE_POSITION]\n                      [-id INTERTITLE_DURATION] [-v] [-l LIMIT]\n                      [csv]\n~\npositional arguments:\n  csv                   CSV file with the list of source video paths and\n                        timestamps where to cut them\n~\noptional arguments:\n  -h, --help            show this help message and exit\n  -i INPUT, --input INPUT\n                        [DEPRECATED] Same as the positional argument CSV\n  -c CLIPS, --clips CLIPS\n                        Directory where to look for the source video files;\n                        defaults to the current directory\n  -o OUTPUT_DIR, --output OUTPUT_DIR\n                        Write each output video as a separate file in this\n                        directory; Either --output or --join must be\n                        specified.\n  -j OUTPUT_FILE, --join OUTPUT_FILE\n                        Join all output videos into this one video file;\n                        Either --output or --join must be specified.\n~\nvideo format:\n  -vf VIDEO_FPS, --video-fps VIDEO_FPS\n                        Output video FPS; defaults to 24\n  -ve VIDEO_EXT, --video-ext VIDEO_EXT\n                        Output video file extension; defaults to .mp4\n  -vc VIDEO_CODEC, --video-codec VIDEO_CODEC\n                        Output video codec; defaults to not set, which means\n                        that moviepy will choose the codec automatically\n  -vp FFMPEG_PARAMS, --video-params FFMPEG_PARAMS\n                        Additional FFmpeg parameters; example: --video-\n                        params=\"-vf eq=gamma=1.5\"\n~\npost-processing:\n  -r RESIZE, --resize RESIZE\n                        Resize output video to passed size in format\n                        WIDTHxHEIGHT; example: --resize 1200x675\n  -rw RESIZE_WIDTH, --resize-width RESIZE_WIDTH\n                        [DEPRECATED] Use --resize WIDTHxHEIGHT instead\n  -rh RESIZE_HEIGHT, --resize-height RESIZE_HEIGHT\n                        [DEPRECATED] Use --resize WIDTHxHEIGHT instead\n  -sp SPEED, --speed SPEED\n                        Change speed of the output video by factor; example:\n                        --speed 1: no change, --speed 0.5: half the normal\n                        speed, --speed 3: three times the normal speed\n  -fd FADEOUT, --fadeout FADEOUT\n                        Duration of a fade-to-black effect at the end of each\n                        output video; defaults to 0 which means no fade-out\n~\nsubtitles:\n  -sb SUBTITLES, --subtitles SUBTITLES\n                        [NOT IMPLEMENTED] Burn subtitles in the video\n~\nintertitles:\n  -it, --intertitles    Prepend an intertitle to each output video\n  -ic INTERTITLE_COLOR, --intertitle-color INTERTITLE_COLOR\n                        Intertitle text color; defaults to white\n  -if INTERTITLE_FONT, --intertitle-font INTERTITLE_FONT\n                        Intertitle font; defaults to Arial\n  -is INTERTITLE_FONTSIZE, --intertitle-fontsize INTERTITLE_FONTSIZE\n                        Intertitle font size in px; defaults to 48\n  -ip INTERTITLE_POSITION, --intertitle-position INTERTITLE_POSITION\n                        Intertitle position; defaults to center\n  -id INTERTITLE_DURATION, --intertitle-duration INTERTITLE_DURATION\n                        Intertitle duration in seconds; defaults to 3\n~\ndebugging:\n  -v, --verbose         Enable verbose logging\n  -l LIMIT, --limit LIMIT\n                        Process maximum this number of clips; defaults to -1\n                        which means to process all clips\n```\n\n### Deprecated options\n\nThese options are deprecated but available for compatibility with previous\nversion of Video Composer:\n\n``` shell\n$ video-composer -v -i input.csv -rw 300 -rh 300 --join output_deprecated_options.mp4  # byexample: +pass\n```\n\n### Not implemented yet\n\nThese options are not implemented yet:\n\n``` shell\n$ video-composer -v input.csv --subtitles test_subtitles.srt --join output_subtitles.mp4 || true  # byexample: +pass\n```\n\n## Development\n\n### Installation\n\n``` shell\n$ make setup-dev  # byexample: +skip\n```\n\n### Testing and linting\n\n``` shell\n$ make test  # byexample: +skip\n$ make lint  # byexample: +skip\n$ make byexample  # byexample: +skip\n```\n\n### Help\n\n``` shell\n$ make help  # byexample: +skip\n```\n\n## Contributing\n\n__Feel free to remix this piece of software.__ See [NOTICE](./NOTICE) and\n[LICENSE](./LICENSE) for license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubvalenta%2Fvideo-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubvalenta%2Fvideo-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubvalenta%2Fvideo-composer/lists"}